structural-typing 0.1.9

Type-level field presence tracking for Rust structs, inspired by TypeScript
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use serde::Deserialize;
use structural_typing::structural;

#[structural]
#[derive(Deserialize)]
#[serde(default)]
struct User {
    name: String,
    email: String,
}

fn main() {}