Skip to main content

AccountsClient

Struct AccountsClient 

pub struct AccountsClient<T> { /* private fields */ }
Expand description

Provides methods for working with Signal accounts.

Implementations§

§

impl<T> AccountsClient<T>
where T: GrpcService<Body>, <T as GrpcService<Body>>::Error: Into<Box<dyn Error + Send + Sync>>, <T as GrpcService<Body>>::ResponseBody: Body<Data = Bytes> + Send + 'static, <<T as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Send + Sync>> + Send,

pub fn new(inner: T) -> AccountsClient<T>

pub fn with_origin(inner: T, origin: Uri) -> AccountsClient<T>

pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> AccountsClient<InterceptedService<T, F>>
where F: Interceptor, <T as GrpcService<Body>>::ResponseBody: Default, T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>, <T as Service<Request<Body>>>::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,

pub fn send_compressed(self, encoding: CompressionEncoding) -> AccountsClient<T>

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

pub fn accept_compressed( self, encoding: CompressionEncoding, ) -> AccountsClient<T>

Enable decompressing responses.

pub fn max_decoding_message_size(self, limit: usize) -> AccountsClient<T>

Limits the maximum size of a decoded message.

Default: 4MB

pub fn max_encoding_message_size(self, limit: usize) -> AccountsClient<T>

Limits the maximum size of an encoded message.

Default: usize::MAX

pub async fn get_account_identity( &mut self, request: impl IntoRequest<GetAccountIdentityRequest>, ) -> Result<Response<GetAccountIdentityResponse>, Status>

Returns basic identifiers for the authenticated account.

pub async fn get_entitlements( &mut self, request: impl IntoRequest<GetEntitlementsRequest>, ) -> Result<Response<GetEntitlementsResponse>, Status>

Returns entitlements for the authenticated account.

pub async fn delete_account( &mut self, request: impl IntoRequest<DeleteAccountRequest>, ) -> Result<Response<DeleteAccountResponse>, Status>

Deletes the authenticated account, purging all associated data in the process.

pub async fn set_registration_lock( &mut self, request: impl IntoRequest<SetRegistrationLockRequest>, ) -> Result<Response<SetRegistrationLockResponse>, Status>

Sets the registration lock secret for the authenticated account. To remove a registration lock, please use ClearRegistrationLock.

pub async fn clear_registration_lock( &mut self, request: impl IntoRequest<ClearRegistrationLockRequest>, ) -> Result<Response<ClearRegistrationLockResponse>, Status>

Removes any registration lock credentials from the authenticated account.

pub async fn reserve_username_hash( &mut self, request: impl IntoRequest<ReserveUsernameHashRequest>, ) -> Result<Response<ReserveUsernameHashResponse>, Status>

Attempts to reserve one of multiple given username hashes. Reserved usernames may be claimed later via ConfirmUsernameHash.

pub async fn confirm_username_hash( &mut self, request: impl IntoRequest<ConfirmUsernameHashRequest>, ) -> Result<Response<ConfirmUsernameHashResponse>, Status>

Sets the username hash/encrypted username to a previously-reserved value (see ReserveUsernameHash).

pub async fn delete_username_hash( &mut self, request: impl IntoRequest<DeleteUsernameHashRequest>, ) -> Result<Response<DeleteUsernameHashResponse>, Status>

Clears the current username hash, ciphertext, and link for the authenticated user.

Associates the given username ciphertext with the account, replacing any previously stored ciphertext. A new link handle will optionally be created, and the link handle to use will be returned in any event.

Clears any username link associated with the authenticated account.

pub async fn configure_unidentified_access( &mut self, request: impl IntoRequest<ConfigureUnidentifiedAccessRequest>, ) -> Result<Response<ConfigureUnidentifiedAccessResponse>, Status>

Configures “unidentified access” keys and preferences for the authenticated account. Other users permitted to interact with this account anonymously may take actions like fetching pre-keys and profiles for this account or sending sealed-sender messages without providing identifying credentials.

pub async fn set_discoverable_by_phone_number( &mut self, request: impl IntoRequest<SetDiscoverableByPhoneNumberRequest>, ) -> Result<Response<SetDiscoverableByPhoneNumberResponse>, Status>

Sets whether the authenticated account may be discovered by phone number via the Contact Discovery Service (CDS).

pub async fn set_registration_recovery_password( &mut self, request: impl IntoRequest<SetRegistrationRecoveryPasswordRequest>, ) -> Result<Response<SetRegistrationRecoveryPasswordResponse>, Status>

