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,
impl<T> PersistentDecisionLog<T>where
T: Clone,
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn get(&self, index: usize) -> Option<&T>
pub fn last(&self) -> Option<&T>
pub fn iter(&self) -> impl DoubleEndedIterator + ExactSizeIterator
Sourcepub fn push(&mut self, value: T) -> u64
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.
pub fn get_ordinal(&self, ordinal: u64) -> Option<&T>
pub fn remove_ordinal(&mut self, ordinal: u64) -> Option<T>
pub fn ordinals(&self) -> impl DoubleEndedIterator + ExactSizeIterator
pub const fn next_ordinal(&self) -> u64
Trait Implementations§
Source§impl<T> Clone for PersistentDecisionLog<T>where
T: Clone,
impl<T> Clone for PersistentDecisionLog<T>where
T: Clone,
Source§fn clone(&self) -> PersistentDecisionLog<T>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for PersistentDecisionLog<T>
impl<T> Debug for PersistentDecisionLog<T>
Source§impl<T> Default for PersistentDecisionLog<T>where
T: Clone,
impl<T> Default for PersistentDecisionLog<T>where
T: Clone,
Source§fn default() -> PersistentDecisionLog<T>
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>,
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>,
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
impl<T> Eq for PersistentDecisionLog<T>
Source§impl<'a, T> IntoIterator for &'a PersistentDecisionLog<T>where
T: Clone,
impl<'a, T> IntoIterator for &'a PersistentDecisionLog<T>where
T: Clone,
Source§type IntoIter = PersistentDecisionLogIter<'a, T>
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
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>
impl<T> PartialEq for PersistentDecisionLog<T>
Source§impl<T> Serialize for PersistentDecisionLog<T>
impl<T> Serialize for PersistentDecisionLog<T>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl<T> StructuralPartialEq for PersistentDecisionLog<T>
Auto Trait Implementations§
impl<T> Freeze for PersistentDecisionLog<T>
impl<T> RefUnwindSafe for PersistentDecisionLog<T>
impl<T> Send for PersistentDecisionLog<T>
impl<T> Sync for PersistentDecisionLog<T>
impl<T> Unpin for PersistentDecisionLog<T>
impl<T> UnsafeUnpin for PersistentDecisionLog<T>
impl<T> UnwindSafe for PersistentDecisionLog<T>
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