Struct SledStorageInterface
pub struct SledStorageInterface<Id, Element, const TEMP: bool = false> { /* private fields */ }
Expand description
Use the [sled] database to save results to an embedded database.
Trait Implementations§
§impl<Id, Element, const TEMP: bool> Clone for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> Clone for SledStorageInterface<Id, Element, TEMP>
§fn clone(&self) -> SledStorageInterface<Id, Element, TEMP>
fn clone(&self) -> SledStorageInterface<Id, Element, TEMP>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<Id, Element, const TEMP: bool> Debug for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> Debug for SledStorageInterface<Id, Element, TEMP>
§impl<Id, Element, const TEMP: bool> StorageInterfaceLoad<Id, Element> for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> StorageInterfaceLoad<Id, Element> for SledStorageInterface<Id, Element, TEMP>
§fn load_single_element(
&self,
iteration: u64,
identifier: &Id,
) -> Result<Option<Element>, StorageError>
fn load_single_element( &self, iteration: u64, identifier: &Id, ) -> Result<Option<Element>, StorageError>
Loads a single element from the storage solution if the element exists.
§fn load_element_history(
&self,
identifier: &Id,
) -> Result<HashMap<u64, Element>, StorageError>where
Id: Serialize,
Element: for<'a> Deserialize<'a>,
fn load_element_history(
&self,
identifier: &Id,
) -> Result<HashMap<u64, Element>, StorageError>where
Id: Serialize,
Element: for<'a> Deserialize<'a>,
Loads the elements history, meaning every occurrence of the element in the storage.
This function by default provides the results in ordered fashion such that the time
direction is retained.
Furthermore this function assumes that a given index occurs over the course of a complete
time segment with no interceptions. Read more
§fn load_all_elements_at_iteration(
&self,
iteration: u64,
) -> Result<HashMap<Id, Element>, StorageError>
fn load_all_elements_at_iteration( &self, iteration: u64, ) -> Result<HashMap<Id, Element>, StorageError>
Gets a snapshot of all elements at a given iteration. Read more
§fn load_all_elements(
&self,
) -> Result<BTreeMap<u64, HashMap<Id, Element>>, StorageError>
fn load_all_elements( &self, ) -> Result<BTreeMap<u64, HashMap<Id, Element>>, StorageError>
Loads all elements for every iteration.
This will yield the complete storage and may result in extremely large allocations of
memory.
§fn get_all_iterations(&self) -> Result<Vec<u64>, StorageError>
fn get_all_iterations(&self) -> Result<Vec<u64>, StorageError>
Get all iteration values which have been saved.
§fn load_all_element_histories(
&self,
) -> Result<HashMap<Id, BTreeMap<u64, Element>>, StorageError>
fn load_all_element_histories( &self, ) -> Result<HashMap<Id, BTreeMap<u64, Element>>, StorageError>
Similarly to the load_all_elements function,
but this function returns all elements as their histories.
§impl<Id, Element, const TEMP: bool> StorageInterfaceOpen for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> StorageInterfaceOpen for SledStorageInterface<Id, Element, TEMP>
§fn open_or_create(
location: &Path,
_storage_instance: u64,
) -> Result<SledStorageInterface<Id, Element, TEMP>, StorageError>
fn open_or_create( location: &Path, _storage_instance: u64, ) -> Result<SledStorageInterface<Id, Element, TEMP>, StorageError>
Initializes the current storage device. Read more
§impl<Id, Element, const TEMP: bool> StorageInterfaceStore<Id, Element> for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> StorageInterfaceStore<Id, Element> for SledStorageInterface<Id, Element, TEMP>
§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.
Auto Trait Implementations§
impl<Id, Element, const TEMP: bool> Freeze for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool = false> !RefUnwindSafe for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> Send for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> Sync for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool> Unpin for SledStorageInterface<Id, Element, TEMP>
impl<Id, Element, const TEMP: bool = false> !UnwindSafe for SledStorageInterface<Id, Element, TEMP>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.