Struct fn_cache::BTreeCache
source · pub struct BTreeCache<'f, I, O>where
I: Ord,{ /* private fields */ }Expand description
Implementations§
source§impl<'f, I, O> BTreeCache<'f, I, O>where
I: Ord,
impl<'f, I, O> BTreeCache<'f, I, O>where I: Ord,
sourcepub fn new<F>(f: F) -> Selfwhere
F: Fn(&I) -> O + 'f + Send + Sync,
pub fn new<F>(f: F) -> Selfwhere F: Fn(&I) -> O + 'f + Send + Sync,
Create a cache for the provided function. If the function stores references, the cache can only live as long as those references.
sourcepub fn recursive<F>(f: F) -> Selfwhere
F: Fn(&mut Self, &I) -> O + 'f + Send + Sync,
pub fn recursive<F>(f: F) -> Selfwhere F: Fn(&mut Self, &I) -> O + 'f + Send + Sync,
Create a cache for the provided recursive function. If the function stores references, the cache can only live as long as those references.
Trait Implementations§
source§impl<'f, I, O> FnCache<I, O> for BTreeCache<'f, I, O>where
I: Ord,
impl<'f, I, O> FnCache<I, O> for BTreeCache<'f, I, O>where I: Ord,
source§impl<'f, I, O> FnCacheMany<I, O> for BTreeCache<'f, I, O>where
I: Ord + Clone,
impl<'f, I, O> FnCacheMany<I, O> for BTreeCache<'f, I, O>where I: Ord + Clone,
Auto Trait Implementations§
impl<'f, I, O> !RefUnwindSafe for BTreeCache<'f, I, O>
impl<'f, I, O> Send for BTreeCache<'f, I, O>where I: Send, O: Send,
impl<'f, I, O> Sync for BTreeCache<'f, I, O>where I: Sync, O: Sync,
impl<'f, I, O> Unpin for BTreeCache<'f, I, O>
impl<'f, I, O> !UnwindSafe for BTreeCache<'f, I, O>
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