bitwarden_uniffi/vault/
collections.rs

1use bitwarden_vault::{Collection, CollectionView};
2
3use crate::{error::Error, Result};
4
5#[allow(missing_docs)]
6#[derive(uniffi::Object)]
7pub struct CollectionsClient(pub(crate) bitwarden_vault::CollectionsClient);
8
9#[uniffi::export]
10impl CollectionsClient {
11    /// Decrypt collection
12    pub fn decrypt(&self, collection: Collection) -> Result<CollectionView> {
13        Ok(self.0.decrypt(collection).map_err(Error::Decrypt)?)
14    }
15
16    /// Decrypt collection list
17    pub fn decrypt_list(&self, collections: Vec<Collection>) -> Result<Vec<CollectionView>> {
18        Ok(self.0.decrypt_list(collections).map_err(Error::Decrypt)?)
19    }
20}