Trait splinter::sets::DurableOrderedSet
source · [−]pub trait DurableOrderedSet<V, Index>: DurableSet<Item = V> where
Index: Ord + Send,
V: Send + Ord + Borrow<Index>, {
fn get_by_index(
&self,
index_value: &Index
) -> Result<Option<Self::Item>, DurableSetError>;
fn contains_by_index(
&self,
index_value: &Index
) -> Result<bool, DurableSetError>;
fn range_iter<'a>(
&'a self,
range: DurableRange<&Index>
) -> Result<Box<dyn Iterator<Item = Self::Item> + 'a>, DurableSetError>;
fn first(&self) -> Result<Option<Self::Item>, DurableSetError>;
fn last(&self) -> Result<Option<Self::Item>, DurableSetError>;
fn clone_boxed_ordered_set(&self) -> Box<dyn DurableOrderedSet<V, Index>>;
}Expand description
A Durable, Ordered Set.
This trait extends the API DurableSet to include requirements around ordering of value, as
well as Indexing on a sub-value.
This set contains values of type V, which may be indexed by Index type. Items in the set
can be selected based on their Index value.
Required Methods
fn get_by_index(
&self,
index_value: &Index
) -> Result<Option<Self::Item>, DurableSetError>
fn get_by_index(
&self,
index_value: &Index
) -> Result<Option<Self::Item>, DurableSetError>
Get a value based on the index.
fn contains_by_index(&self, index_value: &Index) -> Result<bool, DurableSetError>
fn contains_by_index(&self, index_value: &Index) -> Result<bool, DurableSetError>
Check for the existence of a value based on the index.
fn range_iter<'a>(
&'a self,
range: DurableRange<&Index>
) -> Result<Box<dyn Iterator<Item = Self::Item> + 'a>, DurableSetError>
fn range_iter<'a>(
&'a self,
range: DurableRange<&Index>
) -> Result<Box<dyn Iterator<Item = Self::Item> + 'a>, DurableSetError>
Returns an iterator over a range of index keys.
Returns the first item in the set, based on the natural Item order.
Returns the last item in the set, based on the natural Item order.
fn clone_boxed_ordered_set(&self) -> Box<dyn DurableOrderedSet<V, Index>>
fn clone_boxed_ordered_set(&self) -> Box<dyn DurableOrderedSet<V, Index>>
Clones this instance into a boxed durable ordered set.