pub struct ActionCache<O: DenseId, A: AuIds = AuIds31, M: MultiplicityLike = Multiplicity> { /* private fields */ }Expand description
The action cache: maps class pair (l, r) to a list of actions.
Semi-persistent: the index map (AppendOnlyVec + SpMap) is append-only and
provides branch genealogy for tokens. The values vec grows in lockstep
and is truncated on restore. Actions are deterministic from the immutable
snapshot, so re-derivation after restore is cheap (cache is a performance
optimization, not a correctness requirement).
Implementations§
Source§impl<O: DenseId, A: AuIds, M: MultiplicityLike> ActionCache<O, A, M>
impl<O: DenseId, A: AuIds, M: MultiplicityLike> ActionCache<O, A, M>
pub fn new(a_max: usize) -> Self
Sourcepub fn without_ac_actions(a_max: usize) -> Self
pub fn without_ac_actions(a_max: usize) -> Self
A cache whose generate_actions skips AC/ACI matrix materialization.
Used by the exact solver, which handles those operators by transport.
pub fn include_ac(&self) -> bool
pub fn get(&self, l: A::Class, r: A::Class) -> Option<&[Action<O, A, M>]>
pub fn insert( &mut self, l: A::Class, r: A::Class, actions: Vec<Action<O, A, M>>, )
pub fn a_max(&self) -> usize
pub fn mark(&mut self) -> ActionCacheToken
Sourcepub fn is_valid_token(&self, token: &ActionCacheToken) -> bool
pub fn is_valid_token(&self, token: &ActionCacheToken) -> bool
Is this token restorable right now (same instance, live branch)?
pub fn restore(&mut self, token: ActionCacheToken)
Trait Implementations§
Auto Trait Implementations§
impl<O, A, M> Freeze for ActionCache<O, A, M>
impl<O, A, M> RefUnwindSafe for ActionCache<O, A, M>
impl<O, A, M> Send for ActionCache<O, A, M>
impl<O, A, M> Sync for ActionCache<O, A, M>
impl<O, A, M> Unpin for ActionCache<O, A, M>
impl<O, A, M> UnsafeUnpin for ActionCache<O, A, M>
impl<O, A, M> UnwindSafe for ActionCache<O, A, M>
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