Trait BitFieldTrait

Source
pub trait BitFieldTrait: Sealed {
    type Owner;

    const SHIFT: u32;
    const MASK: u64;
}
Expand description

Tracks the Owner, shift and mask used by the Storage::* methods to provide access to an owned bit field.

Note: this trait is sealed against implementation outside this crate. This restriction will be lifted once the API has stabilized.

Required Associated Constants§

Source

const SHIFT: u32

The number of bits the field is shifted in the owner

Source

const MASK: u64

The bit mask used to to select or clear the field bits in the owner

Required Associated Types§

Source

type Owner

The owner, typically a Storage, bound to this bit field

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.

Implementors§

Source§

impl<TOwner, TShift, TMask> BitFieldTrait for BitFieldImpl<TOwner, TShift, TMask>
where TShift: Unsigned, TMask: Unsigned,

Implementation for BitFieldImpl explicitly converts the typenum shift and mask calculations into constants. Forcing the conversion here prevents infinite recursion by the compiler when these values are used by Storage to provide access to the field.

Source§

const SHIFT: u32 = TShift::U32

Source§

const MASK: u64 = TMask::U64

Source§

type Owner = TOwner