#[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§
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§impl PartialOrd for EncodingType
impl PartialOrd for EncodingType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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