Skip to main content

DMApplyCache

Struct DMApplyCache 

Source
pub struct DMApplyCache<M: Manager, O, H, const ENTRY_CAP: usize = 3>(/* private fields */);
Expand description

Fixed-size direct mapped apply cache

Implementations§

Source§

impl<M, O, H, const ENTRY_CAP: usize> DMApplyCache<M, O, H, ENTRY_CAP>
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 ENTRY_CAP: usize> ApplyCache<M, O> for DMApplyCache<M, O, H, ENTRY_CAP>
where M: Manager, O: Copy + Hash + Ord, H: Hasher + Default,

Source§

fn get_extended<const E: usize, const N: usize>( &self, manager: &M, operator: O, operands: (&[Borrowed<'_, M::Edge>], &[u32]), ) -> Option<([M::Edge; E], [u32; N])>

Get the result for the key consisting of operand and operator, if cached Read more
Source§

fn add_extended( &self, _manager: &M, operator: O, operands: (&[Borrowed<'_, M::Edge>], &[u32]), values: (&[Borrowed<'_, M::Edge>], &[u32]), )

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_extended() without numeric operands and just a single edge value
Source§

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

Shorthand for Self::add_extended() without numeric operands and just a single edge value
Source§

impl<M, O, H, const ENTRY_CAP: usize> Debug for DMApplyCache<M, O, H, ENTRY_CAP>
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 ENTRY_CAP: usize> DropWith<<M as Manager>::Edge> for DMApplyCache<M, O, H, ENTRY_CAP>
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 ENTRY_CAP: usize> ManagerEventSubscriber<M> for DMApplyCache<M, O, H, ENTRY_CAP>
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 ENTRY_CAP: usize> StatisticsGenerator for DMApplyCache<M, O, H, ENTRY_CAP>
where M: Manager, O: Copy + Eq,

Source§

fn print_stats(&self)

Print statistics to stdout

Auto Trait Implementations§

§

impl<M, O, H, const ENTRY_CAP: usize = 3> !RefUnwindSafe for DMApplyCache<M, O, H, ENTRY_CAP>

§

impl<M, O, H, const ENTRY_CAP: usize> Freeze for DMApplyCache<M, O, H, ENTRY_CAP>
where Box<[Entry<M, O, ENTRY_CAP>]>: Freeze, PhantomData<H>: Freeze,

§

impl<M, O, H, const ENTRY_CAP: usize> Send for DMApplyCache<M, O, H, ENTRY_CAP>
where Box<[Entry<M, O, ENTRY_CAP>]>: Send, PhantomData<H>: Send,

§

impl<M, O, H, const ENTRY_CAP: usize> Sync for DMApplyCache<M, O, H, ENTRY_CAP>
where Box<[Entry<M, O, ENTRY_CAP>]>: Sync, PhantomData<H>: Sync,

§

impl<M, O, H, const ENTRY_CAP: usize> Unpin for DMApplyCache<M, O, H, ENTRY_CAP>
where Box<[Entry<M, O, ENTRY_CAP>]>: Unpin, PhantomData<H>: Unpin,

§

impl<M, O, H, const ENTRY_CAP: usize> UnsafeUnpin for DMApplyCache<M, O, H, ENTRY_CAP>
where Box<[Entry<M, O, ENTRY_CAP>]>: UnsafeUnpin, PhantomData<H>: UnsafeUnpin,

§

impl<M, O, H, const ENTRY_CAP: usize> UnwindSafe for DMApplyCache<M, O, H, ENTRY_CAP>
where Box<[Entry<M, O, ENTRY_CAP>]>: UnwindSafe, PhantomData<H>: 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.