oxidd_cache::direct

Struct DMApplyCache

source
pub struct DMApplyCache<M: Manager, O, H, const ARITY: usize = 2>(/* private fields */);
Expand description

Fixed-size direct mapped apply cache

Implementations§

source§

impl<M, O, H, const ARITY: usize> DMApplyCache<M, O, H, ARITY>
where M: Manager, O: Copy + Eq + Hash, H: Hasher + Default,

source

pub unsafe fn with_capacity(capacity: usize) -> Self

Create a new ApplyCache with the given capacity (entries).

§Safety

The apply cache must only be used inside a manager that guarantees all node deletions to be wrapped inside an GCContainer::pre_gc() / GCContainer::post_gc() pair.

Trait Implementations§

source§

impl<M, O, H, const ARITY: usize> ApplyCache<M, O> for DMApplyCache<M, O, H, ARITY>
where M: Manager, O: Copy + Hash + Ord, H: Hasher + Default,

source§

fn get_with_numeric( &self, manager: &M, operator: O, operands: &[Borrowed<'_, M::Edge>], numeric_operands: &[u32], ) -> Option<M::Edge>

Get the result of operation, if cached
source§

fn add_with_numeric( &self, manager: &M, operator: O, operands: &[Borrowed<'_, M::Edge>], numeric_operands: &[u32], value: Borrowed<'_, M::Edge>, )

Add the result of operation to this cache Read more
source§

fn clear(&self, _manager: &M)

Remove all entries from the cache
source§

fn get( &self, manager: &M, operator: O, operands: &[Borrowed<'_, <M as Manager>::Edge>], ) -> Option<<M as Manager>::Edge>

Shorthand for Self::get_with_numeric() without numeric operands
source§

fn add( &self, manager: &M, operator: O, operands: &[Borrowed<'_, <M as Manager>::Edge>], value: Borrowed<'_, <M as Manager>::Edge>, )

Shorthand for Self::add_with_numeric() without numeric operands
source§

impl<M, O, H, const ARITY: usize> Debug for DMApplyCache<M, O, H, ARITY>
where M: Manager, M::Edge: Debug, O: Copy + Eq + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<M: Manager, O, H, const ARITY: usize> DropWith<<M as Manager>::Edge> for DMApplyCache<M, O, H, ARITY>
where O: Copy + Eq + Hash,

source§

fn drop_with(self, _drop_edge: impl Fn(M::Edge))

Drop self Read more
source§

fn drop_with_manager<M>(self, manager: &M)
where M: Manager<Edge = E>,

Drop self Read more
source§

impl<M, O, H, const ARITY: usize> GCContainer<M> for DMApplyCache<M, O, H, ARITY>
where M: Manager, O: Copy + Hash + Ord, H: Hasher + Default,

source§

fn pre_gc(&self, _manager: &M)

Prepare for garbage collection Read more
source§

unsafe fn post_gc(&self, _manager: &M)

Post-process a garbage collection Read more
source§

impl<M, O, H, const ARITY: usize> StatisticsGenerator for DMApplyCache<M, O, H, ARITY>
where M: Manager, O: Copy + Eq,

source§

fn print_stats(&self)

Print statistics to stdout

Auto Trait Implementations§

§

impl<M, O, H, const ARITY: usize> Freeze for DMApplyCache<M, O, H, ARITY>

§

impl<M, O, H, const ARITY: usize = 2> !RefUnwindSafe for DMApplyCache<M, O, H, ARITY>

§

impl<M, O, H, const ARITY: usize> Send for DMApplyCache<M, O, H, ARITY>
where H: Send, O: Send, <M as Manager>::Edge: Send,

§

impl<M, O, H, const ARITY: usize> Sync for DMApplyCache<M, O, H, ARITY>
where H: Sync, O: Send, <M as Manager>::Edge: Send,

§

impl<M, O, H, const ARITY: usize> Unpin for DMApplyCache<M, O, H, ARITY>
where H: Unpin,

§

impl<M, O, H, const ARITY: usize> UnwindSafe for DMApplyCache<M, O, H, ARITY>
where H: UnwindSafe, O: UnwindSafe, <M as Manager>::Edge: 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.