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