Struct Database

Source
pub struct Database {
Show 41 fields 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 entries: EntriesMap, pub entry_templates_group_changed: DateTime<Utc>, pub entry_templates_group_uuid: GroupUuid, pub generator: String, pub group_uuid: Option<GroupUuid>, pub groups: GroupsMap, pub history: HistoryMap, 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,
}
Expand description

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.

§entries: EntriesMap

Map with entries.

§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.

§group_uuid: Option<GroupUuid>

The identifier of the root group.

§groups: GroupsMap

Map with groups.

§history: HistoryMap

Map with history entries.

§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.

Implementations§

Source§

impl Database

Source

pub fn new(key: &CompositeKey) -> Database

Create a new database.

§Examples
use kpdb::{CompositeKey, Database};

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

pub fn open<R: Read>(reader: &mut R, key: &CompositeKey) -> Result<Database>

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

pub fn save<W: Write>(&self, writer: &mut W) -> Result<()>

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§

Source§

impl Clone for Database

Source§

fn clone(&self) -> Database

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Database

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Database

Source§

fn eq(&self, other: &Database) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Database

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.