Skip to main content

EntryTrack

Struct EntryTrack 

Source
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<'_>

Source

pub fn as_mut(&mut self) -> EntryMut<'_>

Turn this tracked entry into a normal mutable reference to the entry

Source

pub fn move_to( &mut self, group_id: GroupId, ) -> Result<(), DestinationGroupNotFoundError>

Move this entry to another group, tracking the change in history.

Source

pub fn remove(self)

Remove this entry from the database, tracking the change in history.

Source

pub fn edit(&mut self, f: impl FnOnce(&mut EntryTrack<'_>)) -> &mut Self

Convenience method to edit the entry in a closure, tracking changes.

Source

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.

Source

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.

Source

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.

Source

pub fn add_attachment( &mut self, name: impl Into<String>, data: Value<Vec<u8>>, ) -> AttachmentMut<'_>

Add an attachment, tracking changes.

Source

pub fn set_icon_none(&mut self)

Remove the entry’s icon, tracking changes.

Source

pub fn set_icon_builtin(&mut self, icon_id: usize)

Set a built-in icon for this entry by its ID, tracking changes.

Source

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.

Source

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>§

Source

pub fn id(&self) -> EntryId

Get the unique identifier for the Entry

Source

pub fn icon(&self) -> Option<&Icon>

Get the icon of this entry, if it exists

Source

pub fn get(&self, key: &str) -> Option<&str>

Get a field by name, taking care of unprotecting Protected values automatically

Source

pub fn set(&mut self, key: impl Into<String>, value: Value<String>)

Set a field’s value by name

Source

pub fn set_unprotected( &mut self, key: impl Into<String>, value: impl Into<String>, )

Set a field’s unprotected value by name

Source

pub fn set_protected( &mut self, key: impl Into<String>, value: impl Into<String>, )

Set a field’s protected value by name

Source

pub fn get_raw_otp_value(&self) -> Option<&str>

Convenience method for getting the raw value of the ‘otp’ field

Source

pub fn get_title(&self) -> Option<&str>

Convenience method for getting the value of the ‘Title’ field

Source

pub fn get_username(&self) -> Option<&str>

Convenience method for getting the value of the ‘UserName’ field

Source

pub fn get_password(&self) -> Option<&str>

Convenience method for getting the value of the ‘Password’ field

Source

pub fn get_url(&self) -> Option<&str>

Convenience method for getting the value of the ‘URL’ field

Trait Implementations§

Source§

impl Deref for EntryTrack<'_>

Source§

type Target = Entry

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for EntryTrack<'_>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Drop for EntryTrack<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for EntryTrack<'a>

§

impl<'a> Freeze for EntryTrack<'a>

§

impl<'a> RefUnwindSafe for EntryTrack<'a>

§

impl<'a> Send for EntryTrack<'a>

§

impl<'a> Sync for EntryTrack<'a>

§

impl<'a> Unpin for EntryTrack<'a>

§

impl<'a> UnsafeUnpin for EntryTrack<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.