pub struct Utf8Encoding;Trait Implementations§
Source§impl Encoding for Utf8Encoding
impl Encoding for Utf8Encoding
type Index = ()
type IndexShift = ()
fn zero_index() -> Self::Index
fn zero_shift() -> Self::IndexShift
fn get_index(_value: &Self::Index, utf8_index: usize) -> usize
fn get_shift(_value: &Self::IndexShift, utf8_shift: isize) -> isize
Source§fn calculate_indices<'a>(
_content: &str,
_match_visitor: impl Iterator<Item = EncodeIndices<'a, Self>>,
)
fn calculate_indices<'a>( _content: &str, _match_visitor: impl Iterator<Item = EncodeIndices<'a, Self>>, )
A iterator of indices. You are given the UTF-8 indices, and need to calculate the “custom” indices.
The UTF-8 indices are guaranteed to be sorted in ascending order by the start index.
Source§fn adjust_shift(_shift: &mut Self::IndexShift, _before: &str, _after: &str)
fn adjust_shift(_shift: &mut Self::IndexShift, _before: &str, _after: &str)
Calculates the change of an index from replacing
before with afterAuto Trait Implementations§
impl Freeze for Utf8Encoding
impl RefUnwindSafe for Utf8Encoding
impl Send for Utf8Encoding
impl Sync for Utf8Encoding
impl Unpin for Utf8Encoding
impl UnwindSafe for Utf8Encoding
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
§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> 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