[−][src]Struct caves::FileCave
A key-value store that stores keys in files.
This kv stores keys as files in a directory. Note that the directory must exist.
Caveats
This kv has the following caveats:
- It doesn't perform a sync operation after every set/delete.
- It doesn't create multi-level directories, e.g.,
fi/le/name
, to improve filesystem lookups.
Consider using it when you want to audit which keys are created using
external tools, such as ls
, cat
.
Methods
impl FileCave
[src]
pub fn new(dir: &Path) -> Result<Self, Error>
[src]
Create a new instance.
Check if the provided path is a directory and that it exists.
Trait Implementations
impl Cave for FileCave
[src]
fn get(&self, name: &str) -> Res
[src]
fn set(&self, name: &str, data: &[u8]) -> Res
[src]
fn delete(&self, name: &str) -> Res
[src]
fn not_found(&self, name: &str) -> Res
[src]
impl Debug for FileCave
[src]
Auto Trait Implementations
impl RefUnwindSafe for FileCave
impl Send for FileCave
impl Sync for FileCave
impl Unpin for FileCave
impl UnwindSafe for FileCave
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,