███╗ ██╗███████╗██╗ ██╗████████╗██╗ ██╗██████╗ ███████╗██████╗ ███████╗███████╗
████╗ ██║██╔════╝██║ ██║╚══██╔══╝╚██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗██╔════╝██╔════╝
██╔██╗ ██║█████╗ ██║ █╗ ██║ ██║ ╚████╔╝ ██████╔╝█████╗ ██████╔╝█████╗ █████╗
██║╚██╗██║██╔══╝ ██║███╗██║ ██║ ╚██╔╝ ██╔═══╝ ██╔══╝ ██╔══██╗██╔══╝ ██╔══╝
██║ ╚████║███████╗╚███╔███╔╝ ██║ ██║ ██║ ███████╗██║ ██║███████╗██║
╚═╝ ╚═══╝╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚═╝
------------------------------------------------------------------------------
Generate custom newtype reference types
[![Crates.io](https://img.shields.io/crates/v/newtyperef.svg)](https://crates.io/crates/newtyperef)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
## 🚀 Installation
include it in your `Cargo.toml` under `[dependencies]`
```toml
newtyperef = "*"
```
## 🧑💻 Usage examples
### Basic Usage
```rust
use newtyperef::newtyperef;
#[newtyperef]
pub struct Name(pub String);
fn main() {
let mut name = Name("X Æ A-12".into());
let name_ref: NameRef<'_> = name.as_ref();
let name_ref_inner: &String = name_ref.deref();
let mut name_mut: NameRefMut<'_> = name.as_mut();
let name_mut_inner: &String = name_mut.deref();
let name_mut_inner: &mut String = name_mut.deref_mut();
}
```
### Customizing Reference Types
```rust
use newtyperef::newtyperef;
#[newtyperef(ref = str, mut = str)]
pub struct Name(pub String);
fn name_example() {
let mut name = Name("X Æ A-12".into());
let name_ref: NameRef<'_> = name.as_ref();
let name_ref_inner: &str = name_ref.deref();
let mut name_mut: NameRefMut<'_> = name.as_mut();
let name_mut_inner: &str = name_mut.deref();
let name_mut_inner: &mut str = name_mut.deref_mut();
}
#[newtyperef(ref = [String])]
pub struct Emails(pub Vec