pub type FileDatabase<D, F> = Database<D, File, F>;Available on crate feature
file-backend only.Expand description
A file-backed database.
Note: this requires its futures to be executed on the Tokio 0.3 runtime.
Aliased Type§
pub struct FileDatabase<D, F> { /* private fields */ }Implementations§
Source§impl<D, F> FileDatabase<D, F>where
F: Format<D>,
impl<D, F> FileDatabase<D, F>where
F: Format<D>,
Sourcepub async fn load_from_path<P>(path: P) -> Result<Self, KoitError>
pub async fn load_from_path<P>(path: P) -> Result<Self, KoitError>
Sourcepub async fn load_from_path_or_else<P, T>(
path: P,
factory: T,
) -> Result<Self, KoitError>
pub async fn load_from_path_or_else<P, T>( path: P, factory: T, ) -> Result<Self, KoitError>
Construct the file-backed database from the given path. If the file does not exist,
the file is created. Then factory is called and its return value is used as the initial value.
This data is immediately and saved to file.