pub struct Sender<P: Array> { /* private fields */ }Expand description
Sender is the mechanism used to send arbitrary bytes to a set of recipients over a pre-defined channel.
Trait Implementations§
Source§impl<P: Array> Sender for Sender<P>
impl<P: Array> Sender for Sender<P>
Source§async fn send(
&mut self,
recipients: Recipients<Self::PublicKey>,
message: Bytes,
priority: bool,
) -> Result<Vec<Self::PublicKey>, Error>
async fn send( &mut self, recipients: Recipients<Self::PublicKey>, message: Bytes, priority: bool, ) -> Result<Vec<Self::PublicKey>, Error>
Sends a message to a set of recipients.
§Offline Recipients
If a recipient is offline at the time a message is sent, the message will be dropped. It is up to the application to handle retries (if necessary).
§Parameters
recipients- The set of recipients to send the message to.message- The message to send.priority- Whether the message should be sent with priority (across all channels).
§Returns
If the message can be compressed (if enabled) and the message is < max_size, The set of recipients
that the message was sent to. Note, a successful send does not mean that the recipient will
receive the message (connection may no longer be active and we may not know that yet).
Auto Trait Implementations§
impl<P> Freeze for Sender<P>
impl<P> !RefUnwindSafe for Sender<P>
impl<P> Send for Sender<P>
impl<P> Sync for Sender<P>
impl<P> Unpin for Sender<P>
impl<P> !UnwindSafe for Sender<P>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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>
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 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>
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