Struct DevicesClient
pub struct DevicesClient<T> { /* private fields */ }Expand description
Provides methods for working with devices attached to a Signal account.
Implementations§
§impl<T> DevicesClient<T>
impl<T> DevicesClient<T>
pub fn new(inner: T) -> DevicesClient<T>
pub fn with_origin(inner: T, origin: Uri) -> DevicesClient<T>
pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> DevicesClient<InterceptedService<T, F>>
pub fn send_compressed(self, encoding: CompressionEncoding) -> DevicesClient<T>
pub fn send_compressed(self, encoding: CompressionEncoding) -> DevicesClient<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,
) -> DevicesClient<T>
pub fn accept_compressed( self, encoding: CompressionEncoding, ) -> DevicesClient<T>
Enable decompressing responses.
pub fn max_decoding_message_size(self, limit: usize) -> DevicesClient<T>
pub fn max_decoding_message_size(self, limit: usize) -> DevicesClient<T>
Limits the maximum size of a decoded message.
Default: 4MB
pub fn max_encoding_message_size(self, limit: usize) -> DevicesClient<T>
pub fn max_encoding_message_size(self, limit: usize) -> DevicesClient<T>
Limits the maximum size of an encoded message.
Default: usize::MAX
pub async fn get_devices(
&mut self,
request: impl IntoRequest<GetDevicesRequest>,
) -> Result<Response<GetDevicesResponse>, Status>
pub async fn get_devices( &mut self, request: impl IntoRequest<GetDevicesRequest>, ) -> Result<Response<GetDevicesResponse>, Status>
Returns a list of devices associated with the caller’s account.
pub async fn remove_device(
&mut self,
request: impl IntoRequest<RemoveDeviceRequest>,
) -> Result<Response<RemoveDeviceResponse>, Status>
pub async fn remove_device( &mut self, request: impl IntoRequest<RemoveDeviceRequest>, ) -> Result<Response<RemoveDeviceResponse>, Status>
Removes a linked device from the caller’s account.
Linked devices may only remove themselves. Primary devices may remove any device other than themselves.
pub async fn set_device_name(
&mut self,
request: impl IntoRequest<SetDeviceNameRequest>,
) -> Result<Response<SetDeviceNameResponse>, Status>
pub async fn set_device_name( &mut self, request: impl IntoRequest<SetDeviceNameRequest>, ) -> Result<Response<SetDeviceNameResponse>, Status>
Sets the encrypted human-readable name for a specific devices. Primary devices may change the name of any device associated with their account, but linked devices may only change their own name. The response will indicate if the target device was not found.
pub async fn set_push_token(
&mut self,
request: impl IntoRequest<SetPushTokenRequest>,
) -> Result<Response<SetPushTokenResponse>, Status>
pub async fn set_push_token( &mut self, request: impl IntoRequest<SetPushTokenRequest>, ) -> Result<Response<SetPushTokenResponse>, Status>
Sets the token(s) the server should use to send new message notifications to the authenticated device.
pub async fn clear_push_token(
&mut self,
request: impl IntoRequest<ClearPushTokenRequest>,
) -> Result<Response<ClearPushTokenResponse>, Status>
pub async fn clear_push_token( &mut self, request: impl IntoRequest<ClearPushTokenRequest>, ) -> Result<Response<ClearPushTokenResponse>, Status>
Removes any push tokens associated with the authenticated device. After calling this method, the server will assume that the authenticated device will periodically poll for new messages.
pub async fn set_capabilities(
&mut self,
request: impl IntoRequest<SetCapabilitiesRequest>,
) -> Result<Response<SetCapabilitiesResponse>, Status>
pub async fn set_capabilities( &mut self, request: impl IntoRequest<SetCapabilitiesRequest>, ) -> Result<Response<SetCapabilitiesResponse>, Status>
Declares that the authenticated device supports certain features.
Trait Implementations§
§impl<T> Clone for DevicesClient<T>where
T: Clone,
impl<T> Clone for DevicesClient<T>where
T: Clone,
§fn clone(&self) -> DevicesClient<T>
fn clone(&self) -> DevicesClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for DevicesClient<T>
impl<T> RefUnwindSafe for DevicesClient<T>where
T: RefUnwindSafe,
impl<T> Send for DevicesClient<T>where
T: Send,
impl<T> Sync for DevicesClient<T>where
T: Sync,
impl<T> Unpin for DevicesClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for DevicesClient<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for DevicesClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].