Trait splinter::sets::DurableSet
source · [−]pub trait DurableSet: Send + Sync {
type Item: Send;
fn add(&mut self, item: Self::Item) -> Result<(), DurableSetError>;
fn remove(
&mut self,
item: &Self::Item
) -> Result<Option<Self::Item>, DurableSetError>;
fn contains(&self, item: &Self::Item) -> Result<bool, DurableSetError>;
fn iter<'a>(
&'a self
) -> Result<Box<dyn Iterator<Item = Self::Item> + 'a>, DurableSetError>;
fn len(&self) -> Result<u64, DurableSetError>;
fn is_empty(&self) -> Result<bool, DurableSetError> { ... }
}
Expand description
A Durable Set.
This trait provides an API for interacting with Durable sets that may be backed by a wide variety of persistent storage.
Required Associated Types
Required Methods
Remove an item to the set.
Get a value based on the query item.
Returns an iterator over the contents of the set.
fn len(&self) -> Result<u64, DurableSetError>
fn len(&self) -> Result<u64, DurableSetError>
Returns the count of the values in the set.