pub unsafe trait TypeLayout: Sized {
    const TYPE_LAYOUT: TypeLayoutInfo<'static>;

    unsafe fn uninit() -> MaybeUninhabited<MaybeUninit<Self>>;
}
Expand description

Safety

It is only safe to implement this trait if it accurately describes the type’s layout. Use #[derive(TypeLayout)] instead.

Required Associated Constants§

Required Methods§

Safety
  1. The returned value is not safe to be used in any other way than to calculate field offsets and discriminants.

  2. The value and any value built with it must NOT be dropped.

  3. Must return MaybeUninhabited::Uninhabited iff the type is uninhabited.

Implementations on Foreign Types§

Implementors§