pub struct LazyString<F>(/* private fields */)
where
F: Fn(&mut Formatter<'_>) -> Result<(), Error>;Expand description
A struct used to lazily defer creation of custom async logging messages until we know that the message is actually needed.
§Context
Logging in the async context explicitly requires passing of a context pointer to enable CDB to determine the source of error message. To that end, a custom logging function is used.
The LazyString captures a lambda that constructs the logging message and implements
std::fmt::Display, allowing string formatting to only be performed once we know a
message needs to be logged.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for LazyString<F>where
F: Freeze,
impl<F> RefUnwindSafe for LazyString<F>where
F: RefUnwindSafe,
impl<F> Send for LazyString<F>where
F: Send,
impl<F> Sync for LazyString<F>where
F: Sync,
impl<F> Unpin for LazyString<F>where
F: Unpin,
impl<F> UnsafeUnpin for LazyString<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for LazyString<F>where
F: UnwindSafe,
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