Skip to main content

BitPattern

Trait BitPattern 

Source
pub trait BitPattern: Copy {
    type Bits: BitAnyPattern;

    // Required method
    fn is_bit_pattern_valid(bits: &Self::Bits) -> bool;

    // Provided method
    fn from_bits(bits: Self::Bits) -> Option<Self> { ... }
}
Expand description

bytemuck::CheckedBitPattern trait equivalent.

Required Associated Types§

Required Methods§

Provided Methods§

Source

fn from_bits(bits: Self::Bits) -> Option<Self>

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 BitPattern for bool

Source§

impl BitPattern for char

Source§

impl BitPattern for NonZero<i8>

Source§

impl BitPattern for NonZero<i16>

Source§

impl BitPattern for NonZero<i32>

Source§

impl BitPattern for NonZero<i64>

Source§

impl BitPattern for NonZero<isize>

Source§

impl BitPattern for NonZero<u8>

Source§

impl BitPattern for NonZero<u16>

Source§

impl BitPattern for NonZero<u32>

Source§

impl BitPattern for NonZero<u64>

Source§

impl BitPattern for NonZero<usize>

Implementors§

Source§

impl<T> BitPattern for HslaOf<T>
where T: BitPattern, [<T as BitPattern>::Bits; 4]: BitAnyPattern,

Source§

type Bits = [<T as BitPattern>::Bits; 4]

Source§

impl<T> BitPattern for RgbaOf<T>
where T: BitPattern, [<T as BitPattern>::Bits; 4]: BitAnyPattern,

Source§

type Bits = [<T as BitPattern>::Bits; 4]

Source§

impl<T> BitPattern for RectangleOf<T>
where T: BitPattern, [<T as BitPattern>::Bits; 2]: BitAnyPattern,

Source§

type Bits = [<T as BitPattern>::Bits; 2]

Source§

impl<T> BitPattern for T
where T: BitAnyPattern,

Source§

type Bits = T

Source§

impl<T, const N: usize> BitPattern for Vector<T, N>
where T: BitPattern, [<T as BitPattern>::Bits; N]: BitAnyPattern,

Source§

type Bits = [<T as BitPattern>::Bits; N]