Trait tari_mmr::ArrayLikeExt [−][src]
pub trait ArrayLikeExt {
type Value;
fn truncate(&mut self, _len: usize) -> Result<(), MerkleMountainRangeError>;
fn shift(&mut self, n: usize) -> Result<(), MerkleMountainRangeError>;
fn push_front(
&mut self,
item: Self::Value
) -> Result<(), MerkleMountainRangeError>;
fn for_each<F>(&self, f: F) -> Result<(), MerkleMountainRangeError>
where
F: FnMut(Result<Self::Value, MerkleMountainRangeError>);
}
Associated Types
Required methods
Shortens the array, keeping the first len elements and dropping the rest.
Shift the array, by discarding the first n elements from the front.
fn push_front(
&mut self,
item: Self::Value
) -> Result<(), MerkleMountainRangeError>
fn push_front(
&mut self,
item: Self::Value
) -> Result<(), MerkleMountainRangeError>
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