[−][src]Trait typic::Transparent
Indicates a type has no internal validity requirements.
The Transparent trait is used to indicate that a compound type does not
place any additional validity restrictions on its fields.
This trait can be implemented manually:
#[typic::repr(C)] pub struct Unconstrained { wizz: u8, bang: i8, } unsafe impl Transparent for Unconstrained {} let _ : Unconstrained = u16::default().transmute_into();
Or, automatically, by marking the fields pub:
#[typic::repr(C)] pub struct Unconstrained { pub wizz: u8, pub bang: i8, } let _ : Unconstrained = u16::default().transmute_into();
If the fields are marked pub, the type cannot rely on any internal
validity requirements, as users of the type are free to manipulate its
fields via the . operator.
Implementations on Foreign Types
impl Transparent for AtomicU8[src]
impl Transparent for AtomicU16[src]
impl Transparent for AtomicU32[src]
impl Transparent for AtomicU64[src]
impl Transparent for AtomicUsize[src]
impl Transparent for AtomicI8[src]
impl Transparent for AtomicI16[src]
impl Transparent for AtomicI32[src]
impl Transparent for AtomicI64[src]
impl Transparent for AtomicIsize[src]
impl Transparent for NonZeroU8[src]
impl Transparent for NonZeroU16[src]
impl Transparent for NonZeroU32[src]
impl Transparent for NonZeroU64[src]
impl Transparent for NonZeroU128[src]
impl Transparent for NonZeroI8[src]
impl Transparent for NonZeroI16[src]
impl Transparent for NonZeroI32[src]
impl Transparent for NonZeroI64[src]
impl Transparent for NonZeroI128[src]
impl Transparent for NonZeroIsize[src]
impl Transparent for NonZeroUsize[src]
impl<T> Transparent for AtomicPtr<T>[src]
impl<T: Type> Transparent for Cell<T>[src]
impl<T: Type> Transparent for UnsafeCell<T>[src]
impl<T, N> Transparent for GenericArray<T, N> where
N: ArrayLength<T>, [src]
Loading content...
N: ArrayLength<T>,