Database

Struct Database 

Source
pub struct Database {
    pub config: DatabaseConfig,
    pub header_attachments: Vec<HeaderAttachment>,
    pub root: SerializableNodePtr,
    pub deleted_objects: DeletedObjects,
    pub meta: Meta,
}
Expand description

A decrypted KeePass database

Fields§

§config: DatabaseConfig

Configuration settings of the database such as encryption and compression algorithms

§header_attachments: Vec<HeaderAttachment>

Binary attachments in the inner header

§root: SerializableNodePtr

Root node of the KeePass database

§deleted_objects: DeletedObjects

References to previously-deleted objects

§meta: Meta

Metadata of the KeePass database

Implementations§

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 save( &self, destination: &mut dyn Write, key: DatabaseKey, ) -> Result<(), DatabaseSaveError>

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

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

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

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.

Trait Implementations§

Source§

impl Clone for Database

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · 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 PartialEq for Database

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 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
Source§

impl Eq 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<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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T