id_effect 0.1.1

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
14
15
16
//! Ex 085 — `decode_unknown` accepts tree-shaped `Unknown`.
use id_effect::EffectData;
use id_effect::schema::{Unknown, string};

#[derive(Clone, Debug, EffectData)]
struct T;

fn main() {
  let s = string::<T>();
  assert!(s.decode_unknown(&Unknown::Null).is_err());
  assert_eq!(
    s.decode_unknown(&Unknown::String("hi".to_owned())),
    Ok("hi".to_owned())
  );
  println!("085_unknown_decode ok");
}