Trait Zeroable

Source
pub unsafe trait Zeroable: Sized { }
Expand description

Types that can be safely “zero-initialized”.

§Safety

The type this trait is implemented on must:

  • be inhabited (no !)
  • have a state where all bits are all zeroes

§Notes

Integral types (i32, i64, …), and some other type that fulfill the above safety requirements have built-in impls that are provided by this crate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Zeroable for bool

Source§

impl Zeroable for i8

Source§

impl Zeroable for i16

Source§

impl Zeroable for i32

Source§

impl Zeroable for i64

Source§

impl Zeroable for i128

Source§

impl Zeroable for isize

Source§

impl Zeroable for u8

Source§

impl Zeroable for u16

Source§

impl Zeroable for u32

Source§

impl Zeroable for u64

Source§

impl Zeroable for u128

Source§

impl Zeroable for usize

Source§

impl Zeroable for AtomicBool

Source§

impl Zeroable for AtomicI8

Source§

impl Zeroable for AtomicI16

Source§

impl Zeroable for AtomicI32

Source§

impl Zeroable for AtomicI64

Source§

impl Zeroable for AtomicIsize

Source§

impl Zeroable for AtomicU8

Source§

impl Zeroable for AtomicU16

Source§

impl Zeroable for AtomicU32

Source§

impl Zeroable for AtomicU64

Source§

impl Zeroable for AtomicUsize

Source§

impl<A, B, C, D, E, F, G, H> Zeroable for (A, B, C, D, E, F, G, H)
where A: Zeroable, B: Zeroable, C: Zeroable, D: Zeroable, E: Zeroable, F: Zeroable, G: Zeroable, H: Zeroable,

Source§

impl<B, C, D, E, F, G, H> Zeroable for (B, C, D, E, F, G, H)
where B: Zeroable, C: Zeroable, D: Zeroable, E: Zeroable, F: Zeroable, G: Zeroable, H: Zeroable,

Source§

impl<C, D, E, F, G, H> Zeroable for (C, D, E, F, G, H)
where C: Zeroable, D: Zeroable, E: Zeroable, F: Zeroable, G: Zeroable, H: Zeroable,

Source§

impl<D, E, F, G, H> Zeroable for (D, E, F, G, H)
where D: Zeroable, E: Zeroable, F: Zeroable, G: Zeroable, H: Zeroable,

Source§

impl<E, F, G, H> Zeroable for (E, F, G, H)
where E: Zeroable, F: Zeroable, G: Zeroable, H: Zeroable,

Source§

impl<F, G, H> Zeroable for (F, G, H)
where F: Zeroable, G: Zeroable, H: Zeroable,

Source§

impl<G, H> Zeroable for (G, H)
where G: Zeroable, H: Zeroable,

Source§

impl<H: Zeroable> Zeroable for (H,)

Source§

impl<T> Zeroable for AtomicPtr<T>

Source§

impl<T> Zeroable for MaybeUninit<T>

Source§

impl<T: Sized> Zeroable for *const T

Source§

impl<T: Sized> Zeroable for *mut T

Source§

impl<T: Zeroable> Zeroable for UnsafeCell<T>

Source§

impl<T: Zeroable> Zeroable for ManuallyDrop<T>

Source§

impl<T: Zeroable, const N: usize> Zeroable for [T; N]

Source§

impl<T: ?Sized> Zeroable for PhantomData<T>

Implementors§