Trait enum_to_enum::WithEffects[][src]

pub trait WithEffects where
    Self: Sized
{ type Value; type Effect; fn new(value: Self::Value, effects: Vec<Self::Effect>) -> Self;
fn into_value_and_effects(
        self
    ) -> (Self::Value, Box<dyn Iterator<Item = Self::Effect>>); fn compose_from(
        value: Self::Value,
        composed_effects: Box<[Self::Effect]>
    ) -> Self { ... } }
Expand description

Any struct specified as an effect_container for the from_enum attribute must implement WithEffects. WithEffects specifies a container for a value, the result of some conversion, and an ordered list of effects arising from that conversion.

It is expected that these effects correspond to some actions to take subsequent to the conversion.

Associated Types

The type of the value we store. This is the result of the conversion.

The type of the effects we store.

Required methods

Creates a new instance of this WithEffects implementor with the given value and effects.

Converts self into a tuple of its value and an iterator over its effects.

Provided methods

Creates a new instance of this WithEffects implementor with the provided value and effects. We provide a default implementation in terms of new.

Implementors