pub enum FreeView<F>{
Return(TypeErasedValue),
Suspend(<F as Kind_cdc7cd43dac7585f>::Of<'static, Free<F, TypeErasedValue>>),
}Expand description
The internal view of the Free monad.
This enum encodes the current step of the free monad computation. Both
variants hold type-erased values; the concrete type A is tracked by
PhantomData on the outer Free struct. The CatList of continuations
lives at the top level in Free, not inside any variant.
§Type Parameters
Variants§
Return(TypeErasedValue)
A pure value (type-erased).
This variant represents a computation that has finished and produced a value.
The actual type is tracked by PhantomData<A> on the enclosing Free.
Suspend(<F as Kind_cdc7cd43dac7585f>::Of<'static, Free<F, TypeErasedValue>>)
A suspended computation (type-erased).
This variant represents a computation that is suspended in the functor F.
The functor contains Free<F, TypeErasedValue> as the next step.
Auto Trait Implementations§
impl<F> Freeze for FreeView<F>
impl<F> !RefUnwindSafe for FreeView<F>
impl<F> !Send for FreeView<F>
impl<F> !Sync for FreeView<F>
impl<F> Unpin for FreeView<F>
impl<F> UnsafeUnpin for FreeView<F>
impl<F> !UnwindSafe for FreeView<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more