Skip to main content

Newtype

Derive Macro Newtype 

Source
#[derive(Newtype)]
{
    // Attributes available to this derive:
    #[newtype]
}
Expand description

Parses and expands a Newtype derive into a token stream.

#[derive(Newtype)]
#[newtype(from(Oranges, with =  "|oranges| Apples(oranges.0 as u64 * 2)"))]
struct Apples(u64);