pub struct Entry {
pub fields: HashMap<String, Value<String>>,
pub times: Times,
/* private fields */
}Expand description
A database entry containing key-value fields.
Fields§
§fields: HashMap<String, Value<String>>Key-value fields, including username, password, URL, and notes.
Common field names are available in crate::db::fields.
times: TimesEntry timestamps.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn get(&self, key: &str) -> Option<&str>
pub fn get(&self, key: &str) -> Option<&str>
Get a field by name, taking care of unprotecting Protected values automatically
Sourcepub fn set(&mut self, key: impl Into<String>, value: Value<String>)
pub fn set(&mut self, key: impl Into<String>, value: Value<String>)
Set a field’s value by name
Sourcepub fn set_unprotected(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
)
pub fn set_unprotected( &mut self, key: impl Into<String>, value: impl Into<String>, )
Set a field’s unprotected value by name
Sourcepub fn update_unprotected(&mut self, key: &str, value: &str) -> bool
pub fn update_unprotected(&mut self, key: &str, value: &str) -> bool
Set an unprotected field only if its value or protection differs. Returns true if the field was changed.
Sourcepub fn update_protected(&mut self, key: &str, value: &str) -> bool
pub fn update_protected(&mut self, key: &str, value: &str) -> bool
Set a protected field only if its value or protection differs. Returns true if the field was changed.
Sourcepub fn set_protected(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
)
pub fn set_protected( &mut self, key: impl Into<String>, value: impl Into<String>, )
Set a field’s protected value by name
Sourcepub fn get_raw_otp_value(&self) -> Option<&str>
pub fn get_raw_otp_value(&self) -> Option<&str>
Convenience method for getting the raw value of the ‘otp’ field
Sourcepub fn get_title(&self) -> Option<&str>
pub fn get_title(&self) -> Option<&str>
Convenience method for getting the value of the ‘Title’ field
Sourcepub fn get_username(&self) -> Option<&str>
pub fn get_username(&self) -> Option<&str>
Convenience method for getting the value of the ‘UserName’ field
Sourcepub fn get_password(&self) -> Option<&str>
pub fn get_password(&self) -> Option<&str>
Convenience method for getting the value of the ‘Password’ field
Trait Implementations§
impl Eq for Entry
impl StructuralPartialEq for Entry
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.