Content-Length: 27394 | pFad | https://doc.rust-lang.org/nightly/alloc/string/../../alloc/../std/num/trait.ZeroablePrimitive.html

ZeroablePrimitive in std::num - RustSkip to main content

ZeroablePrimitive

Trait ZeroablePrimitive 

Source
pub unsafe trait ZeroablePrimitive:
    Sized
    + Copy
    + Sealed {
    type NonZeroInner: Copy;
}
🔬This is a nightly-only experimental API. (nonzero_internals)
Expand description

A marker trait for primitive types which can be zero.

This is an implementation detail for NonZero<T> which may disappear or be replaced at any time.

§Safety

Types implementing this trait must be primitives that are valid when zeroed.

The associated Self::NonZeroInner type must have the same size+align as Self, but with a niche and bit validity making it so the following transmutes are sound:

  • Self::NonZeroInner to Option<Self::NonZeroInner>
  • Option<Self::NonZeroInner> to Self

(And, consequently, Self::NonZeroInner to Self.)

Required Associated Types§

Source

type NonZeroInner: Copy

🔬This is a nightly-only experimental API. (nonzero_internals)

A type like Self but with a niche that includes zero.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/nightly/alloc/string/../../alloc/../std/num/trait.ZeroablePrimitive.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy