Skip to main content

IntegerIdContiguous

Trait IntegerIdContiguous 

Source
pub trait IntegerIdContiguous: IntegerId { }
Expand description

Indicates that an id occupies contiguous range of contiguous values, and all values between IntegerId::MIN_ID and IntegerId::MAX_ID are valid.

This is similar to bytemuck::Contiguous. However, since it is safe to implement, it must not be relied upon for correctness.

§Safety

This trait is safe to implement, so may not usually be relied upon for memory safety.

However, if Self::from_int_unchecked makes unsafe assumptions (satisfying the condition set forth in the IntegerId safety docs), then this trait must also be implemented correctly. More specifically, all integers between IntegerId::MIN_ID and IntegerId::MAX_ID must be valid and cannot fail when passed to IntegerId::from_int_checked.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IntegerIdContiguous for !

Source§

impl IntegerIdContiguous for Infallible

Source§

impl IntegerIdContiguous for NonMaxU8

Source§

impl IntegerIdContiguous for NonMaxU16

Source§

impl IntegerIdContiguous for NonMaxU32

Source§

impl IntegerIdContiguous for NonMaxU64

Source§

impl IntegerIdContiguous for NonMaxU128

Source§

impl IntegerIdContiguous for NonMaxUsize

Source§

impl IntegerIdContiguous for NonZeroU8

Source§

impl IntegerIdContiguous for NonZeroU16

Source§

impl IntegerIdContiguous for NonZeroU32

Source§

impl IntegerIdContiguous for NonZeroU64

Source§

impl IntegerIdContiguous for NonZeroU128

Source§

impl IntegerIdContiguous for NonZeroUsize

Source§

impl IntegerIdContiguous for u8

Source§

impl IntegerIdContiguous for u16

Source§

impl IntegerIdContiguous for u32

Source§

impl IntegerIdContiguous for u64

Source§

impl IntegerIdContiguous for u128

Source§

impl IntegerIdContiguous for usize

Implementors§