Skip to main content

FixedArityCache

Struct FixedArityCache 

Source
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>

Source

pub fn new() -> Self

Source

pub fn len(&self) -> L

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, id: L) -> FixedArityNode<G, O, K>

Source

pub fn set(&mut self, id: L, node: FixedArityNode<G, O, K>)

Source

pub fn probe(&self, op: &O, children: &[G; K]) -> Option<G>

Source

pub fn insert(&mut self, global_id: G, op: O, children: [G; K]) -> L

Source

pub fn probe_or_insert( &mut self, global_id: G, op: O, children: [G; K], ) -> InsertResult<G, L>

Source

pub fn node_get(&self, id: L) -> FixedArityNode<G, O, K>

Source

pub fn node_set(&mut self, id: L, node: FixedArityNode<G, O, K>)

Source

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.

Source

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.

Source

pub fn mark(&mut self, shrink: ShrinkPolicy) -> CacheToken

Source

pub fn restore(&mut self, token: CacheToken)

Trait Implementations§

Source§

impl<G: DenseId + Hash, O: DenseId + Hash, L: DenseId, const K: usize, const TRACK: bool, const PROOFS: bool> Default for FixedArityCache<G, O, L, K, TRACK, PROOFS>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.