[−][src]Struct kpdb::Database
The KeePass database.
Fields
comment: Option<Comment>
Content of the comment header.
composite_key: CompositeKey
Composite key.
compression: Compression
Compression algorithm.
db_type: DbType
Type of the database.
master_cipher: MasterCipher
Master encryption algorithm.
stream_cipher: StreamCipher
Stream encryption algorithm (e.g. passwords).
transform_rounds: TransformRounds
Number of times the composite key must be transformed.
version: Version
The database version.
binaries: BinariesMap
Map with binary data.
color: Option<Color>
Optional color.
custom_data: CustomDataMap
Map with custom data.
custom_icons: CustomIconsMap
Map with custom icons.
def_username: String
Default username for new entries.
def_username_changed: DateTime<Utc>
The date and time the default username was changed.
description: String
Description of this database.
description_changed: DateTime<Utc>
The date and time the description was changed.
entry_templates_group_changed: DateTime<Utc>
The date and time the entry templates group was changed.
entry_templates_group_uuid: GroupUuid
The identifier of the group containing entry templates.
generator: String
Name of the generator.
history_max_items: i32
Maximum number of history items.
history_max_size: i32
Maximum size of the history data.
last_selected_group: GroupUuid
The identifier of the last selected group.
last_top_visible_group: GroupUuid
The identifier of the last top visible group.
maintenance_history_days: i32
Number of days until history entries are being deleted.
master_key_change_force: i32
master_key_change_rec: i32
master_key_changed: DateTime<Utc>
The date and time the master key was changed.
name: String
Name of this database.
name_changed: DateTime<Utc>
The date and time the name was changed.
protect_notes: bool
Whether notes must be protected.
protect_password: bool
Whether passwords must be protected.
protect_title: bool
Whether titles must be protected.
protect_url: bool
Whether URL's must be protected.
protect_username: bool
Whether usernames must be protected.
recycle_bin_changed: DateTime<Utc>
The date and time the recycle bin was changed.
recycle_bin_enabled: bool
Whether the recycle bin is enabled.
recycle_bin_uuid: GroupUuid
The identifier of the recycle bin.
root_group: Group
The root group.
Methods
impl Database
[src]
pub fn new(key: &CompositeKey) -> Database
[src]
Create a new database.
Examples
use kpdb::{CompositeKey, Database}; let key = CompositeKey::from_password("password"); let db = Database::new(&key);
pub fn find_entries<'a, S: Into<String>>(&'a self, text: S) -> Vec<&'a Entry>
[src]
Returns a vector with entries that match (case insensitive) the supplied text.
Examples
use kpdb::{CompositeKey, Database, Entry, Group}; let mut protonmail = Entry::new(); protonmail.set_title("ProtonMail"); protonmail.set_username("puser"); protonmail.set_password("ppass"); protonmail.set_url("https://mail.protonmail.com"); let mut group = Group::new("Email"); group.add_entry(protonmail); let mut db = Database::new(&CompositeKey::from_password("test")); db.root_group.add_group(group); let result = db.find_entries("Protonm"); assert_eq!(result.len(), 1); let result = db.find_entries("gmail"); assert_eq!(result.len(), 0);
pub fn find_entries_mut<'a, S: Into<String>>(
&'a mut self,
text: S
) -> Vec<&'a mut Entry>
[src]
&'a mut self,
text: S
) -> Vec<&'a mut Entry>
Returns a vector with mutable entries that match (case insensitive) the supplied text.
Examples
use kpdb::{CompositeKey, Database, Entry, Group}; let mut protonmail = Entry::new(); protonmail.set_title("ProtonMail"); protonmail.set_username("puser"); protonmail.set_password("ppass"); protonmail.set_url("https://mail.protonmail.com"); let mut group = Group::new("Email"); group.add_entry(protonmail); let mut db = Database::new(&CompositeKey::from_password("test")); db.root_group.add_group(group); let result = db.find_entries_mut("Protonm"); assert_eq!(result.len(), 1);
pub fn find_groups<'a, S: Into<String>>(&'a self, name: S) -> Vec<&'a Group>
[src]
Returns a vector with groups that match (case insensitive) the supplied name.
Examples
use kpdb::{CompositeKey, Database, Group}; let group = Group::new("Email"); let mut db = Database::new(&CompositeKey::from_password("test")); db.root_group.add_group(group); let result = db.find_groups("mail"); assert_eq!(result.len(), 1); let result = db.find_groups("unknown"); assert_eq!(result.len(), 0);
pub fn find_groups_mut<'a, S: Into<String>>(
&'a mut self,
name: S
) -> Vec<&'a mut Group>
[src]
&'a mut self,
name: S
) -> Vec<&'a mut Group>
Returns a vector with mutable groups that match (case insensitive) the supplied name.
Examples
use kpdb::{CompositeKey, Database, Group}; let group = Group::new("Email"); let mut db = Database::new(&CompositeKey::from_password("test")); db.root_group.add_group(group); let result = db.find_groups_mut("mail"); assert_eq!(result.len(), 1);
pub fn get_entry<'a>(&'a self, uuid: EntryUuid) -> Option<&'a Entry>
[src]
Returns the entry that matches the UUID or None if not found.
Examples
use kpdb::{CompositeKey, Database, Entry, Group}; let entry = Entry::new(); let entry_uuid = entry.uuid; let mut db = Database::new(&CompositeKey::from_password("test")); assert_eq!(db.get_entry(entry_uuid), None); db.root_group.add_entry(entry.clone()); assert_eq!(db.get_entry(entry_uuid), Some(&entry));
pub fn get_entry_mut<'a>(&'a mut self, uuid: EntryUuid) -> Option<&'a mut Entry>
[src]
Returns the mutable entry that matches the UUID or None if not found.
Examples
use kpdb::{CompositeKey, Database, Entry, Group}; let mut entry = Entry::new(); let entry_uuid = entry.uuid; let mut db = Database::new(&CompositeKey::from_password("test")); assert_eq!(db.get_entry_mut(entry_uuid), None); db.root_group.add_entry(entry.clone()); assert_eq!(db.get_entry_mut(entry_uuid), Some(&mut entry));
pub fn get_group<'a>(&'a self, uuid: GroupUuid) -> Option<&'a Group>
[src]
Returns the group that matches the UUID or None if not found.
Examples
use kpdb::{CompositeKey, Database, Group}; let group = Group::new("Group"); let group_uuid = group.uuid; let mut db = Database::new(&CompositeKey::from_password("test")); assert_eq!(db.get_group(group_uuid), None); db.root_group.add_group(group.clone()); assert_eq!(db.get_group(group_uuid), Some(&group));
pub fn get_group_mut<'a>(&'a mut self, uuid: GroupUuid) -> Option<&'a mut Group>
[src]
Returns the mutable group that matches the UUID or None if not found.
Examples
use kpdb::{CompositeKey, Database, Group}; let mut group = Group::new("Group"); let group_uuid = group.uuid; let mut db = Database::new(&CompositeKey::from_password("test")); assert_eq!(db.get_group(group_uuid), None); db.root_group.add_group(group.clone()); assert_eq!(db.get_group_mut(group_uuid), Some(&mut group));
pub fn open<R: Read>(reader: &mut R, key: &CompositeKey) -> Result<Database>
[src]
Attempts to open an existing database.
Examples
use kpdb::{CompositeKey, Database}; use std::fs::File; let mut file = try!(File::open("passwords.kdbx")); let key = CompositeKey::from_password("password"); let db = try!(Database::open(&mut file, &key));
pub fn save<W: Write>(&self, writer: &mut W) -> Result<()>
[src]
Attempts to save the database.
Examples
use kpdb::{CompositeKey, Database}; use std::fs::File; let key = CompositeKey::from_password("password"); let db = Database::new(&key); let mut file = try!(File::create("new.kdbx")); try!(db.save(&mut file));
Trait Implementations
impl Clone for Database
[src]
impl Debug for Database
[src]
impl PartialEq<Database> for Database
[src]
impl StructuralPartialEq for Database
[src]
Auto Trait Implementations
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,