[−][src]Enum eff::coproduct::Either
The coproduct of effects
Variants
A(E, TypedContext<E>)
B(Rest)
Methods
impl<F, Rest> Either<F, Rest> where
F: Effect,
[src]
F: Effect,
pub fn inject<E, Index>(effect: E, cx: TypedContext<E>) -> Self where
E: Effect,
Self: Inject<E, Index>,
[src]
E: Effect,
Self: Inject<E, Index>,
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]
E: Effect,
Self: Uninject<E, Index>,
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]
Self: Embed<Target, Indices>,
Embed self
into the target type
pub fn subset<Target, Indices>(self) -> Result<Target, Self::Remainder> where
Self: Subset<Target, Indices>,
[src]
Self: Subset<Target, Indices>,
Take the subset of Self
Trait Implementations
impl<E, Rest> Inject<E, Zero> for Either<E, Rest> where
E: Effect,
[src]
E: Effect,
fn inject(effect: E, cx: TypedContext<E>) -> Self
[src]
impl<E, F, Rest, Index> Inject<E, Succ<Index>> for Either<F, Rest> where
E: Effect,
F: Effect,
Rest: Inject<E, Index>,
[src]
E: Effect,
F: Effect,
Rest: Inject<E, Index>,
fn inject(effect: E, cx: TypedContext<E>) -> Self
[src]
impl<E, Rest> Uninject<E, Zero> for Either<E, Rest> where
E: Effect,
[src]
E: Effect,
type Remainder = Rest
The other effect types of this coproduct
fn uninject(self) -> Result<(E, TypedContext<E>), Self::Remainder>
[src]
impl<E, F, Rest, Index> Uninject<E, Succ<Index>> for Either<F, Rest> where
E: Effect,
F: Effect,
Rest: Uninject<E, Index>,
[src]
E: Effect,
F: Effect,
Rest: Uninject<E, Index>,
type Remainder = Either<F, <Rest as Uninject<E, Index>>::Remainder>
The other effect types of this coproduct
fn uninject(self) -> Result<(E, TypedContext<E>), Self::Remainder>
[src]
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]
E: Effect,
Target: Inject<E, HeadIndex>,
Rest: Embed<Target, TailIndices>,
impl<E, Rest> Subset<!, !> for Either<E, Rest> where
E: Effect,
[src]
E: Effect,
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]
E: Effect,
T: Uninject<E, HeadIndex>,
<T as Uninject<E, HeadIndex>>::Remainder: Subset<Rest, TailIndices>,
Auto Trait Implementations
impl<E, Rest> Send for Either<E, Rest> where
E: Send,
Rest: Send,
<E as Effect>::Output: Send,
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,
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]
E: Effect,
T: Uninject<E, HeadIndex>,
<T as Uninject<E, HeadIndex>>::Remainder: Subset<Rest, TailIndices>,
type Remainder = <<T as Uninject<E, HeadIndex>>::Remainder as Subset<Rest, TailIndices>>::Remainder
The other effect types
fn subset(
Self
) -> Result<Either<E, Rest>, <T as Subset<Either<E, Rest>, Either<Wrap<HeadIndex>, TailIndices>>>::Remainder>
[src]
Self
) -> Result<Either<E, Rest>, <T as Subset<Either<E, Rest>, Either<Wrap<HeadIndex>, TailIndices>>>::Remainder>
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,