pub struct S2BaseStore<R: StdReader = FileReader, K: U64 = u64, V: Serialize + DeserializeOwned = Properties> { /* private fields */ }Available on crate feature
std only.Expand description
NOTE: The File KVStore is designed to be used in states:
- write-only. The initial state is write-only. Write all you need to before reading
- read-only. Once you have written everything, the first read will lock the file to be static and read-only.
Implementations§
Source§impl<R: StdReader, K: U64, V: Serialize + DeserializeOwned> S2BaseStore<R, K, V>
impl<R: StdReader, K: U64, V: Serialize + DeserializeOwned> S2BaseStore<R, K, V>
Sourcepub fn new(file_name: Option<&str>, options: Option<FileOptions>) -> Self
pub fn new(file_name: Option<&str>, options: Option<FileOptions>) -> Self
Builds a new File based KV
Sourcepub fn get(&mut self, key: K, max: Option<usize>) -> Option<(u64, Vec<V>)>
pub fn get(&mut self, key: K, max: Option<usize>) -> Option<(u64, Vec<V>)>
Get the values in relation to the given key Returns None if the key does not exist, but will return the index of the first match with all values of key if the key exists
Sourcepub fn get_index(&mut self, index: u64) -> Option<(K, V)>
pub fn get_index(&mut self, index: u64) -> Option<(K, V)>
Get the value at the given index. Return (key, value)
Sourcepub fn iter_multi(&mut self) -> IterMulti<'_, R, K, V> ⓘ
pub fn iter_multi(&mut self) -> IterMulti<'_, R, K, V> ⓘ
Iterate over the store but group all values related to a key
Trait Implementations§
Source§impl<R: Clone + StdReader, K: Clone + U64, V: Clone + Serialize + DeserializeOwned> Clone for S2BaseStore<R, K, V>
impl<R: Clone + StdReader, K: Clone + U64, V: Clone + Serialize + DeserializeOwned> Clone for S2BaseStore<R, K, V>
Source§fn clone(&self) -> S2BaseStore<R, K, V>
fn clone(&self) -> S2BaseStore<R, K, V>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<R, K, V> Freeze for S2BaseStore<R, K, V>where
R: Freeze,
impl<R, K, V> RefUnwindSafe for S2BaseStore<R, K, V>
impl<R, K, V> Send for S2BaseStore<R, K, V>
impl<R, K, V> Sync for S2BaseStore<R, K, V>
impl<R, K, V> Unpin for S2BaseStore<R, K, V>
impl<R, K, V> UnwindSafe for S2BaseStore<R, K, V>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().