pub struct FunctionCache { /* private fields */ }Expand description
Cache for compiled functions.
Implementations§
Source§impl FunctionCache
impl FunctionCache
Sourcepub fn default_size() -> Self
pub fn default_size() -> Self
Creates a cache with default size (1000).
Sourcepub fn hash_graph(graph: &Graph) -> u64
pub fn hash_graph(graph: &Graph) -> u64
Computes a hash key for a graph.
Sourcepub fn get(&self, key: u64) -> Option<CompiledFunction>
pub fn get(&self, key: u64) -> Option<CompiledFunction>
Gets a cached function or returns None.
Sourcepub fn get_by_graph(&self, graph: &Graph) -> Option<CompiledFunction>
pub fn get_by_graph(&self, graph: &Graph) -> Option<CompiledFunction>
Gets a cached function by graph.
Sourcepub fn insert(&self, key: u64, func: CompiledFunction)
pub fn insert(&self, key: u64, func: CompiledFunction)
Inserts a compiled function.
Sourcepub fn insert_for_graph(&self, graph: &Graph, func: CompiledFunction)
pub fn insert_for_graph(&self, graph: &Graph, func: CompiledFunction)
Inserts a compiled function for a graph.
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Returns cache statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FunctionCache
impl !RefUnwindSafe for FunctionCache
impl Send for FunctionCache
impl Sync for FunctionCache
impl Unpin for FunctionCache
impl UnwindSafe for FunctionCache
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