Struct MessagesClient
pub struct MessagesClient<T> { /* private fields */ }Expand description
Provides methods for sending “unsealed sender” messages.
Implementations§
§impl<T> MessagesClient<T>
impl<T> MessagesClient<T>
pub fn new(inner: T) -> MessagesClient<T>
pub fn with_origin(inner: T, origin: Uri) -> MessagesClient<T>
pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> MessagesClient<InterceptedService<T, F>>
pub fn send_compressed(self, encoding: CompressionEncoding) -> MessagesClient<T>
pub fn send_compressed(self, encoding: CompressionEncoding) -> MessagesClient<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,
) -> MessagesClient<T>
pub fn accept_compressed( self, encoding: CompressionEncoding, ) -> MessagesClient<T>
Enable decompressing responses.
pub fn max_decoding_message_size(self, limit: usize) -> MessagesClient<T>
pub fn max_decoding_message_size(self, limit: usize) -> MessagesClient<T>
Limits the maximum size of a decoded message.
Default: 4MB
pub fn max_encoding_message_size(self, limit: usize) -> MessagesClient<T>
pub fn max_encoding_message_size(self, limit: usize) -> MessagesClient<T>
Limits the maximum size of an encoded message.
Default: usize::MAX
pub async fn send_message(
&mut self,
request: impl IntoRequest<SendAuthenticatedSenderMessageRequest>,
) -> Result<Response<SendMessageAuthenticatedSenderResponse>, Status>
pub async fn send_message( &mut self, request: impl IntoRequest<SendAuthenticatedSenderMessageRequest>, ) -> Result<Response<SendMessageAuthenticatedSenderResponse>, Status>
Sends an “unsealed sender” message to all devices linked to a single destination account.
The destination account must not be the same as the authenticated caller.
Callers should use SendSyncMessage to send messages to themselves.
pub async fn send_sync_message(
&mut self,
request: impl IntoRequest<SendSyncMessageRequest>,
) -> Result<Response<SendMessageAuthenticatedSenderResponse>, Status>
pub async fn send_sync_message( &mut self, request: impl IntoRequest<SendSyncMessageRequest>, ) -> Result<Response<SendMessageAuthenticatedSenderResponse>, Status>
Sends a “sync” message to all other devices linked to the authenticated sender’s account.
pub async fn get_messages(
&mut self,
request: impl IntoStreamingRequest<Message = GetMessagesRequest>,
) -> Result<Response<Streaming<GetMessagesResponse>>, Status>
pub async fn get_messages( &mut self, request: impl IntoStreamingRequest<Message = GetMessagesRequest>, ) -> Result<Response<Streaming<GetMessagesResponse>>, Status>
Retrieve messages for the authenticated device. When the caller receives and successfully processes a message returned in a GetMessagesResponse they must send a corresponding GetMessagesRequest indicating that the message has been processed (an ack). Acks should only be sent for messages delivered via the currently open RPC.
Only the first GetMessagesRequest may contain request parameters that configure the stream. The first request must not contain an ack.
The server will keep the stream open until the client disconnects. Only one GetMessages stream may be open per device. If a second GetMessages stream is opened, the server may terminate any of the streams with a STREAM_CLOSED error reason. A GetMessagesStreamClosed message will be present in the error details.
pub async fn report_message(
&mut self,
request: impl IntoRequest<ReportMessageRequest>,
) -> Result<Response<ReportMessageResponse>, Status>
pub async fn report_message( &mut self, request: impl IntoRequest<ReportMessageRequest>, ) -> Result<Response<ReportMessageResponse>, Status>
Reports a message as spam.
Trait Implementations§
§impl<T> Clone for MessagesClient<T>where
T: Clone,
impl<T> Clone for MessagesClient<T>where
T: Clone,
§fn clone(&self) -> MessagesClient<T>
fn clone(&self) -> MessagesClient<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 MessagesClient<T>
impl<T> RefUnwindSafe for MessagesClient<T>where
T: RefUnwindSafe,
impl<T> Send for MessagesClient<T>where
T: Send,
impl<T> Sync for MessagesClient<T>where
T: Sync,
impl<T> Unpin for MessagesClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for MessagesClient<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for MessagesClient<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].