nova

Documentation

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

toml [dependencies] nova = "0.3"

Example

```rust use nova::newtype;

[newtype(serde, borrow = "str")]

pub type Meow = String;

[newtype(copy)]

pub(crate) type SpecialUuid = uuid::Uuid;

fn example() { let meow = Meow("this is a string".tostring()); let specialuuid = SpecialUuid(uuid::Uuid::new_v4());

// Get inner:
let inner = special_uuid.into_inner();

}

```

Features

License

This project is licensed under either of

at your option.