effectful 0.3.0

Effect<A, E, R> (sync + async), context/layers, pipe — interpreter-style, no bundled executor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Ex 030 — `#[derive(Service)]` makes the service type its own key.
use effectful::Service;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Service)]
struct DbSvc {
  port: u32,
}

fn main() {
  let context = DbSvc { port: 7 }.to_context();
  assert_eq!(context.get::<DbSvc>().map(|svc| svc.port), Some(7));
  println!("030_service_def ok");
}