pub struct Database {
pub config: DatabaseConfig,
/* private fields */
}Expand description
A decrypted KeePass database
Fields§
§config: DatabaseConfigEncryption, compression, and KDF configuration.
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 parse(
data: &[u8],
key: DatabaseKey,
) -> Result<Database, DatabaseOpenError>
pub fn parse( data: &[u8], key: DatabaseKey, ) -> Result<Database, DatabaseOpenError>
Parse a database from a byte slice
Sourcepub fn get_version(
source: &mut dyn Read,
) -> Result<DatabaseVersion, DatabaseOpenError>
pub fn get_version( source: &mut dyn Read, ) -> Result<DatabaseVersion, DatabaseOpenError>
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>
Saves the database to the given destination, using the provided key for encryption.
Source§impl Database
impl Database
Sourcepub fn with_config(config: DatabaseConfig) -> Self
pub fn with_config(config: DatabaseConfig) -> Self
Create a new database with the given configuration.
Sourcepub fn new_with_root_id(root_id: GroupId) -> Self
pub fn new_with_root_id(root_id: GroupId) -> Self
Create a new database with the given root group ID.
Sourcepub fn root(&self) -> GroupRef<'_>
pub fn root(&self) -> GroupRef<'_>
Get an immutable reference to the root group of the database.
Sourcepub fn root_mut(&mut self) -> GroupMut<'_>
pub fn root_mut(&mut self) -> GroupMut<'_>
Get a mutable reference to the root group of the database.
Sourcepub fn iter_all_entries(&self) -> impl Iterator<Item = EntryRef<'_>> + '_
pub fn iter_all_entries(&self) -> impl Iterator<Item = EntryRef<'_>> + '_
Iterate over all entries with immutable access.
Sourcepub fn entry(&self, id: EntryId) -> Option<EntryRef<'_>>
pub fn entry(&self, id: EntryId) -> Option<EntryRef<'_>>
Get an immutable reference to the entry with the given ID, if it exists
Sourcepub fn entry_mut(&mut self, id: EntryId) -> Option<EntryMut<'_>>
pub fn entry_mut(&mut self, id: EntryId) -> Option<EntryMut<'_>>
Get a mutable reference to the entry with the given ID, if it exists
Trait Implementations§
impl Eq for Database
impl StructuralPartialEq for Database
Auto Trait Implementations§
impl Forget for Database
impl Freeze for Databasewhere
*const u8 is !null: Freeze,
PhantomData<(String, VariantDictionaryValue)>: Freeze,
PhantomData<(EntryId, Entry)>: Freeze,
PhantomData<(GroupId, Group)>: Freeze,
impl Move for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Databasewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, VariantDictionaryValue)>: UnsafeUnpin,
PhantomData<(EntryId, Entry)>: UnsafeUnpin,
PhantomData<(GroupId, Group)>: UnsafeUnpin,
impl UnwindSafe for Databasewhere
HashMap<String, VariantDictionaryValue>: UnwindSafe,
HashMap<EntryId, Entry>: UnwindSafe,
HashMap<GroupId, Group>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.