cgp-handler 0.4.1

Generalized handler interfaces for functional programming
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use core::marker::PhantomData;

use cgp_core::component::UseDelegate;
use cgp_core::prelude::*;

#[cgp_component {
    provider: Computer,
    derive_delegate: UseDelegate<Code>,
}]
pub trait CanCompute<Code, Input> {
    type Output;

    fn compute(&self, _tag: PhantomData<Code>, input: Input) -> Self::Output;
}