pub struct VariableArityCache<G: DenseId, O: DenseId, C: Tagged + Clone + Copy + Hash + Eq, L: DenseId, const TRACK: bool = true, const PROOFS: bool = false> { /* private fields */ }Implementations§
Source§impl<G: DenseId + Hash, O: DenseId + Hash, C: Tagged + Clone + Copy + Hash + Eq + Debug, L: DenseId, const TRACK: bool, const PROOFS: bool> VariableArityCache<G, O, C, L, TRACK, PROOFS>
impl<G: DenseId + Hash, O: DenseId + Hash, C: Tagged + Clone + Copy + Hash + Eq + Debug, L: DenseId, const TRACK: bool, const PROOFS: bool> VariableArityCache<G, O, C, L, TRACK, PROOFS>
pub fn new() -> Self
pub fn len(&self) -> L
pub fn is_empty(&self) -> bool
pub fn get(&self, id: L) -> VariableArityNode<G, O>
pub fn set(&mut self, id: L, node: VariableArityNode<G, O>)
pub fn children_vec(&self, node: &VariableArityNode<G, O>) -> Vec<C>
pub fn pool_get(&self, i: usize) -> C
pub fn pool_set(&mut self, i: usize, value: C)
pub fn probe(&self, op: O, elems: &[C]) -> Option<G>
pub fn insert(&mut self, global_id: G, op: O, elems: &[C]) -> L
pub fn probe_or_insert( &mut self, global_id: G, op: O, elems: &[C], ) -> InsertResult<G, L>
pub fn node_get(&self, id: L) -> VariableArityNode<G, O>
pub fn node_set(&mut self, id: L, node: VariableArityNode<G, O>)
Sourcepub fn recanonize_node<V: VarCanon<G, C>>(
&mut self,
local_id: L,
find: impl Fn(G) -> G,
buf: &mut Vec<C>,
collisions: &mut Vec<(G, G)>,
touched: &mut Vec<G>,
mode: CanonMode<G>,
)
pub fn recanonize_node<V: VarCanon<G, C>>( &mut self, local_id: L, find: impl Fn(G) -> G, buf: &mut Vec<C>, collisions: &mut Vec<(G, G)>, touched: &mut Vec<G>, mode: CanonMode<G>, )
Recanonize a single node’s children. buf is a caller-owned scratch
buffer, cleared internally. Pushes collision pair into collisions
if the new canonical form matches an existing node.
When PROOFS=true, saves the original node+children to history on first recanonize.
Sourcepub fn original_children(&self, global_id: G, out: &mut Vec<C>) -> bool
pub fn original_children(&self, global_id: G, out: &mut Vec<C>) -> bool
Retrieve the original (pre-recanonize) children for a node by global id.
Linear scan of the history store. Appends children to out.
Returns true if found.
pub fn mark(&mut self, shrink: ShrinkPolicy) -> PoolCacheToken
pub fn restore(&mut self, token: PoolCacheToken)
Trait Implementations§
Auto Trait Implementations§
impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Freeze for VariableArityCache<G, O, C, L, TRACK, PROOFS>where
Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Freeze,
Vec<C, usize, InlineStore<C, usize>, TRACK>: Freeze,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Freeze,
Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Freeze,
Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Freeze,
Vec<L>: Freeze,
impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> RefUnwindSafe for VariableArityCache<G, O, C, L, TRACK, PROOFS>where
Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: RefUnwindSafe,
Vec<C, usize, InlineStore<C, usize>, TRACK>: RefUnwindSafe,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: RefUnwindSafe,
Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: RefUnwindSafe,
Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: RefUnwindSafe,
Vec<L>: RefUnwindSafe,
impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Send for VariableArityCache<G, O, C, L, TRACK, PROOFS>where
Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Send,
Vec<C, usize, InlineStore<C, usize>, TRACK>: Send,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Send,
Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Send,
Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Send,
Vec<L>: Send,
impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Sync for VariableArityCache<G, O, C, L, TRACK, PROOFS>where
Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Sync,
Vec<C, usize, InlineStore<C, usize>, TRACK>: Sync,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Sync,
Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Sync,
Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Sync,
Vec<L>: Sync,
impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Unpin for VariableArityCache<G, O, C, L, TRACK, PROOFS>where
Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Unpin,
Vec<C, usize, InlineStore<C, usize>, TRACK>: Unpin,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Unpin,
Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Unpin,
Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Unpin,
Vec<L>: Unpin,
impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> UnsafeUnpin for VariableArityCache<G, O, C, L, TRACK, PROOFS>where
Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: UnsafeUnpin,
Vec<C, usize, InlineStore<C, usize>, TRACK>: UnsafeUnpin,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: UnsafeUnpin,
Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: UnsafeUnpin,
Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: UnsafeUnpin,
Vec<L>: UnsafeUnpin,
impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> UnwindSafe for VariableArityCache<G, O, C, L, TRACK, PROOFS>where
Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: UnwindSafe,
Vec<C, usize, InlineStore<C, usize>, TRACK>: UnwindSafe,
HashMap<StoredKey<L>, (), PassthroughBuildHasher>: UnwindSafe,
Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: UnwindSafe,
Option<Vec<C, usize, InlineStore<C, 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