[−][src]Trait tari_mmr::ArrayLike
A trait describing generic array-like behaviour, without imposing any specific details on how this is actually done.
Associated Types
Loading content...Required methods
fn len(&self) -> Result<usize, Self::Error>
Returns the number of hashes stored in the backend
fn is_empty(&self) -> Result<bool, Self::Error>
Returns if empty
fn push(&mut self, item: Self::Value) -> Result<usize, Self::Error>
Store a new item and return the index of the stored item
fn get(&self, index: usize) -> Result<Option<Self::Value>, Self::Error>
Return the item at the given index
fn get_or_panic(&self, index: usize) -> Self::Value
Return the item at the given index. Use this if you know that the index is valid. Requesting a hash for an invalid index may cause the a panic
fn clear(&mut self) -> Result<(), Self::Error>
Remove all stored items from the the backend.