pub struct StringRecordHeader(/* private fields */);Expand description
Header word for an FXT String record (RecordType = 2).
Implementations§
Source§impl StringRecordHeader
impl StringRecordHeader
Sourcepub const RSVD1_MASK: u64
pub const RSVD1_MASK: u64
Mask of all reserved-as-1 bits.
Sourcepub const RSVD0_MASK: u64
pub const RSVD0_MASK: u64
Mask of all reserved-as-0 bits.
Sourcepub const DEFAULT: u64
pub const DEFAULT: u64
The default value of the layout, combining all field defaults and reserved-as values.
Sourcepub const STRING_LEN_MASK: u64
pub const STRING_LEN_MASK: u64
Unshifted bitmask of string_len.
Sourcepub const STRING_LEN_SHIFT: usize = 32
pub const STRING_LEN_SHIFT: usize = 32
Bit shift (i.e., the low bit) of string_len.
Sourcepub const STRING_INDEX_MASK: u64
pub const STRING_INDEX_MASK: u64
Unshifted bitmask of string_index.
Sourcepub const STRING_INDEX_SHIFT: usize = 16
pub const STRING_INDEX_SHIFT: usize = 16
Bit shift (i.e., the low bit) of string_index.
Sourcepub const RECORD_SIZE_MASK: u64
pub const RECORD_SIZE_MASK: u64
Unshifted bitmask of record_size.
Sourcepub const RECORD_SIZE_SHIFT: usize = 4
pub const RECORD_SIZE_SHIFT: usize = 4
Bit shift (i.e., the low bit) of record_size.
Sourcepub const RECORD_TYPE_MASK: u64
pub const RECORD_TYPE_MASK: u64
Unshifted bitmask of record_type.
Sourcepub const RECORD_TYPE_SHIFT: usize = 0
pub const RECORD_TYPE_SHIFT: usize = 0
Bit shift (i.e., the low bit) of record_type.
Sourcepub const RECORD_TYPE_DEFAULT: u64
pub const RECORD_TYPE_DEFAULT: u64
Pre-shifted default value of the record_type field.
Sourcepub const fn new() -> StringRecordHeader
pub const fn new() -> StringRecordHeader
Creates a new instance with reserved-as-1 bits set and
all other bits zeroed (i.e., with a value of
Self::RSVD1_MASK).
pub const fn bits(self) -> u64
Sourcepub const fn string_len(&self) -> u16
pub const fn string_len(&self) -> u16
The value of StringRecordHeader[46:32].
Sourcepub const fn set_string_len(&mut self, value: u16) -> &mut StringRecordHeader
pub const fn set_string_len(&mut self, value: u16) -> &mut StringRecordHeader
Sets the value of StringRecordHeader[46:32].
Sourcepub const fn string_index(&self) -> u16
pub const fn string_index(&self) -> u16
The value of StringRecordHeader[30:16].
Sourcepub const fn set_string_index(&mut self, value: u16) -> &mut StringRecordHeader
pub const fn set_string_index(&mut self, value: u16) -> &mut StringRecordHeader
Sets the value of StringRecordHeader[30:16].
Sourcepub const fn record_size(&self) -> u16
pub const fn record_size(&self) -> u16
The value of StringRecordHeader[15:4].
Sourcepub const fn set_record_size(&mut self, value: u16) -> &mut StringRecordHeader
pub const fn set_record_size(&mut self, value: u16) -> &mut StringRecordHeader
Sets the value of StringRecordHeader[15:4].
Sourcepub fn record_type(&self) -> RecordTypewhere
RecordType: TryFromBytes,
pub fn record_type(&self) -> RecordTypewhere
RecordType: TryFromBytes,
The value of StringRecordHeader[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.
Sourcepub fn try_record_type(&self) -> Result<RecordType, InvalidBits<u8>>where
RecordType: TryFromBytes,
pub fn try_record_type(&self) -> Result<RecordType, InvalidBits<u8>>where
RecordType: TryFromBytes,
Fallible variant of Self::record_type.
Sourcepub fn set_record_type(&mut self, value: RecordType) -> &mut StringRecordHeaderwhere
RecordType: IntoBytes + Immutable,
pub fn set_record_type(&mut self, value: RecordType) -> &mut StringRecordHeaderwhere
RecordType: IntoBytes + Immutable,
Sets the value of StringRecordHeader[3:0].
Trait Implementations§
Source§impl Binary for StringRecordHeader
impl Binary for StringRecordHeader
Source§impl Clone for StringRecordHeader
impl Clone for StringRecordHeader
Source§fn clone(&self) -> StringRecordHeader
fn clone(&self) -> StringRecordHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StringRecordHeader
Source§impl Debug for StringRecordHeader
impl Debug for StringRecordHeader
Source§impl Default for StringRecordHeader
impl Default for StringRecordHeader
Source§fn default() -> StringRecordHeader
fn default() -> StringRecordHeader
Returns an instance with the default bits set (i.e,. with a
value of Self::DEFAULT.