Struct tari_mmr::MemBackendVec [−][src]
pub struct MemBackendVec<T> { /* fields omitted */ }
Expand description
MemBackendVec is a shareable, memory only, vector that can be be used with MmrCache to store checkpoints.
Implementations
Trait Implementations
type Error = MerkleMountainRangeError
type Value = T
Store a new item and return the index of the stored item
Return the item at the given index
type Value = T
Shortens the array, keeping the first len elements and dropping the rest.
Shift the array, by discarding the first n elements from the front.
Store a new item first in the array, previous items will be shifted up to make room.
fn for_each<F>(&self, f: F) -> Result<(), MerkleMountainRangeError> where
F: FnMut(Result<Self::Value, MerkleMountainRangeError>),
fn for_each<F>(&self, f: F) -> Result<(), MerkleMountainRangeError> where
F: FnMut(Result<Self::Value, MerkleMountainRangeError>),
Execute the given closure for each value in the array
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for MemBackendVec<T>
impl<T> Send for MemBackendVec<T> where
T: Send + Sync,
impl<T> Sync for MemBackendVec<T> where
T: Send + Sync,
impl<T> Unpin for MemBackendVec<T>
impl<T> UnwindSafe for MemBackendVec<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
pub fn clear(&mut self)
pub fn clear(&mut self)
Completely overwrites this value.
impl<T> InitializableFromZeroed for T where
T: Default,
impl<T> InitializableFromZeroed for T where
T: Default,
pub unsafe fn initialize(place: *mut T)
pub unsafe fn initialize(place: *mut T)
Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more
type Output = T
type Output = T
Should always be Self