pub struct Sender<T> { /* private fields */ }Expand description
A broadcast sender that can be used with the postage::Sink trait. Can be cloned.
The sender task is suspended when the internal buffer is filled.
Note: no implementation of the futures::Sink trait is provided for the broadcast Sender.
Implementations§
Trait Implementations§
Source§impl<T> Sink for Sender<T>where
T: Clone,
impl<T> Sink for Sender<T>where
T: Clone,
type Item = T
Source§fn poll_send(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item,
) -> PollSend<Self::Item>
fn poll_send( self: Pin<&mut Self>, cx: &mut Context<'_>, value: Self::Item, ) -> PollSend<Self::Item>
Attempts to accept the message, without blocking. Read more
Source§fn send(&mut self, value: Self::Item) -> SendFuture<'_, Self> ⓘ
fn send(&mut self, value: Self::Item) -> SendFuture<'_, Self> ⓘ
Attempts to send a message into the sink. Read more
Source§fn try_send(
&mut self,
value: Self::Item,
) -> Result<(), TrySendError<Self::Item>>where
Self: Unpin,
fn try_send(
&mut self,
value: Self::Item,
) -> Result<(), TrySendError<Self::Item>>where
Self: Unpin,
Attempts to send a message over the sink, without blocking. Read more
impl<T: Send> Send for Sender<T>
impl<T: Send> Sync for Sender<T>
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> UnsafeUnpin for Sender<T>
impl<T> !UnwindSafe for Sender<T>
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