pub struct FixedArityCache<G: DenseId, O: DenseId, L: DenseId, const K: usize, const TRACK: bool = true, const PROOFS: bool = false> { /* private fields */ }Implementations§
Source§impl<G: DenseId + Hash, O: DenseId + Hash, L: DenseId, const K: usize, const TRACK: bool, const PROOFS: bool> FixedArityCache<G, O, L, K, TRACK, PROOFS>
impl<G: DenseId + Hash, O: DenseId + Hash, L: DenseId, const K: usize, const TRACK: bool, const PROOFS: bool> FixedArityCache<G, O, L, K, TRACK, PROOFS>
pub fn new() -> Self
pub fn len(&self) -> L
pub fn is_empty(&self) -> bool
pub fn get(&self, id: L) -> FixedArityNode<G, O, K>
pub fn set(&mut self, id: L, node: FixedArityNode<G, O, K>)
pub fn probe(&self, op: &O, children: &[G; K]) -> Option<G>
pub fn insert(&mut self, global_id: G, op: O, children: [G; K]) -> L
pub fn probe_or_insert( &mut self, global_id: G, op: O, children: [G; K], ) -> InsertResult<G, L>
pub fn node_get(&self, id: L) -> FixedArityNode<G, O, K>
pub fn node_set(&mut self, id: L, node: FixedArityNode<G, O, K>)
Sourcepub fn recanonize_node<F: FixedCanon<G, K>>(
&mut self,
local_id: L,
find: impl Fn(G) -> G,
collisions: &mut Vec<(G, G)>,
touched: &mut Vec<G>,
)
pub fn recanonize_node<F: FixedCanon<G, K>>( &mut self, local_id: L, find: impl Fn(G) -> G, collisions: &mut Vec<(G, G)>, touched: &mut Vec<G>, )
Recanonize a single node’s children. Pushes collision pair into
collisions if the new canonical form matches an existing node.
When PROOFS=true, saves the original node to history on first recanonize.
Sourcepub fn original_children(&self, global_id: G) -> Option<[G; K]>
pub fn original_children(&self, global_id: G) -> Option<[G; K]>
Retrieve the original (pre-recanonize) children for a node by global id.
Linear scan of the history store. Returns None if no history or not found.
pub fn mark(&mut self, shrink: ShrinkPolicy) -> CacheToken
pub fn restore(&mut self, token: CacheToken)
Trait Implementations§
Auto Trait Implementations§
impl<G, O, L, const K: usize, const TRACK: bool, const PROOFS: bool> Freeze for FixedArityCache<G, O, L, K, TRACK, PROOFS>where
Vec<FixedArityNode<G, O, K>, L, InlineStore<FixedArityNode<G, O, K>, L>, TRACK>: Freeze,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Freeze,
Option<Vec<FixedArityNode<G, O, K>, usize, InlineStore<FixedArityNode<G, O, K>, usize>, TRACK>>: Freeze,
Vec<L>: Freeze,
impl<G, O, L, const K: usize, const TRACK: bool, const PROOFS: bool> RefUnwindSafe for FixedArityCache<G, O, L, K, TRACK, PROOFS>where
Vec<FixedArityNode<G, O, K>, L, InlineStore<FixedArityNode<G, O, K>, L>, TRACK>: RefUnwindSafe,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: RefUnwindSafe,
Option<Vec<FixedArityNode<G, O, K>, usize, InlineStore<FixedArityNode<G, O, K>, usize>, TRACK>>: RefUnwindSafe,
Vec<L>: RefUnwindSafe,
impl<G, O, L, const K: usize, const TRACK: bool, const PROOFS: bool> Send for FixedArityCache<G, O, L, K, TRACK, PROOFS>where
Vec<FixedArityNode<G, O, K>, L, InlineStore<FixedArityNode<G, O, K>, L>, TRACK>: Send,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Send,
Option<Vec<FixedArityNode<G, O, K>, usize, InlineStore<FixedArityNode<G, O, K>, usize>, TRACK>>: Send,
Vec<L>: Send,
impl<G, O, L, const K: usize, const TRACK: bool, const PROOFS: bool> Sync for FixedArityCache<G, O, L, K, TRACK, PROOFS>where
Vec<FixedArityNode<G, O, K>, L, InlineStore<FixedArityNode<G, O, K>, L>, TRACK>: Sync,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Sync,
Option<Vec<FixedArityNode<G, O, K>, usize, InlineStore<FixedArityNode<G, O, K>, usize>, TRACK>>: Sync,
Vec<L>: Sync,
impl<G, O, L, const K: usize, const TRACK: bool, const PROOFS: bool> Unpin for FixedArityCache<G, O, L, K, TRACK, PROOFS>where
Vec<FixedArityNode<G, O, K>, L, InlineStore<FixedArityNode<G, O, K>, L>, TRACK>: Unpin,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Unpin,
Option<Vec<FixedArityNode<G, O, K>, usize, InlineStore<FixedArityNode<G, O, K>, usize>, TRACK>>: Unpin,
Vec<L>: Unpin,
impl<G, O, L, const K: usize, const TRACK: bool, const PROOFS: bool> UnsafeUnpin for FixedArityCache<G, O, L, K, TRACK, PROOFS>where
Vec<FixedArityNode<G, O, K>, L, InlineStore<FixedArityNode<G, O, K>, L>, TRACK>: UnsafeUnpin,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: UnsafeUnpin,
Option<Vec<FixedArityNode<G, O, K>, usize, InlineStore<FixedArityNode<G, O, K>, usize>, TRACK>>: UnsafeUnpin,
Vec<L>: UnsafeUnpin,
impl<G, O, L, const K: usize, const TRACK: bool, const PROOFS: bool> UnwindSafe for FixedArityCache<G, O, L, K, TRACK, PROOFS>where
Vec<FixedArityNode<G, O, K>, L, InlineStore<FixedArityNode<G, O, K>, L>, TRACK>: UnwindSafe,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: UnwindSafe,
Option<Vec<FixedArityNode<G, O, K>, usize, InlineStore<FixedArityNode<G, O, K>, usize>, TRACK>>: UnwindSafe,
Vec<L>: UnwindSafe,
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