Type Definition koit::FileDatabase [−][src]
type FileDatabase<D, F> = Database<D, File, F>;
This is supported 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.
Implementations
impl<D, F> FileDatabase<D, F> where
F: Format<D>,
[src]
impl<D, F> FileDatabase<D, F> where
F: Format<D>,
[src]pub async fn load_from_path_or_else<P, T>(
path: P,
factory: T
) -> Result<Self, KoitError> where
P: AsRef<Path>,
T: FnOnce() -> D,
[src]
pub async fn load_from_path_or_else<P, T>(
path: P,
factory: T
) -> Result<Self, KoitError> where
P: AsRef<Path>,
T: FnOnce() -> D,
[src]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.