Struct keepass_ng::db::Database
source · pub struct Database {
pub config: DatabaseConfig,
pub header_attachments: Vec<HeaderAttachment>,
pub root: NodePtr,
pub deleted_objects: DeletedObjects,
pub meta: Meta,
}Expand description
A decrypted KeePass database
Fields§
§config: DatabaseConfigConfiguration settings of the database such as encryption and compression algorithms
header_attachments: Vec<HeaderAttachment>Binary attachments in the inner header
root: NodePtrRoot node of the KeePass database
deleted_objects: DeletedObjectsReferences to previously-deleted objects
meta: MetaMetadata of the KeePass database
Implementations§
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
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
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
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 create_new_entry(&self, parent: Uuid, index: usize) -> Result<NodePtr>
pub fn create_new_group(&self, parent: Uuid, index: usize) -> Result<NodePtr>
Trait Implementations§
source§impl PartialEq for Database
impl PartialEq for Database
impl Eq for Database
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl !Send for Database
impl !Sync for Database
impl Unpin for Database
impl !UnwindSafe 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