Skip to main content

Smr

Trait Smr 

Source
pub trait Smr<K: Key, V: Value> {
    type Guard<'g>: Guard<V>
       where V: 'g,
             Self: 'g;

    // Required method
    fn guard<'g>(&'g self, prefix: K::Read<'_>) -> Self::Guard<'g>
       where V: 'g;

    // Provided method
    fn garbage(&self) -> u32 { ... }
}
Expand description

Provides safe memory reclamation for the given key and value type.

Required Associated Types§

Source

type Guard<'g>: Guard<V> where V: 'g, Self: 'g

Guard type that protects nodes and values during its lifetime, can be used to retire allocations, and unprotects when it is dropped.

Required Methods§

Source

fn guard<'g>(&'g self, prefix: K::Read<'_>) -> Self::Guard<'g>
where V: 'g,

Construct a Guard that protects nodes and values associated with prefix.

Provided Methods§

Source

fn garbage(&self) -> u32

Estimate the peak number of unreclaimed allocations.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K: Key, V: Value> Smr<K, V> for NoOp

Source§

type Guard<'g> = Guard<(), V> where V: 'g, Self: 'g

Source§

impl<K: Key, V: Value> Smr<K, V> for Seize

Source§

type Guard<'g> = LocalGuard<'g> where V: 'g, Self: 'g