pub struct SecretService<'a> { /* private fields */ }Expand description
Secret Service Struct.
This the main entry point for usage of the library.
Creating a new SecretService will also initialize dbus and negotiate a new cryptographic session (EncryptionType::Plain or EncryptionType::Dh)
Implementations§
Source§impl<'a> SecretService<'a>
impl<'a> SecretService<'a>
Sourcepub fn connect(encryption: EncryptionType) -> Result<SecretService<'a>, Error>
pub fn connect(encryption: EncryptionType) -> Result<SecretService<'a>, Error>
Create a new SecretService instance.
This will initialize its own connection to the session bus.
Sourcepub fn connect_with_existing(
encryption: EncryptionType,
session_conn: Connection,
) -> Result<SecretService<'a>, Error>
pub fn connect_with_existing( encryption: EncryptionType, session_conn: Connection, ) -> Result<SecretService<'a>, Error>
Creates a new SecretService instance, utilizing an existing connection handle.
session_conn should be connected to the session/user message bus.
Sourcepub fn get_all_collections(&'a self) -> Result<Vec<Collection<'a>>, Error>
pub fn get_all_collections(&'a self) -> Result<Vec<Collection<'a>>, Error>
Get all collections
Sourcepub fn get_collection_by_alias(
&'a self,
alias: &str,
) -> Result<Collection<'a>, Error>
pub fn get_collection_by_alias( &'a self, alias: &str, ) -> Result<Collection<'a>, Error>
Get collection by alias.
Most common would be the default alias, but there
is also a specific method for getting the collection
by default alias.
Sourcepub fn get_default_collection(&'a self) -> Result<Collection<'a>, Error>
pub fn get_default_collection(&'a self) -> Result<Collection<'a>, Error>
Get default collection.
(The collection whose alias is default)
Sourcepub fn get_any_collection(&'a self) -> Result<Collection<'a>, Error>
pub fn get_any_collection(&'a self) -> Result<Collection<'a>, Error>
Get any collection.
First tries default collection, then session
collection, then the first collection when it
gets all collections.
Sourcepub fn create_collection(
&'a self,
label: &str,
alias: &str,
) -> Result<Collection<'a>, Error>
pub fn create_collection( &'a self, label: &str, alias: &str, ) -> Result<Collection<'a>, Error>
Creates a new collection with a label and an alias.
Sourcepub fn search_items(
&'a self,
attributes: HashMap<&str, &str>,
) -> Result<SearchItemsResult<Item<'a>>, Error>
pub fn search_items( &'a self, attributes: HashMap<&str, &str>, ) -> Result<SearchItemsResult<Item<'a>>, Error>
Searches all items by attributes
Sourcepub fn unlock_all(&'a self, items: &[&Item<'_>]) -> Result<(), Error>
pub fn unlock_all(&'a self, items: &[&Item<'_>]) -> Result<(), Error>
Unlock all items in a batch