pub enum Effect<E, A> {
Pure(A),
Perform(E, Box<dyn FnOnce(()) -> Effect<E, A>>),
}Expand description
A simple algebraic effect: a computation that may perform an effect.
Variants§
Pure(A)
Pure result (no effect)
Perform(E, Box<dyn FnOnce(()) -> Effect<E, A>>)
Effectful operation with continuation
Implementations§
Auto Trait Implementations§
impl<E, A> Freeze for Effect<E, A>
impl<E, A> !RefUnwindSafe for Effect<E, A>
impl<E, A> !Send for Effect<E, A>
impl<E, A> !Sync for Effect<E, A>
impl<E, A> Unpin for Effect<E, A>
impl<E, A> UnsafeUnpin for Effect<E, A>where
A: UnsafeUnpin,
E: UnsafeUnpin,
impl<E, A> !UnwindSafe for Effect<E, A>
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