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 async fn connect(
encryption: EncryptionType,
) -> Result<SecretService<'a>, Error>
pub async fn connect( encryption: EncryptionType, ) -> Result<SecretService<'a>, Error>
Create a new SecretService instance.
This will initialize its own connection to the session bus.
Sourcepub async fn connect_with_existing(
encryption: EncryptionType,
session_conn: Connection,
) -> Result<SecretService<'a>, Error>
pub async 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 async fn get_all_collections(&self) -> Result<Vec<Collection<'_>>, Error>
pub async fn get_all_collections(&self) -> Result<Vec<Collection<'_>>, Error>
Get all collections
Sourcepub async fn get_collection_by_alias(
&self,
alias: &str,
) -> Result<Collection<'_>, Error>
pub async fn get_collection_by_alias( &self, alias: &str, ) -> Result<Collection<'_>, 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 async fn get_default_collection(&self) -> Result<Collection<'_>, Error>
pub async fn get_default_collection(&self) -> Result<Collection<'_>, Error>
Get default collection.
(The collection whos alias is default)
Sourcepub async fn get_any_collection(&self) -> Result<Collection<'_>, Error>
pub async fn get_any_collection(&self) -> Result<Collection<'_>, Error>
Get any collection.
First tries default collection, then session
collection, then the first collection when it
gets all collections.
Sourcepub async fn create_collection(
&self,
label: &str,
alias: &str,
) -> Result<Collection<'_>, Error>
pub async fn create_collection( &self, label: &str, alias: &str, ) -> Result<Collection<'_>, Error>
Creates a new collection with a label and an alias.
Sourcepub async fn search_items(
&self,
attributes: HashMap<&str, &str>,
) -> Result<SearchItemsResult<Item<'_>>, Error>
pub async fn search_items( &self, attributes: HashMap<&str, &str>, ) -> Result<SearchItemsResult<Item<'_>>, Error>
Searches all items by attributes
Sourcepub async fn unlock_all(&self, items: &[&Item<'_>]) -> Result<(), Error>
pub async fn unlock_all(&self, items: &[&Item<'_>]) -> Result<(), Error>
Unlock all items in a batch