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)]
struct User {
    name: String,
    #[serde(default)]
    email: String,
}

fn main() {}