Trait nolock::thread_data::StorageBackend
source · [−]pub trait StorageBackend<T> {
fn get(&self, id: u64) -> Option<&T>;
fn insert(&self, id: u64, data: T) -> &T;
}
Expand description
The General Interface used by the ThreadDataStorage
to interface with
any sort of Datastructure used to actually store the Data for each
individuel Thread.
Required Methods
This should create a new Entry with the given ID and Data, which will later be loaded again. This should then also return a reference to the Data that can the be used to access it directly.
Note
This function will only be called with new ID’s and should therefore never cause an ID collision in the underlying Storage