Enum google_api_proto::google::cloud::language::v1beta1::EncodingType
source · #[repr(i32)]pub enum EncodingType {
None = 0,
Utf8 = 1,
Utf16 = 2,
Utf32 = 3,
}
Expand description
Represents the text encoding that the caller uses to process the output.
Providing an EncodingType
is recommended because the API provides the
beginning offsets for various outputs, such as tokens and mentions, and
languages that natively use different text encodings may access offsets
differently.
Variants§
None = 0
If EncodingType
is not specified, encoding-dependent information (such as
begin_offset
) will be set at -1
.
Utf8 = 1
Encoding-dependent information (such as begin_offset
) is calculated based
on the UTF-8 encoding of the input. C++ and Go are examples of languages
that use this encoding natively.
Utf16 = 2
Encoding-dependent information (such as begin_offset
) is calculated based
on the UTF-16 encoding of the input. Java and Javascript are examples of
languages that use this encoding natively.
Utf32 = 3
Encoding-dependent information (such as begin_offset
) is calculated based
on the UTF-32 encoding of the input. Python is an example of a language
that uses this encoding natively.
Implementations§
source§impl EncodingType
impl EncodingType
source§impl EncodingType
impl EncodingType
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for EncodingType
impl Clone for EncodingType
source§fn clone(&self) -> EncodingType
fn clone(&self) -> EncodingType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EncodingType
impl Debug for EncodingType
source§impl Default for EncodingType
impl Default for EncodingType
source§fn default() -> EncodingType
fn default() -> EncodingType
source§impl From<EncodingType> for i32
impl From<EncodingType> for i32
source§fn from(value: EncodingType) -> i32
fn from(value: EncodingType) -> i32
source§impl Hash for EncodingType
impl Hash for EncodingType
source§impl Ord for EncodingType
impl Ord for EncodingType
source§fn cmp(&self, other: &EncodingType) -> Ordering
fn cmp(&self, other: &EncodingType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for EncodingType
impl PartialEq for EncodingType
source§fn eq(&self, other: &EncodingType) -> bool
fn eq(&self, other: &EncodingType) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for EncodingType
impl PartialOrd for EncodingType
source§fn partial_cmp(&self, other: &EncodingType) -> Option<Ordering>
fn partial_cmp(&self, other: &EncodingType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for EncodingType
impl TryFrom<i32> for EncodingType
§type Error = DecodeError
type Error = DecodeError
source§fn try_from(value: i32) -> Result<EncodingType, DecodeError>
fn try_from(value: i32) -> Result<EncodingType, DecodeError>
impl Copy for EncodingType
impl Eq for EncodingType
impl StructuralPartialEq for EncodingType
Auto Trait Implementations§
impl Freeze for EncodingType
impl RefUnwindSafe for EncodingType
impl Send for EncodingType
impl Sync for EncodingType
impl Unpin for EncodingType
impl UnwindSafe for EncodingType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request