more-convert: more convert utilities
This crate provides utilities for convert
Usage
more-convert provides a derive macro
EnumReprautomatically implementsTryFromandIntofor enums- Ideal for managing Type, etc.
- Example: test code
Convertautomatically implementsFromorIntofor named structs- Leave the very cumbersome From and Into implementations to us!
- Example From: from's test code
- Example Into: into's test code
Example
EnumRepr
use EnumRepr;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Convert
use Convert;
let b = B ;
let a: A = b.into;
assert_eq!;
assert_eq!;
more Into examples are here
more From examples are here
License
Licensed under