pub struct LazyFormatContext { /* private fields */ }Expand description
A container for lazily initializing the global format context.
This type ensures the global format context is only initialized once, even in multithreaded contexts, and provides thread-safe access to the context.
Implementations§
Source§impl LazyFormatContext
impl LazyFormatContext
Sourcepub fn get(&self) -> MutexGuard<'_, Option<FormatContext>>
pub fn get(&self) -> MutexGuard<'_, Option<FormatContext>>
Gets a thread-safe reference to the format context, initializing it if necessary.
On first access, this method initializes the format context with standard registrations for tags, known values, functions, and parameters.
§Returns
A mutex guard containing a reference to the global format context.
Auto Trait Implementations§
impl !Freeze for LazyFormatContext
impl RefUnwindSafe for LazyFormatContext
impl Send for LazyFormatContext
impl Sync for LazyFormatContext
impl Unpin for LazyFormatContext
impl UnwindSafe for LazyFormatContext
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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