Skip to main content

LitCache

Struct LitCache 

Source
pub struct LitCache<G: DenseId, O: DenseId, V: DenseId, L: DenseId, const TRACK: bool = true> { /* private fields */ }

Implementations§

Source§

impl<G: DenseId + Hash, O: DenseId + Hash, V: DenseId + Hash, L: DenseId, const TRACK: bool> LitCache<G, O, V, L, TRACK>

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) -> LitNode<G, O, V>

Source

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

Source

pub fn probe(&self, op: O, lit: V) -> Option<G>

Source

pub fn insert(&mut self, global_id: G, op: O, lit: V) -> L

Source

pub fn probe_or_insert( &mut self, global_id: G, op: O, lit: V, ) -> InsertResult<G, L>

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, V: DenseId + Hash, L: DenseId, const TRACK: bool> Default for LitCache<G, O, V, L, TRACK>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<G, O, V, L, const TRACK: bool> Freeze for LitCache<G, O, V, L, TRACK>
where Vec<LitNode<G, O, V>, L, InlineStore<LitNode<G, O, V>, L>, TRACK>: Freeze, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Freeze,

§

impl<G, O, V, L, const TRACK: bool> RefUnwindSafe for LitCache<G, O, V, L, TRACK>
where Vec<LitNode<G, O, V>, L, InlineStore<LitNode<G, O, V>, L>, TRACK>: RefUnwindSafe, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: RefUnwindSafe,

§

impl<G, O, V, L, const TRACK: bool> Send for LitCache<G, O, V, L, TRACK>
where Vec<LitNode<G, O, V>, L, InlineStore<LitNode<G, O, V>, L>, TRACK>: Send, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Send,

§

impl<G, O, V, L, const TRACK: bool> Sync for LitCache<G, O, V, L, TRACK>
where Vec<LitNode<G, O, V>, L, InlineStore<LitNode<G, O, V>, L>, TRACK>: Sync, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Sync,

§

impl<G, O, V, L, const TRACK: bool> Unpin for LitCache<G, O, V, L, TRACK>
where Vec<LitNode<G, O, V>, L, InlineStore<LitNode<G, O, V>, L>, TRACK>: Unpin, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Unpin,

§

impl<G, O, V, L, const TRACK: bool> UnsafeUnpin for LitCache<G, O, V, L, TRACK>
where Vec<LitNode<G, O, V>, L, InlineStore<LitNode<G, O, V>, L>, TRACK>: UnsafeUnpin, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: UnsafeUnpin,

§

impl<G, O, V, L, const TRACK: bool> UnwindSafe for LitCache<G, O, V, L, TRACK>
where Vec<LitNode<G, O, V>, L, InlineStore<LitNode<G, O, V>, L>, TRACK>: UnwindSafe, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: 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.