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.

Usage

toml [dependencies] nova = "0.4"

Example

```rust use nova::newtype;

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

pub type Meow = String;

[newtype(new, copy)]

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

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

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

}

```

Supported attributes

Crate compatibility attributes

Generation attributes

License

This project is licensed under either of

at your option.