Skip to main content

Database

Struct Database 

Source
pub struct Database { /* private fields */ }
Expand description

Decrypted password database

See the module-level documentation for more information.

Implementations§

Source§

impl Database

Source

pub fn meta(&self) -> &Meta

Return meta information about the database like name and access times

Source

pub fn meta_mut(&mut self) -> &mut Meta

Mutable meta information about the database like name and access times

Source

pub fn name(&self) -> &str

Get the database name

Source

pub fn set_name<S: ToString>(&mut self, name: S)

Set the database name

Source

pub fn description(&self) -> &str

Get the database description

Source

pub fn set_description<S: ToString>(&mut self, desc: S)

Set the database name

Source

pub fn add_entry(&mut self, entry: Entry)

Add a entry to the root group

Source

pub fn add_group(&mut self, entry: Group)

Add a child group to the root group

Source

pub fn replace_root(&mut self, group: Group)

Replace the root group (and therefore all entries!) with a custom tree

Source

pub fn find_group<F: FnMut(&Group) -> bool>(&self, f: F) -> Option<&Group>

Recursively searches for the first group matching a filter

Source

pub fn find_group_mut<F: FnMut(&Group) -> bool>( &mut self, f: F, ) -> Option<&mut Group>

Recursively searches for the first group matching a filter, returns it mutably

Source

pub fn find_entry<F: FnMut(&Entry) -> bool>(&self, f: F) -> Option<&Entry>

Recursively searches for the first entry matching a filter

Source

pub fn find_entry_mut<F: FnMut(&Entry) -> bool>( &mut self, f: F, ) -> Option<&mut Entry>

Recursively searches for the first entry matching a filter, returns it mutably

Source

pub fn root(&self) -> &Group

Top level group for database entries

Source

pub fn root_mut(&mut self) -> &mut Group

Mutable top level group for database entries

Trait Implementations§

Source§

impl Clone for Database

Source§

fn clone(&self) -> Database

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 Database

Source§

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

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

impl Default for Database

Source§

fn default() -> Self

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

impl Eq for Database

Source§

impl PartialEq for Database

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Database

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V