Skip to main content

PersistentDecisionLog

Struct PersistentDecisionLog 

Source
pub struct PersistentDecisionLog<T>
where T: Clone,
{ /* private fields */ }
Expand description

Structurally shared append-only decision log.

Cloning this value shares its immutable tree root and its entry payloads. Appending copies only the affected tree path, so boundary rollback and simulation forks do not clone all retained decision attempts or traces.

Implementations§

Source§

impl<T> PersistentDecisionLog<T>
where T: Clone,

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn get(&self, index: usize) -> Option<&T>

Source

pub fn last(&self) -> Option<&T>

Source

pub fn iter(&self) -> impl DoubleEndedIterator + ExactSizeIterator

Source

pub fn push(&mut self, value: T) -> u64

Appends one value and returns its stable ordinal.

§Panics

Panics only after the persistent u64 ordinal space is exhausted.

Source

pub fn get_ordinal(&self, ordinal: u64) -> Option<&T>

Source

pub fn remove_ordinal(&mut self, ordinal: u64) -> Option<T>

Source

pub fn ordinals(&self) -> impl DoubleEndedIterator + ExactSizeIterator

Source

pub const fn next_ordinal(&self) -> u64

Trait Implementations§

Source§

impl<T> Clone for PersistentDecisionLog<T>
where T: Clone,

Source§

fn clone(&self) -> PersistentDecisionLog<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for PersistentDecisionLog<T>
where T: Debug + Clone,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for PersistentDecisionLog<T>
where T: Clone,

Source§

fn default() -> PersistentDecisionLog<T>

Returns the “default value” for a type. Read more
Source§

impl<'de, T> Deserialize<'de> for PersistentDecisionLog<T>
where T: Clone + Deserialize<'de>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<PersistentDecisionLog<T>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> Eq for PersistentDecisionLog<T>
where T: Eq + Clone,

Source§

impl<T> Index<usize> for PersistentDecisionLog<T>
where T: Clone,

Source§

type Output = T

The returned type after indexing.
Source§

fn index( &self, index: usize, ) -> &<PersistentDecisionLog<T> as Index<usize>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, T> IntoIterator for &'a PersistentDecisionLog<T>
where T: Clone,

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = PersistentDecisionLogIter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a PersistentDecisionLog<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> PartialEq for PersistentDecisionLog<T>
where T: PartialEq + Clone,

Source§

fn eq(&self, other: &PersistentDecisionLog<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T> Serialize for PersistentDecisionLog<T>
where T: Clone + Serialize,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> StructuralPartialEq for PersistentDecisionLog<T>
where T: PartialEq + Clone,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.