Skip to main content

DemuxEnumPush

Trait DemuxEnumPush 

Source
pub trait DemuxEnumPush<Outputs, Meta: Copy>: DemuxEnumBase {
    type Ctx<'ctx>: Context<'ctx>;
    type CanPend: Toggle;

    // Required methods
    fn poll_ready(
        outputs: &mut Outputs,
        ctx: &mut Self::Ctx<'_>,
    ) -> PushStep<Self::CanPend>;
    fn start_send(self, meta: Meta, outputs: &mut Outputs);
    fn poll_flush(
        outputs: &mut Outputs,
        ctx: &mut Self::Ctx<'_>,
    ) -> PushStep<Self::CanPend>;
}
Available on crate feature dfir_macro only.
Expand description

Trait for use with the demux_enum operator (Push-based version).

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 Push that corresponds to each of the variants of the tuple, in alphabetic order.

Required Associated Types§

Source

type Ctx<'ctx>: Context<'ctx>

The context type, inherited from the downstream pushes.

Source

type CanPend: Toggle

Whether this push can return [PushStep::Pending], inherited from the downstream pushes.

Required Methods§

Source

fn poll_ready( outputs: &mut Outputs, ctx: &mut Self::Ctx<'_>, ) -> PushStep<Self::CanPend>

Poll readiness of all output pushes.

Source

fn start_send(self, meta: Meta, outputs: &mut Outputs)

Pushes self into the corresponding output push in outputs.

Source

fn poll_flush( outputs: &mut Outputs, ctx: &mut Self::Ctx<'_>, ) -> PushStep<Self::CanPend>

Flushes all output pushes.

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.

Implementors§