[][src]Enum eff::coproduct::Either

pub enum Either<E, Rest> where
    E: Effect
{ A(E, TypedContext<E>), B(Rest), }

The coproduct of effects

Variants

A(E, TypedContext<E>)B(Rest)

Methods

impl<F, Rest> Either<F, Rest> where
    F: Effect
[src]

pub fn inject<E, Index>(effect: E, cx: TypedContext<E>) -> Self where
    E: Effect,
    Self: Inject<E, Index>, 
[src]

Construct Self using an effect and a task context

pub fn uninject<E, Index>(self) -> Result<(E, TypedContext<E>), Self::Remainder> where
    E: Effect,
    Self: Uninject<E, Index>, 
[src]

Retrieve an effect and a task context from self if the type matches

Errors

If self holds an effect of a different type, this method returns an error.

pub fn embed<Target, Indices>(self) -> Target where
    Self: Embed<Target, Indices>, 
[src]

Embed self into the target type

pub fn subset<Target, Indices>(self) -> Result<Target, Self::Remainder> where
    Self: Subset<Target, Indices>, 
[src]

Take the subset of Self

Trait Implementations

impl<E, Rest> Inject<E, Zero> for Either<E, Rest> where
    E: Effect
[src]

impl<E, F, Rest, Index> Inject<E, Succ<Index>> for Either<F, Rest> where
    E: Effect,
    F: Effect,
    Rest: Inject<E, Index>, 
[src]

impl<E, Rest> Uninject<E, Zero> for Either<E, Rest> where
    E: Effect
[src]

type Remainder = Rest

The other effect types of this coproduct

impl<E, F, Rest, Index> Uninject<E, Succ<Index>> for Either<F, Rest> where
    E: Effect,
    F: Effect,
    Rest: Uninject<E, Index>, 
[src]

type Remainder = Either<F, <Rest as Uninject<E, Index>>::Remainder>

The other effect types of this coproduct

impl<E, Rest, Target, HeadIndex, TailIndices> Embed<Target, Either<Wrap<HeadIndex>, TailIndices>> for Either<E, Rest> where
    E: Effect,
    Target: Inject<E, HeadIndex>,
    Rest: Embed<Target, TailIndices>, 
[src]

impl<E, Rest> Subset<!, !> for Either<E, Rest> where
    E: Effect
[src]

type Remainder = Self

The other effect types

impl<T, E, Rest, HeadIndex, TailIndices> Subset<Either<E, Rest>, Either<Wrap<HeadIndex>, TailIndices>> for T where
    E: Effect,
    T: Uninject<E, HeadIndex>,
    <T as Uninject<E, HeadIndex>>::Remainder: Subset<Rest, TailIndices>, 
[src]

type Remainder = <<T as Uninject<E, HeadIndex>>::Remainder as Subset<Rest, TailIndices>>::Remainder

The other effect types

Auto Trait Implementations

impl<E, Rest> Send for Either<E, Rest> where
    E: Send,
    Rest: Send,
    <E as Effect>::Output: Send

impl<E, Rest> Sync for Either<E, Rest> where
    E: Sync,
    Rest: Sync,
    <E as Effect>::Output: Sync

Blanket Implementations

impl<T, E, Rest, HeadIndex, TailIndices> Subset for T where
    E: Effect,
    T: Uninject<E, HeadIndex>,
    <T as Uninject<E, HeadIndex>>::Remainder: Subset<Rest, TailIndices>, 
[src]

type Remainder = <<T as Uninject<E, HeadIndex>>::Remainder as Subset<Rest, TailIndices>>::Remainder

The other effect types

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]