Skip to main content

EntryMut

Struct EntryMut 

Source
pub struct EntryMut<'a> { /* private fields */ }
Expand description

A mutable reference to an Entry. Implements DerefMut to &mut Entry.

Implementations§

Source§

impl EntryMut<'_>

Source

pub fn remove(self)

Remove this entry from the database

Methods from Deref<Target = Entry>§

Source

pub fn get_otp(&self) -> Result<TOTP, TOTPError>

Convenience method for getting a TOTP from this entry.

Source

pub fn id(&self) -> EntryId

Get the unique identifier for the Entry

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

Source

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.

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

Source§

type Target = Entry

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for EntryMut<'_>

Source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

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

§

impl<'a> Forget for EntryMut<'a>

§

impl<'a> Freeze for EntryMut<'a>

§

impl<'a> RefUnwindSafe for EntryMut<'a>

§

impl<'a> Send for EntryMut<'a>

§

impl<'a> Sync for EntryMut<'a>

§

impl<'a> Unpin for EntryMut<'a>

§

impl<'a> UnsafeUnpin for EntryMut<'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, !>

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.