DMApplyCache

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 ManagerEventSubscriber::pre_gc() / ManagerEventSubscriber::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> ManagerEventSubscriber<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 a garbage collection Read more
Source§

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

Post-process a garbage collection Read more
Source§

fn init(&self, manager: &M)

Initialization Read more
Source§

fn init_mut(manager: &mut M)

Initialization Read more
Source§

fn pre_reorder(&self, manager: &M)

Prepare a reordering operation (including any addition of levels) Read more
Source§

fn pre_reorder_mut(manager: &mut M)

Prepare a reordering operation (including any addition of levels) Read more
Source§

fn post_reorder(&self, manager: &M)

Post-process a reordering operation Read more
Source§

fn post_reorder_mut(manager: &mut M)

Post-process a reordering operation 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.