pub trait DemuxEnumSink<Outputs>: DemuxEnumBase {
type Error;
// Required methods
fn poll_ready(
outputs: &mut Outputs,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
fn start_send(self, outputs: &mut Outputs) -> Result<(), Self::Error>;
fn poll_flush(
outputs: &mut Outputs,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
fn poll_close(
outputs: &mut Outputs,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
}
Available on crate feature
dfir_macro
only.Expand description
Trait for use with the demux_enum
operator.
This trait is meant to be derived: #[derive(DemuxEnum)]
.
The derive will implement this such that Outputs
can be any tuple where each item is a
Sink
that corresponds to each of the variants of the tuple, in alphabetic order.
Required Associated Types§
Required Methods§
Sourcefn poll_ready(
outputs: &mut Outputs,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( outputs: &mut Outputs, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Call poll_ready
on all Outputs
.
Sourcefn start_send(self, outputs: &mut Outputs) -> Result<(), Self::Error>
fn start_send(self, outputs: &mut Outputs) -> Result<(), Self::Error>
Pushes self
into the corresponding output sink in outputs
.
Sourcefn poll_flush(
outputs: &mut Outputs,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_flush( outputs: &mut Outputs, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Call poll_flush
on all Outputs
.
Sourcefn poll_close(
outputs: &mut Outputs,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_close( outputs: &mut Outputs, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Call poll_close
on all Outputs
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.