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, path: &[usize], cover: &Cover) -> Index;
fn find(&self, path: &[usize], cover: &Cover) -> Option<&CacheEntry>;
fn keyed_by_cover(&self) -> bool;
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. Lookups take the sorted itemset of the path and
cover, positioned on the instances of that path.
Required Methods§
Sourcefn root_index(&mut self) -> Index
fn root_index(&mut self) -> Index
Index of the root entry.
Sourcefn root(&self) -> Option<&CacheEntry>
fn root(&self) -> Option<&CacheEntry>
The root entry.
Sourcefn insert(&mut self, path: &[usize], cover: &Cover) -> Index
fn insert(&mut self, path: &[usize], cover: &Cover) -> Index
Finds the entry of the subproblem, creating it if needed. The index is
New for an entry that has not been evaluated yet.
Sourcefn find(&self, path: &[usize], cover: &Cover) -> Option<&CacheEntry>
fn find(&self, path: &[usize], cover: &Cover) -> Option<&CacheEntry>
The entry of the subproblem, if cached.
Sourcefn keyed_by_cover(&self) -> bool
fn keyed_by_cover(&self) -> bool
Whether lookups use cover.
Sourcefn node(&self, key: &CacheKey) -> Option<&CacheEntry>
fn node(&self, key: &CacheKey) -> Option<&CacheEntry>
The entry for key.
Sourcefn update_root(&mut self) -> Option<CacheEntryUpdater<'_>>
fn update_root(&mut self) -> Option<CacheEntryUpdater<'_>>
An updater for the root entry.
Sourcefn update_node(&mut self, key: &CacheKey) -> Option<CacheEntryUpdater<'_>>
fn update_node(&mut self, key: &CacheKey) -> Option<CacheEntryUpdater<'_>>
An updater for the entry of key.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".