pub struct DeepHandler<A, B> {
pub effect_name: String,
pub val_clause: Box<dyn Fn(A) -> B>,
pub op_clauses: HashMap<String, Box<dyn Fn(String, Box<dyn Fn(String) -> B>) -> B>>,
}Expand description
A deep effect handler for a specific effect.
A deep handler handles every operation of the effect recursively, re-interpreting the continuation in the handled context.
Fields§
§effect_name: StringThe name of the handled effect.
val_clause: Box<dyn Fn(A) -> B>Return clause: val_clause(a) handles the final value.
op_clauses: HashMap<String, Box<dyn Fn(String, Box<dyn Fn(String) -> B>) -> B>>Operation clauses: map (op_name, arg, k) to B where k : String → B.
Implementations§
Auto Trait Implementations§
impl<A, B> Freeze for DeepHandler<A, B>
impl<A, B> !RefUnwindSafe for DeepHandler<A, B>
impl<A, B> !Send for DeepHandler<A, B>
impl<A, B> !Sync for DeepHandler<A, B>
impl<A, B> Unpin for DeepHandler<A, B>
impl<A, B> UnsafeUnpin for DeepHandler<A, B>
impl<A, B> !UnwindSafe for DeepHandler<A, B>
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