#type #derive #typeof

typology

Type derivation for foreign use

2 releases

0.1.1 May 13, 2024
0.1.0 May 13, 2024

#2486 in Rust patterns

MIT/Apache

3KB

Typology

Type derivation for foreign use
use typology::{Typology, type_of};

#[derive(Debug, Typology)]
struct User {
  username: String,
  age: u8,
  other: Box<[String]>
}

// Will be String
type UsernameField = type_of!(User::username);

Dependencies

~225–660KB
~16K SLoC