Macro 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
}
// "out secret" microtypes have the same restrictions, except that they implement
// serde::Serialize
out secret String {
SessionToken
}
}