pub struct Sender<T> { /* private fields */ }
Expand description
The sender half of a oneshot channel. Can transmit a single message with the postage::Sink trait.
Trait Implementations
sourceimpl<T> Sink for Sender<T>
impl<T> Sink for Sender<T>
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
sourcefn blocking_send(
&mut self,
value: Self::Item
) -> Result<(), SendError<Self::Item>> where
Self: Unpin,
fn blocking_send(
&mut self,
value: Self::Item
) -> Result<(), SendError<Self::Item>> where
Self: Unpin,
Sends a message over the channel, blocking the current thread until the message is sent. Read more
sourcefn after<Before>(self, before: Before) -> ChainSink<Before, Self> where
Before: Sink<Item = Self::Item>,
Self: Sized,
fn after<Before>(self, before: Before) -> ChainSink<Before, Self> where
Before: Sink<Item = Self::Item>,
Self: Sized,
Chains two sink implementations. Messages will be transmitted to the argument until it rejects a message. Then messages will be transmitted to self. Read more
Auto Trait Implementations
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T> where
T: Send,
impl<T> Sync for Sender<T> where
T: Send,
impl<T> Unpin for Sender<T>
impl<T> !UnwindSafe for Sender<T>
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