Skip to main content

CascadeResolver2

Struct CascadeResolver2 

Source
pub struct CascadeResolver2<T: Copy + Default + 'static> {
    pub outer: SharedRegion<KTowerCascade<T, 1>>,
    pub inner: SharedRegion<T>,
    /* private fields */
}
Expand description

Two-level cascade resolver: one inner SharedRegion holding T, one outer SharedRegion of KTowerCascade<T, 1> slots that ref the inner. Lookup walks: cascade.indices[0] -> outer_region slot -> KTowerCascade<T, 1> -> cascade.indices[1] -> inner_region slot.

For larger DEPTHs, compose CascadeResolver2 and CascadeResolver3 / CascadeResolver4 below or use SharedRegion directly with custom traversal.

Fields§

§outer: SharedRegion<KTowerCascade<T, 1>>§inner: SharedRegion<T>

Implementations§

Source§

impl<T: Copy + Default + 'static> CascadeResolver2<T>

Source

pub fn create( outer_path: impl AsRef<Path>, outer_capacity: usize, inner_path: impl AsRef<Path>, inner_capacity: usize, ) -> Result<Self, CascadeError>

Source

pub fn open( outer_path: impl AsRef<Path>, outer_capacity: usize, inner_path: impl AsRef<Path>, inner_capacity: usize, ) -> Result<Self, CascadeError>

Source

pub fn insert( &self, outer_idx: u32, value: T, ) -> Result<KTowerCascade<T, 2>, CascadeError>

Insert a T at a chosen cascade path. Allocates the inner slot

  • any missing outer slot; returns the resolved cascade.
Source

pub fn get(&self, c: KTowerCascade<T, 2>) -> Result<T, CascadeError>

Resolve a 2-level cascade to its T value.

Source

pub fn flush(&self) -> Result<(), CascadeError>

Trait Implementations§

Source§

impl<T: Copy + Default + Send + Sync + 'static> AdaptiveInstance for CascadeResolver2<T>

Source§

fn header(&self) -> &HandshakeHeader

Source§

fn ring(&self) -> &ObservationRing

Source§

fn make_policy(&self) -> Box<dyn Policy>

Source§

fn apply_migration(&self, new_tag: u32)

Called by the sidecar when the policy returns a new strategy tag. Default implementation: just set the tag on the header. Primitives that need heavier migration (data-layout swap) override this to perform the swap before (or after) updating the tag.

Auto Trait Implementations§

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.