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>
where Id: Serialize, Element: Serialize,

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)>,

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.

Implementors§

§

impl<Id, Element> StorageInterfaceStore<Id, Element> for MemoryStorageInterface<Id, Element>
where Id: Clone + Hash + Eq, Element: Clone,

§

impl<Id, Element> StorageInterfaceStore<Id, Element> for StorageManager<Id, Element>
where Id: Hash + Eq + Clone, Element: Clone,

§

impl<Id, Element, const TEMP: bool> StorageInterfaceStore<Id, Element> for SledStorageInterface<Id, Element, TEMP>