Struct keepass_ng::Group
source · pub struct Group { /* private fields */ }Expand description
A database group with child groups and entries
Implementations§
source§impl Group
impl Group
pub fn new(name: &str) -> Group
pub fn get_children(&self) -> Vec<NodePtr>
pub fn set_name(&mut self, name: &str)
pub fn add_child(&mut self, child: NodePtr, index: usize)
sourcepub fn get(root: &NodePtr, path: &[&str]) -> Option<NodePtr>
pub fn get(root: &NodePtr, path: &[&str]) -> Option<NodePtr>
Recursively get a Group or Entry reference by specifying a path relative to the current Group
use keepass::{
db::{Entry, Group},
Database, DatabaseKey,
};
use std::fs::File;
let mut file = File::open("tests/resources/test_db_with_password.kdbx").unwrap();
let db = Database::open(&mut file, DatabaseKey::new().with_password("demopass")).unwrap();
if let Some(e) = Group::get(&db.root, &["General", "Sample Entry #2"]) {
if let Some(e) = e.borrow().as_any().downcast_ref::<Entry>() {
println!("User: {}", e.get_username().unwrap());
}
}pub fn entries(&self) -> Vec<NodePtr>
pub fn groups(&self) -> Vec<NodePtr>
Trait Implementations§
source§impl Node for Group
impl Node for Group
fn duplicate(&self) -> NodePtr
fn get_uuid(&self) -> Uuid
fn set_uuid(&mut self, uuid: Uuid)
fn get_title(&self) -> Option<&str>
fn set_title(&mut self, title: Option<&str>)
fn get_notes(&self) -> Option<&str>
fn set_notes(&mut self, notes: Option<&str>)
fn get_icon_id(&self) -> Option<IconId>
fn set_icon_id(&mut self, icon_id: Option<IconId>)
fn get_custom_icon_uuid(&self) -> Option<Uuid>
fn get_times(&self) -> &Times
fn get_times_mut(&mut self) -> &mut Times
fn get_parent(&self) -> Option<Uuid>
fn set_parent(&mut self, parent: Option<Uuid>)
source§impl PartialEq for Group
impl PartialEq for Group
impl Eq for Group
Auto Trait Implementations§
impl Freeze for Group
impl !RefUnwindSafe for Group
impl !Send for Group
impl !Sync for Group
impl Unpin for Group
impl !UnwindSafe for Group
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)