Trait tari_mmr::ArrayLike [−][src]
pub trait ArrayLike {
type Value;
type Error: Error;
fn len(&self) -> Result<usize, Self::Error>;
fn is_empty(&self) -> Result<bool, Self::Error>;
fn push(&mut self, item: Self::Value) -> Result<usize, Self::Error>;
fn get(&self, index: usize) -> Result<Option<Self::Value>, Self::Error>;
fn clear(&mut self) -> Result<(), Self::Error>;
fn position(&self, item: &Self::Value) -> Result<Option<usize>, Self::Error>;
}
Expand description
A trait describing generic array-like behaviour, without imposing any specific details on how this is actually done.
Associated Types
Required methods
Store a new item and return the index of the stored item
Return the item at the given index