Skip to main content

Caching

Trait Caching 

Source
pub trait Caching {
    // Required methods
    fn init(&mut self) -> Index;
    fn root_index(&mut self) -> Index;
    fn root(&self) -> Option<&CacheEntry>;
    fn insert(&mut self, key: &[usize]) -> Index;
    fn node(&self, key: &CacheKey) -> Option<&CacheEntry>;
    fn contains(&self, key: &CacheKey) -> bool;
    fn update_root(&mut self) -> Option<CacheEntryUpdater<'_>>;
    fn update_node(&mut self, key: &CacheKey) -> Option<CacheEntryUpdater<'_>>;
    fn size(&self) -> usize;
    fn is_empty(&self) -> bool;
}
Expand description

A cache of subproblems keyed by sorted itemsets.

Required Methods§

Source

fn init(&mut self) -> Index

Clears the cache and creates the root entry.

Source

fn root_index(&mut self) -> Index

Index of the root entry.

Source

fn root(&self) -> Option<&CacheEntry>

The root entry.

Source

fn insert(&mut self, key: &[usize]) -> Index

Finds the entry of the sorted itemset key, creating it if needed. The index is New for an entry that has not been evaluated yet.

Source

fn node(&self, key: &CacheKey) -> Option<&CacheEntry>

The entry for key.

Source

fn contains(&self, key: &CacheKey) -> bool

Whether the cache has an entry for key.

Source

fn update_root(&mut self) -> Option<CacheEntryUpdater<'_>>

An updater for the root entry.

Source

fn update_node(&mut self, key: &CacheKey) -> Option<CacheEntryUpdater<'_>>

An updater for the entry of key.

Source

fn size(&self) -> usize

Number of entries.

Source

fn is_empty(&self) -> bool

Whether the cache has no entry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§