microtype

Macro microtype 

Source
microtype!() { /* proc-macro */ }
Expand description

Macro to create microtype wrappers

See crate-level documentation for a more thorough explanation

Example usage:

microtype! {
  #[derive(Debug, Clone)]  // attributes on the outer type apply to all types in this block
  String {
    #[derive(PartialEq)]  // attributes can also be applied to a single microtype
    Email,

    NotPartialEqString,
  }

  // secret microtypes have extra restrictions to prevent accidental misuse of sensitive data
  #[secret]
  String {
    Password
  }
   
  // `#[secret(serialize)]` can be used to give a secret microtype a `Serialize` implementation
  #[secret(serialize)]
  String {
    SessionToken
  }
}