Skip to main content

Database

Struct Database 

Source
pub struct Database {
    pub config: DatabaseConfig,
    pub root: SerializableNodePtr,
    pub deleted_objects: HashMap<Uuid, Option<NaiveDateTime>>,
    pub meta: Meta,
}
Expand description

A decrypted KeePass database

Fields§

§config: DatabaseConfig

Configuration settings of the database such as encryption and compression algorithms

§root: SerializableNodePtr

Root node of the KeePass database

§deleted_objects: HashMap<Uuid, Option<NaiveDateTime>>

References to previously-deleted objects and their deletion times.

§meta: Meta

Metadata of the KeePass database

Implementations§

Source§

impl Database

Source

pub fn purge_unused_custom_icons(&mut self) -> usize

Remove custom icons that are not referenced by any group, entry, or history item.

Returns the number of removed icons.

Source

pub fn new(config: DatabaseConfig) -> Database

Create a new, empty database

Source

pub fn node_get_parents(&self, node: &NodePtr) -> Vec<Uuid>

Source

pub fn set_recycle_bin_enabled(&mut self, enabled: bool)

Source

pub fn recycle_bin_enabled(&self) -> bool

Source

pub fn node_is_recycle_bin(&self, node: &NodePtr) -> bool

Source

pub fn node_is_in_recycle_bin(&self, node: Uuid) -> bool

Source

pub fn get_recycle_bin(&self) -> Option<NodePtr>

Source

pub fn create_recycle_bin(&mut self) -> Result<NodePtr>

Source

pub fn remove_node_by_uuid(&mut self, uuid: Uuid) -> Result<NodePtr>

Source

pub fn search_node_by_uuid(&self, uuid: Uuid) -> Option<NodePtr>

Source

pub fn create_new_entry(&self, parent: Uuid, index: usize) -> Result<NodePtr>

Source

pub fn create_new_group(&self, parent: Uuid, index: usize) -> Result<NodePtr>

Source§

impl Database

Source

pub fn open( source: &mut dyn Read, key: DatabaseKey, ) -> Result<Database, DatabaseOpenError>

Parse a database from a std::io::Read

Source

pub fn parse( data: &[u8], key: DatabaseKey, ) -> Result<Database, DatabaseOpenError>

Source

pub fn get_xml( source: &mut dyn Read, key: DatabaseKey, ) -> Result<Vec<u8>, DatabaseOpenError>

Helper function to load a database into its internal XML chunks

Source

pub fn get_version( source: &mut dyn Read, ) -> Result<DatabaseVersion, DatabaseIntegrityError>

Get the version of a database without decrypting it

Source§

impl Database

Source

pub fn merge(&mut self, other: &Database) -> Result<MergeLog, MergeError>

Merge this database with another version of this same database. This function will use the UUIDs to detect that entries and groups are the same.

Source§

impl Database

Source

pub fn save( &self, destination: &mut dyn Write, key: DatabaseKey, ) -> Result<(), DatabaseSaveError>

Save a database to a std::io::Write

Trait Implementations§

Source§

impl Clone for Database

Source§

fn clone(&self) -> Self

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 Eq for Database

Source§

impl PartialEq for Database

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 Database

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§

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