Skip to main content

BlobRecordHeader

Struct BlobRecordHeader 

Source
pub struct BlobRecordHeader(/* private fields */);
Expand description

Header word for an FXT Blob record (RecordType = 5).

Implementations§

Source§

impl BlobRecordHeader

Source

pub const RSVD1_MASK: u64

Mask of all reserved-as-1 bits.

Source

pub const RSVD0_MASK: u64

Mask of all reserved-as-0 bits.

Source

pub const DEFAULT: u64

The default value of the layout, combining all field defaults and reserved-as values.

Source

pub const BLOB_TYPE_MASK: u64

Unshifted bitmask of blob_type.

Source

pub const BLOB_TYPE_SHIFT: usize = 48

Bit shift (i.e., the low bit) of blob_type.

Source

pub const BLOB_SIZE_MASK: u64

Unshifted bitmask of blob_size.

Source

pub const BLOB_SIZE_SHIFT: usize = 32

Bit shift (i.e., the low bit) of blob_size.

Source

pub const NAME_REF_MASK: u64

Unshifted bitmask of name_ref.

Source

pub const NAME_REF_SHIFT: usize = 16

Bit shift (i.e., the low bit) of name_ref.

Source

pub const RECORD_SIZE_MASK: u64

Unshifted bitmask of record_size.

Source

pub const RECORD_SIZE_SHIFT: usize = 4

Bit shift (i.e., the low bit) of record_size.

Source

pub const RECORD_TYPE_MASK: u64

Unshifted bitmask of record_type.

Source

pub const RECORD_TYPE_SHIFT: usize = 0

Bit shift (i.e., the low bit) of record_type.

Source

pub const RECORD_TYPE_DEFAULT: u64

Pre-shifted default value of the record_type field.

Source

pub const FIELDS: [FieldMetadata<u64>; 5]

Metadata of all named fields in the layout.

Source

pub const fn new() -> BlobRecordHeader

Creates a new instance with reserved-as-1 bits set and all other bits zeroed (i.e., with a value of Self::RSVD1_MASK).

Source

pub const fn bits(self) -> u64

Source

pub fn blob_type(&self) -> BlobType
where BlobType: TryFromBytes,

The value of BlobRecordHeader[55:48].

§Panics

Panics if the field’s bit pattern is not a valid value of the custom representation. Use Self::try_blob_type to recover from invalid bit patterns.

Source

pub fn try_blob_type(&self) -> Result<BlobType, InvalidBits<u8>>
where BlobType: TryFromBytes,

Fallible variant of Self::blob_type.

Source

pub fn set_blob_type(&mut self, value: BlobType) -> &mut BlobRecordHeader
where BlobType: IntoBytes + Immutable,

Sets the value of BlobRecordHeader[55:48].

Source

pub const fn blob_size(&self) -> u16

The value of BlobRecordHeader[46:32].

Source

pub const fn set_blob_size(&mut self, value: u16) -> &mut BlobRecordHeader

Sets the value of BlobRecordHeader[46:32].

Source

pub const fn name_ref(&self) -> u16

The value of BlobRecordHeader[31:16].

Source

pub const fn set_name_ref(&mut self, value: u16) -> &mut BlobRecordHeader

Sets the value of BlobRecordHeader[31:16].

Source

pub const fn record_size(&self) -> u16

The value of BlobRecordHeader[15:4].

Source

pub const fn set_record_size(&mut self, value: u16) -> &mut BlobRecordHeader

Sets the value of BlobRecordHeader[15:4].

Source

pub fn record_type(&self) -> RecordType
where RecordType: TryFromBytes,

The value of BlobRecordHeader[3:0].

§Panics

Panics if the field’s bit pattern is not a valid value of the custom representation. Use Self::try_record_type to recover from invalid bit patterns.

Source

pub fn try_record_type(&self) -> Result<RecordType, InvalidBits<u8>>
where RecordType: TryFromBytes,

Fallible variant of Self::record_type.

Source

pub fn set_record_type(&mut self, value: RecordType) -> &mut BlobRecordHeader
where RecordType: IntoBytes + Immutable,

Sets the value of BlobRecordHeader[3:0].

Source§

impl BlobRecordHeader

Source

pub fn iter(&self) -> BlobRecordHeaderIter

Returns an iterator over ([metadata][bitrs::FieldMetadata], value) pairs for each field.

Trait Implementations§

Source§

impl Binary for BlobRecordHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Clone for BlobRecordHeader

Source§

fn clone(&self) -> BlobRecordHeader

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BlobRecordHeader

Source§

impl Debug for BlobRecordHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for BlobRecordHeader

Source§

fn default() -> BlobRecordHeader

Returns an instance with the default bits set (i.e,. with a value of Self::DEFAULT.

Source§

impl Eq for BlobRecordHeader

Source§

impl From<u64> for BlobRecordHeader

Source§

fn from(value: u64) -> BlobRecordHeader

Converts to this type from the input type.
Source§

impl IntoIterator for BlobRecordHeader

Source§

type Item = (&'static FieldMetadata<u64>, u64)

The type of the elements being iterated over.
Source§

type IntoIter = BlobRecordHeaderIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <BlobRecordHeader as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a BlobRecordHeader

Source§

type Item = (&'static FieldMetadata<u64>, u64)

The type of the elements being iterated over.
Source§

type IntoIter = BlobRecordHeaderIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a BlobRecordHeader as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl LowerHex for BlobRecordHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Octal for BlobRecordHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BlobRecordHeader

Source§

fn eq(&self, other: &BlobRecordHeader) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BlobRecordHeader

Source§

impl UpperHex for BlobRecordHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.