pub struct NormalizedString<'a>(/* private fields */);
Expand description
Type which represents a normalized string. This is to avoid calling normalize multiple times or forgetting to call normalization!
TODO: Annotate the type with the normalization type, once there are more than one.
Implementations§
Source§impl<'a> NormalizedString<'a>
impl<'a> NormalizedString<'a>
Sourcepub unsafe fn from_str(s: &'a str) -> NormalizedString<'a>
pub unsafe fn from_str(s: &'a str) -> NormalizedString<'a>
This function is unsafe, since the caller must ensure that the correct normalization was used. The normalization may vary by tokenizer. This mostly a backdoor which might be handy for certain optimizations or for testing.
§Safety
This is safe if s
is in fact correctly normalized already. The caller is
responsible for ensuring that.
Trait Implementations§
Source§impl<'a> Normalizable<'a> for NormalizedString<'a>
impl<'a> Normalizable<'a> for NormalizedString<'a>
fn normalize(self, _: bool) -> NormalizedString<'a>
Auto Trait Implementations§
impl<'a> Freeze for NormalizedString<'a>
impl<'a> RefUnwindSafe for NormalizedString<'a>
impl<'a> Send for NormalizedString<'a>
impl<'a> Sync for NormalizedString<'a>
impl<'a> Unpin for NormalizedString<'a>
impl<'a> UnwindSafe for NormalizedString<'a>
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> 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