pub struct EntryTrack<'a> { /* private fields */ }Expand description
A variant of EntryMut that will persist the history of the entry when dropped.
Implementations§
Source§impl EntryTrack<'_>
impl EntryTrack<'_>
Sourcepub fn as_mut(&mut self) -> EntryMut<'_>
pub fn as_mut(&mut self) -> EntryMut<'_>
Turn this tracked entry into a normal mutable reference to the entry
Sourcepub fn move_to(
&mut self,
group_id: GroupId,
) -> Result<(), DestinationGroupNotFoundError>
pub fn move_to( &mut self, group_id: GroupId, ) -> Result<(), DestinationGroupNotFoundError>
Move this entry to another group, tracking the change in history.
Sourcepub fn edit(&mut self, f: impl FnOnce(&mut EntryTrack<'_>)) -> &mut Self
pub fn edit(&mut self, f: impl FnOnce(&mut EntryTrack<'_>)) -> &mut Self
Convenience method to edit the entry in a closure, tracking changes.
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 value, tracking changes. See crate::db::fields for common field names.
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 protected field value, tracking changes. See crate::db::fields for common field names.
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 an unprotected field value, tracking changes. See crate::db::fields for common field names.
Sourcepub fn add_attachment(
&mut self,
name: impl Into<String>,
data: Value<Vec<u8>>,
) -> AttachmentMut<'_>
pub fn add_attachment( &mut self, name: impl Into<String>, data: Value<Vec<u8>>, ) -> AttachmentMut<'_>
Add an attachment, tracking changes.
Sourcepub fn set_icon_none(&mut self)
pub fn set_icon_none(&mut self)
Remove the entry’s icon, tracking changes.
Sourcepub fn set_icon_builtin(&mut self, icon_id: usize)
pub fn set_icon_builtin(&mut self, icon_id: usize)
Set a built-in icon for this entry by its ID, tracking changes.
Sourcepub fn set_icon_custom(
&mut self,
custom_icon_id: CustomIconId,
) -> Result<(), CustomIconNotFoundError>
pub fn set_icon_custom( &mut self, custom_icon_id: CustomIconId, ) -> Result<(), CustomIconNotFoundError>
Set a custom icon for this entry by its ID, tracking changes.
Sourcepub fn set_icon_custom_new(&mut self, data: Vec<u8>) -> CustomIconMut<'_>
pub fn set_icon_custom_new(&mut self, data: Vec<u8>) -> CustomIconMut<'_>
Set a custom icon for this entry by providing the raw data, tracking changes. Returns a mutable reference to the newly created custom icon.
Methods from Deref<Target = 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 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