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
sourceimpl<T> Sink for Sender<T> where
T: Clone,
impl<T> Sink for Sender<T> where
T: Clone,
type Item = T
sourcefn 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
sourcefn send(&mut self, value: Self::Item) -> SendFuture<'_, Self>ⓘNotable traits for SendFuture<'s, S>impl<'s, S> Future for SendFuture<'s, S> where
S: Sink + Unpin + ?Sized, type Output = Result<(), SendError<S::Item>>;
fn send(&mut self, value: Self::Item) -> SendFuture<'_, Self>ⓘNotable traits for SendFuture<'s, S>impl<'s, S> Future for SendFuture<'s, S> where
S: Sink + Unpin + ?Sized, type Output = Result<(), SendError<S::Item>>;
S: Sink + Unpin + ?Sized, type Output = Result<(), SendError<S::Item>>;
Attempts to send a message into the sink. Read more
sourcefn 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
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more