Skip to main content

impl_newtype

Macro impl_newtype 

Source
macro_rules! impl_newtype {
    ($newtype:ty, $inner:ty $(, $param:ident : $bound:path)*) => { ... };
}
Expand description

Implements the following traits for a newtype of a der decodable/encodable type:

  • From conversions to/from the inner type
  • AsRef and AsMut
  • DecodeValue and EncodeValue
  • FixedTag mapping to the inner value’s FixedTag::TAG

The main case is simplifying newtypes which need an AssociatedOid Optional type parameters follow the inner type, for example P: Profile.