Sets the registration recovery password for the authenticated account.

pub async fn set_zk_credential_key( &mut self, request: impl IntoRequest<SetZkCredentialKeyRequest>, ) -> Result<Response<SetZkCredentialKeyResponse>, Status>

Store a public key used to issue and verify zero-knowledge (anonymous) credentials for the account.

pub async fn change_number( &mut self, request: impl IntoRequest<ChangeNumberRequest>, ) -> Result<Response<ChangeNumberResponse>, Status>

Changes the phone number associated with the authenticated account.

pub async fn get_account_data_report( &mut self, request: impl IntoRequest<GetAccountDataReportRequest>, ) -> Result<Response<GetAccountDataReportResponse>, Status>

Produces a report of non-ephemeral account data stored by the service

pub async fn get_capabilities( &mut self, request: impl IntoRequest<GetCapabilitiesRequest>, ) -> Result<Response<GetCapabilitiesResponse>, Status>

Gets the capabilities for the authenticated account.

pub async fn generate_totp_key( &mut self, request: impl IntoRequest<GenerateTotpKeyRequest>, ) -> Result<Response<GenerateTotpKeyResponse>, Status>

Generates and stores a pending TOTP key for the authenticated account. To “activate” the key, callers must call the ConfirmTotpKey endpoint.

TOTP keys may only be generated for accounts without phone numbers.

pub async fn confirm_totp_key( &mut self, request: impl IntoRequest<ConfirmTotpKeyRequest>, ) -> Result<Response<ConfirmTotpKeyResponse>, Status>

Confirms that the caller has stored and can derive one-time passwords from a pending TOTP key generated via GenerateTotpKey and stores/activates the key for the caller’s account

TOTP keys may only be generated for accounts without phone numbers.

pub async fn start_web_authn_registration( &mut self, request: impl IntoRequest<StartWebAuthnRegistrationRequest>, ) -> Result<Response<StartWebAuthnRegistrationResponse>, Status>

Returns parameters for initiating a WebAuthn registration ceremony

WebAuthn credentials may only be registered for accounts without phone numbers

pub async fn finish_web_authn_registration( &mut self, request: impl IntoRequest<FinishWebAuthnRegistrationRequest>, ) -> Result<Response<FinishWebAuthnRegistrationResponse>, Status>

Concludes a WebAuthn registration ceremony to add a passkey to the authenticated account

WebAuthn credentials may only be registered for accounts without phone numbers

pub async fn list_mfa_keys( &mut self, request: impl IntoRequest<ListMfaKeysRequest>, ) -> Result<Response<ListMfaKeysResponse>, Status>

Returns a list of confirmed MFA keys for the authenticated account

pub async fn set_mfa_key_metadata( &mut self, request: impl IntoRequest<SetMfaKeyMetadataRequest>, ) -> Result<Response<SetMfaKeyMetadataResponse>, Status>

Updates encrypted, user-supplied metadata (e.g. a human-readable name and creation timestamp) for an existing, confirmed MFA key

pub async fn remove_mfa_key( &mut self, request: impl IntoRequest<RemoveMfaKeyRequest>, ) -> Result<Response<RemoveMfaKeyResponse>, Status>

Removes an MFA key from the authenticated account

pub async fn start_mfa_verification( &mut self, request: impl IntoRequest<StartMfaVerificationRequest>, ) -> Result<Response<StartMfaVerificationResponse>, Status>

Requests the parameters needed to verify with an MFA factor associated with this account.

pub async fn finish_mfa_verification( &mut self, request: impl IntoRequest<FinishMfaVerificationRequest>, ) -> Result<Response<FinishMfaVerificationResponse>, Status>

Attemps to verify an MFA factor associated with this account.

Trait Implementations§

§

impl<T> Clone for AccountsClient<T>
where T: Clone,

§

fn clone(&self) -> AccountsClient<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for AccountsClient<T>
where T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for AccountsClient<T>

§

impl<T> RefUnwindSafe for AccountsClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for AccountsClient<T>
where T: Send,

§

impl<T> Sync for AccountsClient<T>
where T: Sync,

§

impl<T> Unpin for AccountsClient<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for AccountsClient<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for AccountsClient<T>
where T: UnwindSafe,

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
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,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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> Instrument for T

Source§

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

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

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> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, !>

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.
§

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
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

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

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