pub struct FilesystemStore<K, V> { /* private fields */ }Expand description
Implementation of Store that is backed by a directory.
§Description
FilesystemStore used a directory named after the store and stores the keys as files.
It requires both StringStoreKey for keys and StringStoreValue for values, since
it stores the values as Strings as well.
This implementation is not efficient in any way.
It is fast enough for CLI usage, since the amount of data processed there is relatively small.
Also, storing data as Stings in files makes debugging and understanding what data has
been stored very easy.
Searching through the store is done by scanning through the directory, which is very slow.
§Caution
There is no locking or checking that each path is instanciated only once. You must be careful not to instanciate two stores at the same location.
Also starting a program that uses the store twice may load to problems. This is used mainly for simple applications. You may need a database for more complex applications.
Implementations§
Source§impl<K, V> FilesystemStore<K, V>
impl<K, V> FilesystemStore<K, V>
Sourcepub fn new(path: PathBuf) -> FilesystemStore<K, V>
pub fn new(path: PathBuf) -> FilesystemStore<K, V>
Create a new FilesystemStore, at the path
Trait Implementations§
Source§impl<K: Clone, V: Clone> Clone for FilesystemStore<K, V>
impl<K: Clone, V: Clone> Clone for FilesystemStore<K, V>
Source§fn clone(&self) -> FilesystemStore<K, V>
fn clone(&self) -> FilesystemStore<K, V>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<K: StringStoreKey, V: StringStoreValue> OrderedStoreRead<K, V> for FilesystemStore<K, V>
impl<K: StringStoreKey, V: StringStoreValue> OrderedStoreRead<K, V> for FilesystemStore<K, V>
Source§impl<K: StringStoreKey, V: StringStoreValue> SearchableStoreRead<K, V> for FilesystemStore<K, V>
impl<K: StringStoreKey, V: StringStoreValue> SearchableStoreRead<K, V> for FilesystemStore<K, V>
Source§impl<K: StringStoreKey, V: StringStoreValue> StoreRead<K, V> for FilesystemStore<K, V>
impl<K: StringStoreKey, V: StringStoreValue> StoreRead<K, V> for FilesystemStore<K, V>
Source§impl<K: StringStoreKey, V: StringStoreValue> StoreWrite<K, V> for FilesystemStore<K, V>
impl<K: StringStoreKey, V: StringStoreValue> StoreWrite<K, V> for FilesystemStore<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for FilesystemStore<K, V>
impl<K, V> RefUnwindSafe for FilesystemStore<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for FilesystemStore<K, V>
impl<K, V> Sync for FilesystemStore<K, V>
impl<K, V> Unpin for FilesystemStore<K, V>
impl<K, V> UnsafeUnpin for FilesystemStore<K, V>
impl<K, V> UnwindSafe for FilesystemStore<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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