[−][src]Trait postage::Sink
A sink which can asynchronously accept messages, and at some point may refuse to accept any further messages.
Associated Types
Loading content...Required methods
pub fn poll_send(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
Attempts to accept the message, without blocking.
Returns PollSend::Ready, PollSend::Pending(value), or PollSend::Rejected(value)
Provided methods
pub fn send(&mut self, value: Self::Item) -> SendFuture<'_, Self>ⓘ
[src]
Attempts to send a message into the sink.
Returns Ok(())
if the value was accepted.
Returns Err(SendError(value))
if the sink rejected the message.
pub fn try_send(
&mut self,
value: Self::Item
) -> Result<(), TrySendError<Self::Item>> where
Self: Unpin,
[src]
&mut self,
value: Self::Item
) -> Result<(), TrySendError<Self::Item>> where
Self: Unpin,
Attempts to send a message over the sink, without blocking.
Returns Ok(())
if the value was accepted.
Returns Err(TrySendError::Pending(value))
if the send would have blocked
Returns Err(TrySendError::Rejected(value))
if the value was rejected
pub fn after<Before>(self, before: Before) -> SinkChain<Before, Self> where
Before: Sink<Item = Self::Item>,
Self: Sized,
[src]
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.
pub fn filter<Filter>(self, filter: Filter) -> SinkFilter<Filter, Self> where
Filter: FnMut(&Self::Item) -> bool,
Self: Sized,
[src]
Filter: FnMut(&Self::Item) -> bool,
Self: Sized,
Filters messages, forwarding them to the sink if the filter returns true
pub fn log(self, level: Level) -> SinkLog<Self> where
Self: Sized,
Self::Item: Debug,
[src]
Self: Sized,
Self::Item: Debug,
Logs messages that are accepted by the sink using the Debug trait, at the provided log level.
Requires the logging
feature
Implementations on Foreign Types
impl<S: ?Sized> Sink for &mut S where
S: Sink + Unpin,
[src]
S: Sink + Unpin,
type Item = S::Item
pub fn poll_send(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
[src]
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
impl<P, S: ?Sized> Sink for Pin<P> where
P: DerefMut<Target = S> + Unpin,
S: Sink + Unpin,
[src]
P: DerefMut<Target = S> + Unpin,
S: Sink + Unpin,
type Item = <S as Sink>::Item
pub fn poll_send(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
Implementors
impl Sink for postage::barrier::Sender
[src]
type Item = ()
pub fn poll_send(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
_value: ()
) -> PollSend<Self::Item>
[src]
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
_value: ()
) -> PollSend<Self::Item>
impl<T> Sink for postage::broadcast::Sender<T> where
T: Clone,
[src]
T: Clone,
type Item = T
pub fn poll_send(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
impl<T> Sink for postage::mpsc::Sender<T>
[src]
type Item = T
pub fn poll_send(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
impl<T> Sink for postage::oneshot::Sender<T>
[src]
type Item = T
pub fn poll_send(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>
[src]
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
value: Self::Item
) -> PollSend<Self::Item>