pub struct StrataArena { /* private fields */ }Expand description
Arena for storing historical engrams
Uses a flat buffer with per-lineage ring buffer semantics. Each lineage has a fixed-size window of history.
Implementations§
Source§impl StrataArena
impl StrataArena
Sourcepub fn with_capacity(max_lineages: usize, depth: usize) -> Self
pub fn with_capacity(max_lineages: usize, depth: usize) -> Self
Create a new strata arena
§Arguments
max_lineages- Maximum number of lineagesdepth- History depth per lineage
Sourcepub fn record(
&mut self,
lineage: LineageId,
current_head: u32,
engram: Engram,
) -> u32
pub fn record( &mut self, lineage: LineageId, current_head: u32, engram: Engram, ) -> u32
Record a new engram for a lineage
Returns the global index of the new engram, and updates the head_index that should be stored in the Lineage.
Auto Trait Implementations§
impl Freeze for StrataArena
impl RefUnwindSafe for StrataArena
impl Send for StrataArena
impl Sync for StrataArena
impl Unpin for StrataArena
impl UnwindSafe for StrataArena
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more