diff options
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -147,8 +147,10 @@ pub enum EntryData { serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq, )] pub struct Field { + pub ty: crate::api::FieldType, pub name: Option<String>, pub value: Option<String>, + pub linked_id: Option<crate::api::LinkedIdType>, } #[derive( @@ -164,7 +166,10 @@ pub struct Db { pub access_token: Option<String>, pub refresh_token: Option<String>, + pub kdf: Option<crate::api::KdfType>, pub iterations: Option<u32>, + pub memory: Option<u32>, + pub parallelism: Option<u32>, pub protected_key: Option<String>, pub protected_private_key: Option<String>, pub protected_org_keys: std::collections::HashMap<String, String>, @@ -173,6 +178,7 @@ pub struct Db { } impl Db { + #[must_use] pub fn new() -> Self { Self::default() } @@ -287,10 +293,12 @@ impl Db { Ok(()) } + #[must_use] pub fn needs_login(&self) -> bool { self.access_token.is_none() || self.refresh_token.is_none() || self.iterations.is_none() + || self.kdf.is_none() || self.protected_key.is_none() } } |