Struct kpdb::Database [] [src]

pub struct Database {
    pub comment: Option<Comment>,
    pub composite_key: CompositeKey,
    pub compression: Compression,
    pub db_type: DbType,
    pub master_cipher: MasterCipher,
    pub stream_cipher: StreamCipher,
    pub transform_rounds: TransformRounds,
    pub version: Version,
    pub binaries: BinariesMap,
    pub color: Option<Color>,
    pub custom_data: CustomDataMap,
    pub custom_icons: CustomIconsMap,
    pub def_username: String,
    pub def_username_changed: DateTime<Utc>,
    pub description: String,
    pub description_changed: DateTime<Utc>,
    pub entry_templates_group_changed: DateTime<Utc>,
    pub entry_templates_group_uuid: GroupUuid,
    pub generator: String,
    pub history_max_items: i32,
    pub history_max_size: i32,
    pub last_selected_group: GroupUuid,
    pub last_top_visible_group: GroupUuid,
    pub maintenance_history_days: i32,
    pub master_key_change_force: i32,
    pub master_key_change_rec: i32,
    pub master_key_changed: DateTime<Utc>,
    pub name: String,
    pub name_changed: DateTime<Utc>,
    pub protect_notes: bool,
    pub protect_password: bool,
    pub protect_title: bool,
    pub protect_url: bool,
    pub protect_username: bool,
    pub recycle_bin_changed: DateTime<Utc>,
    pub recycle_bin_enabled: bool,
    pub recycle_bin_uuid: GroupUuid,
    pub root_group: Group,
}

The KeePass database.

Fields

Content of the comment header.

Composite key.

Compression algorithm.

Type of the database.

Master encryption algorithm.

Stream encryption algorithm (e.g. passwords).

Number of times the composite key must be transformed.

The database version.

Map with binary data.

Optional color.

Map with custom data.

Map with custom icons.

Default username for new entries.

The date and time the default username was changed.

Description of this database.

The date and time the description was changed.

The date and time the entry templates group was changed.

The identifier of the group containing entry templates.

Name of the generator.

Maximum number of history items.

Maximum size of the history data.

The identifier of the last selected group.

The identifier of the last top visible group.

Number of days until history entries are being deleted.

The date and time the master key was changed.

Name of this database.

The date and time the name was changed.

Whether notes must be protected.

Whether passwords must be protected.

Whether titles must be protected.

Whether URL's must be protected.

Whether usernames must be protected.

The date and time the recycle bin was changed.

Whether the recycle bin is enabled.

The identifier of the recycle bin.

The root group.

Methods

impl Database
[src]

[src]

Create a new database.

Examples

use kpdb::{CompositeKey, Database};

let key = CompositeKey::from_password("password");
let db = Database::new(&key);

[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);

[src]

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);

[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);

[src]

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);

[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));

[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));

[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));

[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));

[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));

[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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Database
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Database
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.