pub enum TextEncoding {
UnicodeCodePoint,
Utf8CodeUnit,
Utf16CodeUnit,
GraphemeCluster,
}Expand description
How the indexes into a string are counted
Variants§
UnicodeCodePoint
Each unicode code point counts as one unit
Utf8CodeUnit
Each UTF-8 code unit counts as one unit (i.e. each byte in the utf-8 encoding of the string counts as one unit)
Utf16CodeUnit
Each utf-16 code unit counts as one unit, (i.e. each byte in the utf-16 encoding of the string counts as one unit)
GraphemeCluster
Each grapheme cluster counts as one unit
Implementations§
Source§impl TextEncoding
impl TextEncoding
Sourcepub fn platform_default() -> Self
pub fn platform_default() -> Self
Return the default text encoding for the platform you are building for.
This is set to
- UTF-8 code units if the
utf8-indexingfeature is enabled. - UTF-16 code units if the
utf16-indexingfeature is enabled (as it is in the automerge-wasm build) - Unicode code points if neither feature is enabled.
Trait Implementations§
Source§impl Clone for TextEncoding
impl Clone for TextEncoding
Source§fn clone(&self) -> TextEncoding
fn clone(&self) -> TextEncoding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextEncoding
impl Debug for TextEncoding
Source§impl PartialEq for TextEncoding
impl PartialEq for TextEncoding
impl Copy for TextEncoding
impl Eq for TextEncoding
impl StructuralPartialEq for TextEncoding
Auto Trait Implementations§
impl Freeze for TextEncoding
impl RefUnwindSafe for TextEncoding
impl Send for TextEncoding
impl Sync for TextEncoding
impl Unpin for TextEncoding
impl UnwindSafe for TextEncoding
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more