Skip to main content

Entry

Struct Entry 

Source
pub struct Entry {
    pub attachments: HashMap<String, Attachment>,
    /* private fields */
}
Expand description

A database entry containing several key-value fields.

Fields§

§attachments: HashMap<String, Attachment>

Implementations§

Source§

impl Entry

Source§

impl<'a> Entry

Source

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

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

Source

pub fn get_bytes(&'a self, key: &str) -> Option<&'a [u8]>

Get a bytes field by name

Source

pub fn get_autotype(&self) -> Option<&AutoType>

Source

pub fn set_autotype(&mut self, autotype: Option<AutoType>)

Source

pub fn get_tags(&self) -> &Vec<String>

Convenience method for getting tags Returns a Vec of tags

Source

pub fn get_tags_mut(&mut self) -> &mut Vec<String>

Source

pub fn set_additional_attribute( &mut self, key: &str, value: Option<&str>, ) -> Result<()>

Set or remove additional attributes (custom string data)

Source

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

Get an additional attribute (custom string data)

Source

pub fn additional_attributes(&self) -> Vec<(String, String)>

Get all additional string attributes stored directly on this entry.

Source

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

Convenience method for getting the value of the UserName field

Source

pub fn set_username(&mut self, username: Option<&str>)

Source

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

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

Source

pub fn set_password(&mut self, password: Option<&str>)

Source

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

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

Source

pub fn set_url(&mut self, url: Option<&str>)

Source

pub fn update_history(&mut self) -> bool

Adds the current version of the entry to the entry’s history and updates the last modification timestamp. The history will only be updated if the entry has uncommited changes.

Returns whether or not a new history entry was added.

Source§

impl<'a> Entry

Source

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

Convenience method for getting a TOTP from this entry

Source

pub fn set_otp(&mut self, otp: Option<&TOTP>)

Source

pub fn set_raw_otp_value(&mut self, value: Option<&str>)

Convenience method for setting a TOTP to this entry

Source

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

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

Trait Implementations§

Source§

impl Clone for Entry

Source§

fn clone(&self) -> Entry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Entry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Entry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Entry

Source§

impl Node for Entry

Source§

fn duplicate(&self) -> NodePtr

Source§

fn get_uuid(&self) -> Uuid

Source§

fn set_uuid(&mut self, uuid: Uuid)

Source§

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

Source§

fn set_title(&mut self, title: Option<&str>)

Source§

fn get_notes(&self) -> Option<&str>

Source§

fn set_notes(&mut self, notes: Option<&str>)

Source§

fn get_icon(&self) -> Icon

Source§

fn set_icon(&mut self, icon: Icon)

Source§

fn get_times(&self) -> &Times

Get a timestamp field by name Read more
Source§

fn get_times_mut(&mut self) -> &mut Times

Source§

fn get_parent(&self) -> Option<Uuid>

Source§

fn set_parent(&mut self, parent: Option<Uuid>)

Source§

impl PartialEq for Entry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Entry

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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.