Trait perlin::storage::Storage
[−]
[src]
pub trait Storage<T> where
Self: Sync + Send, { fn get(&self, id: u64) -> Result<Arc<T>>; fn store(&mut self, id: u64, data: T) -> Result<()>; }
Defines a common interface between multiple storage types The index uses them to store data like the posting lists
Required Methods
fn get(&self, id: u64) -> Result<Arc<T>>
Tries to get a value for a given Id. Returns an Error if read fails or if id is unknown.
fn store(&mut self, id: u64, data: T) -> Result<()>
Tries to store a value with a given Id. Returns an Error if Write fails or if there is no more space.
Implementors
impl<TItem: ByteDecodable + ByteEncodable + Sync + Send> Storage<TItem> for FsStorage<TItem>
impl<T: Sync + Send> Storage<T> for RamStorage<T>