pub struct AtomicFnStore<'a>(/* private fields */);Expand description
Thread safe FnStore implementation.
Uses parking_lot’s RwLock to accuire mutable access to Map.
Implementations§
Source§impl<'a> AtomicFnStore<'a>
impl<'a> AtomicFnStore<'a>
pub fn new() -> Self
pub fn get_ptr<T: 'a + Send + Sync>( &self, key_fn: impl FnOnce() -> T, ) -> *const T
Sourcepub fn get<T: 'a + Send + Sync>(&self, key_fn: impl FnOnce() -> T) -> &T
pub fn get<T: 'a + Send + Sync>(&self, key_fn: impl FnOnce() -> T) -> &T
Get or compute value using key
Trait Implementations§
Source§impl<'a> Debug for AtomicFnStore<'a>
impl<'a> Debug for AtomicFnStore<'a>
Source§impl<'a> Default for AtomicFnStore<'a>
impl<'a> Default for AtomicFnStore<'a>
Source§fn default() -> AtomicFnStore<'a>
fn default() -> AtomicFnStore<'a>
Returns the “default value” for a type. Read more
impl Send for AtomicFnStore<'_>
impl Sync for AtomicFnStore<'_>
Auto Trait Implementations§
impl<'a> !Freeze for AtomicFnStore<'a>
impl<'a> !RefUnwindSafe for AtomicFnStore<'a>
impl<'a> Unpin for AtomicFnStore<'a>
impl<'a> !UnwindSafe for AtomicFnStore<'a>
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