Skip to main content

ChannelOutputSink

Type Alias ChannelOutputSink 

Source
pub(super) type ChannelOutputSink = SinkBlocker<Box<dyn Sink<AnyChanCell, Error = Error> + Send + Unpin + 'static>, CountingPolicy>;
Expand description

Type used by a channel reactor to send cells to the network.

Aliased Type§

pub(super) struct ChannelOutputSink {
    inner: Box<dyn Sink<ChanCell<AnyChanMsg>, Error = Error> + Unpin + Send>,
    policy: CountingPolicy,
    waker: Option<Waker>,
}

Fields§

§inner: Box<dyn Sink<ChanCell<AnyChanMsg>, Error = Error> + Unpin + Send>

The inner sink.

§policy: CountingPolicy

A policy state object, deciding whether we are blocking or not.

Invariant: Whenever we try to send with a blocking Policy, we store the context’s waker in self.waker. If later the policy becomes non-blocking, we alert the Waker.

§waker: Option<Waker>

A waker that we should alert when policy transitions from a blocking to a non-blocking state.