Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 973 Bytes

File metadata and controls

15 lines (10 loc) · 973 Bytes
  • Sanitizer - an infallible operation on a piece of data that converts the data to some canonical form. Example: trim trailing spaces and lowercase an email address.

  • Validator - a fallible operation, that checks if a piece of data matches some given rules. Example: ensure that an email address contains @ character. Validators come with associated error variants.

  • Guard - an umbrella term that covers both sanitizers and validators.

  • Inner Type - typically a simple type that is wrapped by a newtype. Example: consider Email type defined as Email(String). We have say that Email has inner type String.

  • Transparent trait - a trait that can be simply derived (e.g. Debug, Clone).

  • Irregular trait - a trait that requires a custom implementation to be generated (e.g. TryFrom).

  • Unchecked trait - a trait that potentially may violate the constraints. Traits derive with derive_unchecked(...) are not validated by nutype.