pub struct LibState(/* private fields */);Implementations§
Source§impl LibState
impl LibState
Sourcepub fn get_or_default<T>(&mut self) -> &mut T
pub fn get_or_default<T>(&mut self) -> &mut T
Look up and return the context global library state of type
T.
If none is registered in this context for T then create one
using T::default
Sourcepub fn get_or_else<T, F>(&mut self, f: F) -> &mut T
pub fn get_or_else<T, F>(&mut self, f: F) -> &mut T
Look up and return the context global library state of type
T.
If none is registered in this context for T then create one
using the provided function.
Sourcepub fn get<T>(&mut self) -> Option<&T>
pub fn get<T>(&mut self) -> Option<&T>
Look up and return a reference to the context global library
state of type T.
If none is registered in this context for T return None
Sourcepub fn get_mut<T>(&mut self) -> Option<&mut T>
pub fn get_mut<T>(&mut self) -> Option<&mut T>
Look up and return a mutable reference to the context global
library state of type T.
If none is registered return None
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LibState
impl !RefUnwindSafe for LibState
impl Send for LibState
impl Sync for LibState
impl Unpin for LibState
impl !UnwindSafe for LibState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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