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: DatabaseConfigConfiguration settings of the database such as encryption and compression algorithms
root: SerializableNodePtrRoot node of the KeePass database
deleted_objects: HashMap<Uuid, Option<NaiveDateTime>>References to previously-deleted objects and their deletion times.
meta: MetaMetadata of the KeePass database
Implementations§
Source§impl Database
impl Database
Sourcepub fn purge_unused_custom_icons(&mut self) -> usize
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.
Sourcepub fn new(config: DatabaseConfig) -> Database
pub fn new(config: DatabaseConfig) -> Database
Create a new, empty database
pub fn node_get_parents(&self, node: &NodePtr) -> Vec<Uuid>
pub fn set_recycle_bin_enabled(&mut self, enabled: bool)
pub fn recycle_bin_enabled(&self) -> bool
pub fn node_is_recycle_bin(&self, node: &NodePtr) -> bool
pub fn node_is_in_recycle_bin(&self, node: Uuid) -> bool
pub fn get_recycle_bin(&self) -> Option<NodePtr>
pub fn create_recycle_bin(&mut self) -> Result<NodePtr>
pub fn remove_node_by_uuid(&mut self, uuid: Uuid) -> Result<NodePtr>
pub fn search_node_by_uuid(&self, uuid: Uuid) -> Option<NodePtr>
pub fn create_new_entry(&self, parent: Uuid, index: usize) -> Result<NodePtr>
pub fn create_new_group(&self, parent: Uuid, index: usize) -> Result<NodePtr>
Source§impl Database
impl Database
Sourcepub fn open(
source: &mut dyn Read,
key: DatabaseKey,
) -> Result<Database, DatabaseOpenError>
pub fn open( source: &mut dyn Read, key: DatabaseKey, ) -> Result<Database, DatabaseOpenError>
Parse a database from a std::io::Read
pub fn parse( data: &[u8], key: DatabaseKey, ) -> Result<Database, DatabaseOpenError>
Sourcepub fn get_xml(
source: &mut dyn Read,
key: DatabaseKey,
) -> Result<Vec<u8>, DatabaseOpenError>
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
Sourcepub fn get_version(
source: &mut dyn Read,
) -> Result<DatabaseVersion, DatabaseIntegrityError>
pub fn get_version( source: &mut dyn Read, ) -> Result<DatabaseVersion, DatabaseIntegrityError>
Get the version of a database without decrypting it
Source§impl Database
impl Database
Sourcepub fn save(
&self,
destination: &mut dyn Write,
key: DatabaseKey,
) -> Result<(), DatabaseSaveError>
pub fn save( &self, destination: &mut dyn Write, key: DatabaseKey, ) -> Result<(), DatabaseSaveError>
Save a database to a std::io::Write
Trait Implementations§
impl Eq for Database
Auto Trait Implementations§
impl !RefUnwindSafe for Database
impl !Send for Database
impl !Sync for Database
impl !UnwindSafe for Database
impl Freeze for Database
impl Unpin for Database
impl UnsafeUnpin for Database
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more