nova
Create newtypes with great convenience.
All types generated by the following macros implement Debug
, Clone
, Eq
, PartialEq
, Ord
, PartialOrd
and Hash
. For Copy
types, the newtype also implements Copy
.
For convenience, each type is also generated with a conditional derive for serde serialisation and deserialisation. This is enabled
with the serde
feature, if desired.
Usage
[]
= "0.3"
Example
use newtype;
pub type Meow = String;
pub type SpecialUuid = Uuid;
Features
- serde: enables support for the
serde
attribute to deriveSerialize
andDeserialize
for newtypes.
License
This project is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.