[−][src]Trait rowan::TransparentNewType
A marker trait for transparent newtypes.
If you declare a struct like
#[repr(transparent)]
struct Wrapper(Inner)
it is safe to add
unsafe impl TransparentNewType for Wrapper { type Repr = Inner; }
Implementing this trait allows one to cast safely between the wrapper and the underlying representation.
Associated Types
type Repr
Underlying representation of a newtype.
Provided methods
fn from_repr(repr: &Self::Repr) -> &Self
Cast the underlying repr into a wrapper.
fn into_repr(&self) -> &Self::Repr
Cast wrapper to the underlying repr.