pub struct Otherize<'a, T: Token, F: FnMut(T)>(/* private fields */);Expand description
Struct that allows to write! and format! by converting the string to
Tokens and passes them to a closure. All tokens have CommandCode::Other
except for space characters.
For example, write!(Tokenizer::new(|t| vec.push(t), "ab c") will
push four tokens to vec, where the first, second and fourth have
CommandCode::Other and the third has CommandCode::Space.
Implementations§
Trait Implementations§
Source§impl<'a, T: Token, F: FnMut(T)> CharWrite<<T as Token>::Char, <T as Token>::CS> for Otherize<'a, T, F>
impl<'a, T: Token, F: FnMut(T)> CharWrite<<T as Token>::Char, <T as Token>::CS> for Otherize<'a, T, F>
Auto Trait Implementations§
impl<'a, T, F> Freeze for Otherize<'a, T, F>
impl<'a, T, F> RefUnwindSafe for Otherize<'a, T, F>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, F> Send for Otherize<'a, T, F>
impl<'a, T, F> Sync for Otherize<'a, T, F>
impl<'a, T, F> Unpin for Otherize<'a, T, F>where
T: Unpin,
impl<'a, T, F> UnsafeUnpin for Otherize<'a, T, F>
impl<'a, T, F> !UnwindSafe for Otherize<'a, T, F>
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