Trait bytemuck::Zeroable

source ·
pub unsafe trait Zeroable: Sized {
    fn zeroed() -> Self { ... }
}
Expand description

Trait for types that can be safely created with zeroed.

An all-zeroes value may or may not be the same value as the Default value of the type.

Safety

  • Your type must be inhabited (eg: no Infallible).
  • Your type must be allowed to be an “all zeroes” bit pattern (eg: no NonNull<T>).

Provided Methods§

Calls zeroed.

This is a trait method so that you can write MyType::zeroed() in your code. It is a contract of this trait that if you implement it on your type you must not override this method.

Implementations on Foreign Types§

Implementors§

impl<Frac> Zeroable for FixedI8<Frac>

impl<Frac: LeEqU8> Zeroable for Wrapping<FixedI8<Frac>>

impl<Frac: LeEqU8> Zeroable for Unwrapped<FixedI8<Frac>>

impl<Frac> Zeroable for FixedI16<Frac>

impl<Frac: LeEqU16> Zeroable for Wrapping<FixedI16<Frac>>

impl<Frac: LeEqU16> Zeroable for Unwrapped<FixedI16<Frac>>

impl<Frac> Zeroable for FixedI32<Frac>

impl<Frac: LeEqU32> Zeroable for Wrapping<FixedI32<Frac>>

impl<Frac: LeEqU32> Zeroable for Unwrapped<FixedI32<Frac>>

impl<Frac> Zeroable for FixedI64<Frac>

impl<Frac: LeEqU64> Zeroable for Wrapping<FixedI64<Frac>>

impl<Frac: LeEqU64> Zeroable for Unwrapped<FixedI64<Frac>>

impl<Frac> Zeroable for FixedI128<Frac>

impl<Frac: LeEqU128> Zeroable for Wrapping<FixedI128<Frac>>

impl<Frac: LeEqU128> Zeroable for Unwrapped<FixedI128<Frac>>

impl<Frac> Zeroable for FixedU8<Frac>

impl<Frac: LeEqU8> Zeroable for Wrapping<FixedU8<Frac>>

impl<Frac: LeEqU8> Zeroable for Unwrapped<FixedU8<Frac>>

impl<Frac> Zeroable for FixedU16<Frac>

impl<Frac: LeEqU16> Zeroable for Wrapping<FixedU16<Frac>>

impl<Frac: LeEqU16> Zeroable for Unwrapped<FixedU16<Frac>>

impl<Frac> Zeroable for FixedU32<Frac>

impl<Frac: LeEqU32> Zeroable for Wrapping<FixedU32<Frac>>

impl<Frac: LeEqU32> Zeroable for Unwrapped<FixedU32<Frac>>

impl<Frac> Zeroable for FixedU64<Frac>

impl<Frac: LeEqU64> Zeroable for Wrapping<FixedU64<Frac>>

impl<Frac: LeEqU64> Zeroable for Unwrapped<FixedU64<Frac>>

impl<Frac> Zeroable for FixedU128<Frac>

impl<Frac: LeEqU128> Zeroable for Wrapping<FixedU128<Frac>>

impl<Frac: LeEqU128> Zeroable for Unwrapped<FixedU128<Frac>>