Trait StorageInterfaceStore
pub trait StorageInterfaceStore<Id, Element> {
// Required methods
fn store_single_element(
&mut self,
iteration: u64,
identifier: &Id,
element: &Element,
) -> Result<(), StorageError>
where Id: Serialize,
Element: Serialize;
fn store_batch_elements<'a, I>(
&'a mut self,
iteration: u64,
identifiers_elements: I,
) -> Result<(), StorageError>
where Id: 'a + Serialize,
Element: 'a + Serialize,
I: Clone + IntoIterator<Item = (&'a Id, &'a Element)>;
}
Expand description
Handles storing of elements
Required Methods§
fn store_single_element(
&mut self,
iteration: u64,
identifier: &Id,
element: &Element,
) -> Result<(), StorageError>
fn store_single_element( &mut self, iteration: u64, identifier: &Id, element: &Element, ) -> Result<(), StorageError>
Saves a single element at given iteration.
fn store_batch_elements<'a, I>(
&'a mut self,
iteration: u64,
identifiers_elements: I,
) -> Result<(), StorageError>where
Id: 'a + Serialize,
Element: 'a + Serialize,
I: Clone + IntoIterator<Item = (&'a Id, &'a Element)>,
fn store_batch_elements<'a, I>(
&'a mut self,
iteration: u64,
identifiers_elements: I,
) -> Result<(), StorageError>where
Id: 'a + Serialize,
Element: 'a + Serialize,
I: Clone + IntoIterator<Item = (&'a Id, &'a Element)>,
Stores a batch of multiple elements with identifiers all at the same iteration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.