Skip to main content

CiphersClient

Struct CiphersClient 

Source
pub struct CiphersClient(pub(crate) CiphersClient);

Tuple Fields§

§0: CiphersClient

Implementations§

Source§

impl CiphersClient

Source

pub async fn encrypt( &self, cipher_view: CipherView, ) -> Result<EncryptionContext>

Encrypt cipher

Source

pub async fn decrypt(&self, cipher: Cipher) -> Result<CipherView>

Decrypt cipher

Source

pub async fn decrypt_list( &self, ciphers: Vec<Cipher>, ) -> Result<Vec<CipherListView>>

Decrypt cipher list

Source

pub async fn encrypt_list( &self, cipher_views: Vec<CipherView>, ) -> Result<Vec<EncryptionContext>>

Encrypt a list of cipher views. Fails if any cipher fails to encrypt.

Source

pub async fn decrypt_list_with_failures( &self, ciphers: Vec<Cipher>, ) -> Result<DecryptCipherListResult>

Decrypt cipher list with failures Returns both successfully decrypted ciphers and any that failed to decrypt

Source

pub fn move_to_organization( &self, cipher: CipherView, organization_id: OrganizationId, ) -> Result<CipherView>

Move a cipher to an organization, reencrypting the cipher key if necessary

Source

pub async fn prepare_ciphers_for_bulk_share( &self, ciphers: Vec<CipherView>, organization_id: OrganizationId, collection_ids: Vec<CollectionId>, ) -> Result<Vec<EncryptionContext>>

Prepare ciphers for bulk share to an organization

Source

pub async fn decrypt_list_full_with_failures( &self, ciphers: Vec<Cipher>, ) -> Result<DecryptCipherResult>

Decrypt full cipher list Returns both successfully fully decrypted ciphers and any that failed to decrypt

Source

pub async fn create(&self, request: CipherCreateRequest) -> Result<CipherView>

Create a new cipher and save it to the server and local state

Source

pub async fn edit(&self, request: CipherEditRequest) -> Result<CipherView>

Edit an existing cipher and save it to the server and local state

Source

pub async fn edit_gated( &self, request: CipherEditRequest, original_cipher_view: CipherView, ) -> Result<CipherView>

Edit a PAM-gated cipher whose secrets were revealed under an active lease.

Pass the full view obtained from the lease-authorised read as original_cipher_view. The returned view is partial, since the server withholds secrets from a gated write-return.

Source

pub async fn edit_partial( &self, request: CipherPartialEditRequest, ) -> Result<CipherView>

Update only the folder and favorite status of a cipher, for users without edit permission

Source

pub async fn update_collection( &self, cipher_id: CipherId, collection_ids: Vec<CollectionId>, ) -> Result<CipherView>

Update the collections a cipher belongs to

Source

pub async fn get(&self, cipher_id: CipherId) -> Result<CipherView>

Get a cipher from local state and decrypt it

Source

pub async fn list(&self) -> Result<DecryptCipherListResult>

Get all ciphers from local state and decrypt them to list views, returning both successes and failures

Source

pub async fn get_all(&self) -> Result<DecryptCipherResult>

Get all ciphers from local state and fully decrypt them, returning both successes and failures

Source

pub async fn delete(&self, cipher_id: CipherId) -> Result<()>

Permanently delete a cipher from the server and local state

Source

pub async fn delete_many( &self, cipher_ids: Vec<CipherId>, organization_id: Option<OrganizationId>, ) -> Result<()>

Permanently delete multiple ciphers from the server and local state

Source

pub async fn soft_delete(&self, cipher_id: CipherId) -> Result<()>

Move a cipher to the trash

Source

pub async fn soft_delete_many( &self, cipher_ids: Vec<CipherId>, organization_id: Option<OrganizationId>, ) -> Result<()>

Move multiple ciphers to the trash

Source

pub async fn restore(&self, cipher_id: CipherId) -> Result<CipherView>

Restore a cipher from the trash

Source

pub async fn restore_many( &self, cipher_ids: Vec<CipherId>, ) -> Result<DecryptCipherListResult>

Restore multiple ciphers from the trash

Source

pub async fn share_cipher( &self, cipher_view: CipherView, organization_id: OrganizationId, collection_ids: Vec<CollectionId>, original_cipher_view: Option<CipherView>, ) -> Result<CipherView>

Share a cipher with an organization, re-encrypting it with the organization key

Source

pub async fn share_ciphers_bulk( &self, cipher_views: Vec<CipherView>, organization_id: OrganizationId, collection_ids: Vec<CollectionId>, ) -> Result<Vec<CipherView>>

Share multiple ciphers with an organization, re-encrypting them with the organization key

Source

pub async fn move_many( &self, cipher_ids: Vec<CipherId>, folder_id: Option<FolderId>, ) -> Result<()>

Move multiple ciphers to a folder, or out of any folder when folder_id is None

Source

pub async fn bulk_update_collections( &self, organization_id: OrganizationId, cipher_ids: Vec<CipherId>, collection_ids: Vec<CollectionId>, remove_collections: bool, ) -> Result<()>

Add or remove collections for multiple organization ciphers

Trait Implementations§

Source§

impl<UT> LiftRef<UT> for CiphersClient

Source§

impl<UT> LowerError<UT> for CiphersClient

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for CiphersClient

Source§

type ReturnType = <Arc<CiphersClient> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for CiphersClient

Source§

const TYPE_ID_META: MetadataBuffer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T> ⓘ
where T: Sized,

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T> ⓘ

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T> ⓘ

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self> ⓘ

Get a clone of the Arc<> using a “borrowed” handle. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more