#derive #type #typeof

typology

Type derivation for foreign use

2 releases

0.1.1 May 13, 2024
0.1.0 May 13, 2024

#844 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

~265–710KB
~17K SLoC