Crate string_types_macro

Crate string_types_macro 

Source
Expand description

Define macros that simplify the creation of StringType structs, by handling most of the boilerplate.

#[string_type] supplies the following implementations:

  • StringType
  • From<Type> for String
  • From<Type> for Inner if not a String.

The FromStr derive macro supplies a reasonable implementation depending on the EnsureValid trait.

Attribute Macros§

string_type
Generate the base implementations for a StringType including the StringType trait and the appropriate From<T> implementations.

Derive Macros§

Display
Implement Derive macro for Display implementation
FromStr
Implement Derive macro for FromStr implementation Handles two variations: inner String and inner other-type