Skip to main content

EntryRef

Struct EntryRef 

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

An immutable reference to an Entry. Implements Deref to &Entry.

Implementations§

Source§

impl EntryRef<'_>

Source

pub fn parent(&self) -> GroupRef<'_>

Get a reference to the parent group of this entry.

Source

pub fn previous_parent(&self) -> Option<GroupRef<'_>>

Get a reference to the previous parent group, if any

Source

pub fn historical(&self, index: usize) -> Option<EntryRef<'_>>

Gets an EntryRef to a historical version of the Entry, if it exists

Source

pub fn database(&self) -> &Database

Get a reference to the underlying database

Source

pub fn attachment(&self, id: AttachmentId) -> Option<AttachmentRef<'_>>

Get a reference to an attachment by id, if it exists.

Source

pub fn attachment_by_name(&self, name: &str) -> Option<AttachmentRef<'_>>

Get a reference to an attachment by name, if it exists.

Source

pub fn attachments(&self) -> impl Iterator<Item = AttachmentRef<'_>>

Get an iterator over the attachments of this entry.

Source

pub fn attachments_named( &self, ) -> impl Iterator<Item = (&str, AttachmentRef<'_>)>

Get an iterator over the (name, attachment) pairs of this entry.

Useful when callers need both the attachment’s filename (the key under which it is stored on the entry) and its data, since AttachmentRef itself does not expose the per-entry name.

Source

pub fn custom_icon(&self) -> Option<CustomIconRef<'_>>

Get the custom icon of this entry, if it exists and is a 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 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 EntryRef<'_>

Source§

type Target = Entry

The resulting type after dereferencing.
Source§

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

Dereferences the value.

Auto Trait Implementations§

§

impl<'a> Freeze for EntryRef<'a>

§

impl<'a> RefUnwindSafe for EntryRef<'a>

§

impl<'a> Send for EntryRef<'a>

§

impl<'a> Sync for EntryRef<'a>

§

impl<'a> Unpin for EntryRef<'a>

§

impl<'a> UnsafeUnpin for EntryRef<'a>

§

impl<'a> UnwindSafe for EntryRef<'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 = 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.