pub struct RacyLock<T: 'static> {
inner: OnceBox<T>,
init: fn() -> T,
}
Expand description
An alternative to LazyLock
based on [OnceBox
].
Fields§
§inner: OnceBox<T>
§init: fn() -> T
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RacyLock<T>
impl<T> RefUnwindSafe for RacyLock<T>where
T: RefUnwindSafe,
impl<T> Send for RacyLock<T>where
T: Send,
impl<T> Sync for RacyLock<T>
impl<T> Unpin for RacyLock<T>
impl<T> UnwindSafe for RacyLock<T>where
T: RefUnwindSafe + 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