pub struct EntryMut<'a> { /* private fields */ }Expand description
A mutable reference to an Entry. Implements DerefMut to &mut Entry.
Implementations§
Source§impl EntryMut<'_>
impl EntryMut<'_>
Sourcepub fn edit(&mut self, f: impl FnOnce(&mut EntryMut<'_>)) -> &mut Self
pub fn edit(&mut self, f: impl FnOnce(&mut EntryMut<'_>)) -> &mut Self
Convenience method to edit the entry in a closure.
Sourcepub fn edit_tracking(
&mut self,
f: impl FnOnce(&mut EntryTrack<'_>),
) -> &mut Self
pub fn edit_tracking( &mut self, f: impl FnOnce(&mut EntryTrack<'_>), ) -> &mut Self
Convenience method to edit the entry in a closure, tracking changes.
Sourcepub fn track_changes(&mut self) -> EntryTrack<'_>
pub fn track_changes(&mut self) -> EntryTrack<'_>
Convert this mutable reference into a history-tracking variant that will persist the current state of the entry into its history when dropped.
NOTE: will always operate on the main Entry, not a historical version of it.
Sourcepub fn parent_mut(&mut self) -> GroupMut<'_>
pub fn parent_mut(&mut self) -> GroupMut<'_>
Get a mutable reference to the parent group of this entry.
Sourcepub fn previous_parent_mut(&mut self) -> Option<GroupMut<'_>>
pub fn previous_parent_mut(&mut self) -> Option<GroupMut<'_>>
Get a mutable reference to the previous parent group, if any
Sourcepub fn attachment_mut(&mut self, id: AttachmentId) -> Option<AttachmentMut<'_>>
pub fn attachment_mut(&mut self, id: AttachmentId) -> Option<AttachmentMut<'_>>
Get a mutable reference to an attachment by id, if it exists.
Sourcepub fn attachment_by_name_mut(
&mut self,
name: &str,
) -> Option<AttachmentMut<'_>>
pub fn attachment_by_name_mut( &mut self, name: &str, ) -> Option<AttachmentMut<'_>>
Get a mutable reference to an attachment by name, if it exists.
Sourcepub fn foreach_attachment_mut<F>(&mut self, f: F)where
F: FnMut(AttachmentMut<'_>),
pub fn foreach_attachment_mut<F>(&mut self, f: F)where
F: FnMut(AttachmentMut<'_>),
Apply a closure to each attachment of this entry, with mutable access.
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 to this entry with the given name and data.
Sourcepub fn remove_attachment_by_name(&mut self, name: &str)
pub fn remove_attachment_by_name(&mut self, name: &str)
Remove an attachment by name from this entry.
If it was the last reference to the attachment, remove it from the database.
Sourcepub fn remove_attachment_by_id(&mut self, attachment_id: AttachmentId)
pub fn remove_attachment_by_id(&mut self, attachment_id: AttachmentId)
Remove an attachment by id from this entry.
If it was the last reference to the attachment, remove it from the database.
Sourcepub fn set_icon_none(&mut self)
pub fn set_icon_none(&mut self)
Remove the icon from this entry, if it exists.
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, removing any existing icon.
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, removing any existing icon.
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, removing any existing icon. Returns a mutable reference to the newly created custom icon.
Sourcepub fn custom_icon_mut(&mut self) -> Option<CustomIconMut<'_>>
pub fn custom_icon_mut(&mut self) -> Option<CustomIconMut<'_>>
Get a mutable reference to the custom icon of this entry, if it exists and is a custom icon.
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.
NOTE: will always operate on the main Entry, not a historical version of it.
Sourcepub fn database_mut(&mut self) -> &mut Database
pub fn database_mut(&mut self) -> &mut Database
Get a mutable reference to the underlying database
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