Struct kpdb::Group [] [src]

pub struct Group {
    pub creation_time: DateTime<Utc>,
    pub custom_icon_uuid: Option<CustomIconUuid>,
    pub def_auto_type_sequence: String,
    pub enable_auto_type: Option<bool>,
    pub enable_searching: Option<bool>,
    pub entries: Vec<Entry>,
    pub expires: bool,
    pub expiry_time: DateTime<Utc>,
    pub groups: Vec<Group>,
    pub icon: Icon,
    pub is_expanded: bool,
    pub last_accessed: DateTime<Utc>,
    pub last_modified: DateTime<Utc>,
    pub last_top_visible_entry: EntryUuid,
    pub location_changed: DateTime<Utc>,
    pub name: String,
    pub notes: String,
    pub usage_count: i32,
    pub uuid: GroupUuid,
}

A group in the database.

Fields

The date and time this group was created.

The identifier of this group's custom icon if any.

Default auto-type sequence.

Whether auto-type is enabled.

Whether searching is enabled.

Vector with entries that belong to this group.

Whether this group expires.

The date and time this group will expire if expires is true.

Vector with subgroups of this group.

This group's icon.

Whether this group is expanded.

The date and time this group was last accessed.

The date and time this group was last modified.

The identifier of the last top visible entry.

The date and time the location of this group was changed.

The name of this group.

The notes of this group.

The usage count of this group.

The identifier of this group.

Methods

impl Group
[src]

[src]

Create a new group.

Examples

use kpdb::Group;

let group = Group::new("Websites");

[src]

Add an entry to the current group.

Examples

use kpdb::{Entry, Group};

let mut group = Group::new("group");
let entry = Entry::new();

assert_eq!(group.entries.len(), 0);
group.add_entry(entry.clone());
assert_eq!(group.entries.len(), 1);
assert_eq!(group.entries[0], entry);

[src]

Add a sub group to the current group.

Examples

use kpdb::Group;

let mut root = Group::new("root");
let child = Group::new("child");

assert_eq!(root.groups.len(), 0);
root.add_group(child.clone());
assert_eq!(root.groups.len(), 1);
assert_eq!(root.groups[0], child);

[src]

Returns an iterator over the group and sub groups.

Examples

use kpdb::Group;

let mut root = Group::new("root");
let sub_1 = Group::new("sub_1");
let sub_2 = Group::new("sub_2");
root.add_group(sub_1.clone());
root.add_group(sub_2.clone());

let mut iterator = root.iter();
assert_eq!(iterator.next(), Some(&root));
assert_eq!(iterator.next(), Some(&sub_1));
assert_eq!(iterator.next(), Some(&sub_2));
assert_eq!(iterator.next(), None);

[src]

Returns an iterator that allows modifying each group.

Examples

use kpdb::Group;

let mut root = Group::new("root");
for group in root.iter_mut() {
    group.name = String::from("name");
}
assert_eq!(root.name, "name");

[src]

Remove an entry from the current group.

Examples

use kpdb::{Entry, Group};

let mut group = Group::new("Sample");
let entry = Entry::new();
group.add_entry(entry.clone());
assert_eq!(group.entries.len(), 1);
assert_eq!(group.remove_entry(entry.uuid), Some(entry));
assert_eq!(group.entries.len(), 0);

[src]

Remove a sub group from the current group.

Examples

use kpdb::Group;

let mut parent = Group::new("Parent");
let child = Group::new("Child");
parent.add_group(child.clone());
assert_eq!(parent.groups.len(), 1);
assert_eq!(parent.remove_group(child.uuid), Some(child));
assert_eq!(parent.groups.len(), 0);

Trait Implementations

impl Clone for Group
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Group
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Group
[src]

[src]

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

[src]

This method tests for !=.

impl Default for Group
[src]

[src]

Returns the "default value" for a type. Read more