[−][src]Trait splinter::storage::sets::DurableOrderedSet
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>
&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>
&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>
&'a self,
range: DurableRange<&Index>
) -> Result<Box<dyn Iterator<Item = Self::Item> + 'a>, DurableSetError>
Returns an iterator over a range of index keys.
fn first(&self) -> Result<Option<Self::Item>, DurableSetError>
Returns the first item in the set, based on the natural Item order.
fn last(&self) -> Result<Option<Self::Item>, DurableSetError>
Returns the last item in the set, based on the natural Item order.
fn clone_boxed_ordered_set(&self) -> Box<dyn DurableOrderedSet<V, Index>>
Clones this instance into a boxed durable ordered set.
Implementors
impl<V, Index> DurableOrderedSet<V, Index> for DurableBTreeSet<V> where
Index: Ord + Send,
V: Send + Ord + Borrow<Index> + Clone + 'static,
[src]
Index: Ord + Send,
V: Send + Ord + Borrow<Index> + Clone + 'static,
fn get_by_index(
&self,
index_value: &Index
) -> Result<Option<Self::Item>, DurableSetError>
[src]
&self,
index_value: &Index
) -> Result<Option<Self::Item>, DurableSetError>
fn contains_by_index(
&self,
index_value: &Index
) -> Result<bool, DurableSetError>
[src]
&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>
[src]
&'a self,
range: DurableRange<&Index>
) -> Result<Box<dyn Iterator<Item = Self::Item> + 'a>, DurableSetError>
Returns an iterator over a range