pub struct SusLock<T: 'static> { /* private fields */ }
Expand description
Safety
LOL, there is a reason its called SusLock
Implementations§
source§impl<T: 'static> SusLock<T>
impl<T: 'static> SusLock<T>
sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Is the SusLock
initialized?
sourcepub fn get(&self) -> Option<&'static T>
pub fn get(&self) -> Option<&'static T>
Return the value of the SusLock
(if initialized).
sourcepub fn get_or_init(&self, f: impl FnOnce() -> T) -> &'static T
pub fn get_or_init(&self, f: impl FnOnce() -> T) -> &'static T
Return the value of the SusLock
, initializing it if not yet done.
Trait Implementations§
impl<T: RefUnwindSafe + UnwindSafe> RefUnwindSafe for SusLock<T>
impl<T: Send> Send for SusLock<T>
impl<T: Sync + Send> Sync for SusLock<T>
Auto Trait Implementations§
impl<T> Unpin for SusLock<T>where T: Unpin,
impl<T> UnwindSafe for SusLock<T>where T: 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