[−][src]Struct fs_db::FileStore
A simple file system based key:value data store
Methods
impl<V, E> FileStore<V> where
V: EncodeDecode<Value = V, Error = E> + Serialize + DeserializeOwned + Debug,
E: Debug,
[src]
V: EncodeDecode<Value = V, Error = E> + Serialize + DeserializeOwned + Debug,
E: Debug,
pub fn new<P: AsRef<Path>>(dir: P) -> Result<Self, Error<E>>
[src]
Create a new FileStore
pub fn list(&mut self) -> Result<Vec<String>, Error<E>>
[src]
List all files in the database
pub fn load<P: AsRef<Path>>(&mut self, name: P) -> Result<V, Error<E>>
[src]
Load a file by name
pub fn store<P: AsRef<Path>>(&mut self, name: P, v: &V) -> Result<(), Error<E>>
[src]
Store a file by name
pub fn load_all(&mut self) -> Result<Vec<(String, V)>, Error<E>>
[src]
Load all files from the database
pub fn store_all(&mut self, data: &[(String, V)]) -> Result<(), Error<E>>
[src]
Store a colection of files in the database
pub fn rm<P: AsRef<Path>>(&mut self, name: P) -> Result<(), Error<E>>
[src]
Remove a file from the database
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,