diff options
Diffstat (limited to 'lockchain-files/src/lib.rs')
-rw-r--r-- | lockchain-files/src/lib.rs | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lockchain-files/src/lib.rs b/lockchain-files/src/lib.rs index b9b8bd4..e62611e 100644 --- a/lockchain-files/src/lib.rs +++ b/lockchain-files/src/lib.rs @@ -23,31 +23,31 @@ use lcc::{ Generator, Header, MetaDomain, Payload, Record, VaultMetadata, }; use std::collections::HashMap; +use std::default::Default; mod config; mod create; mod fs; mod load; -mod userstore; mod utils; +mod userstore; pub use config::{ConfigError, VaultConfig}; use fs::{FileType, Filesystem}; -use userstore::UserStoreMapper; /// Persistence mapper to a folder and file structure /// /// This implementation tries to be as efficient /// as possible, however please note that it is /// dependant on filesystem operations and is -/// not suited for high-performance applications! -/// +/// not suited for high-performance applications! +/// /// --- -/// +/// /// Implements the `Vault` API in full, /// replicating all functionality in memory /// while providing async operations on-disk. -/// +/// /// Requests on files are debounced! /// /// The internal layout should not be assumed @@ -76,6 +76,18 @@ pub struct FileVault<T: Body> { metadata: HashMap<String, MetaDomain>, } +impl<T: Body> Default for FileVault<T> { + #[allow(unconditional_recursion)] + fn default() -> Self { + Self { + records: HashMap::new(), + headers: HashMap::new(), + metadata: HashMap::new(), + ..Default::default() + } + } +} + impl<T: Body> LoadRecord<T> for FileVault<T> {} impl<T: Body> Vault<T> for FileVault<T> { |