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

Returns the number of hashes stored in the backend

Returns if empty

Store a new item and return the index of the stored item

Return the item at the given index

Remove all stored items from the the backend.

Finds the index of the specified stored item, it will return None if the object could not be found.

Implementations on Foreign Types

Implementors