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.