pub struct ArgumentHeader(/* private fields */);Expand description
Header word for an FXT Argument.
Implementations§
Source§impl ArgumentHeader
impl ArgumentHeader
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 VALUE_BITS_MASK: u64
pub const VALUE_BITS_MASK: u64
Unshifted bitmask of value_bits.
Sourcepub const VALUE_BITS_SHIFT: usize = 32
pub const VALUE_BITS_SHIFT: usize = 32
Bit shift (i.e., the low bit) of value_bits.
Sourcepub const NAME_REF_MASK: u64
pub const NAME_REF_MASK: u64
Unshifted bitmask of name_ref.
Sourcepub const NAME_REF_SHIFT: usize = 16
pub const NAME_REF_SHIFT: usize = 16
Bit shift (i.e., the low bit) of name_ref.
Sourcepub const SIZE_WORDS_MASK: u64
pub const SIZE_WORDS_MASK: u64
Unshifted bitmask of size_words.
Sourcepub const SIZE_WORDS_SHIFT: usize = 4
pub const SIZE_WORDS_SHIFT: usize = 4
Bit shift (i.e., the low bit) of size_words.
Sourcepub const ARG_TYPE_MASK: u64
pub const ARG_TYPE_MASK: u64
Unshifted bitmask of arg_type.
Sourcepub const ARG_TYPE_SHIFT: usize = 0
pub const ARG_TYPE_SHIFT: usize = 0
Bit shift (i.e., the low bit) of arg_type.
Sourcepub const fn new() -> ArgumentHeader
pub const fn new() -> ArgumentHeader
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 value_bits(&self) -> u32
pub const fn value_bits(&self) -> u32
The value of ArgumentHeader[63:32].
Sourcepub const fn set_value_bits(&mut self, value: u32) -> &mut ArgumentHeader
pub const fn set_value_bits(&mut self, value: u32) -> &mut ArgumentHeader
Sets the value of ArgumentHeader[63:32].
Sourcepub const fn set_name_ref(&mut self, value: u16) -> &mut ArgumentHeader
pub const fn set_name_ref(&mut self, value: u16) -> &mut ArgumentHeader
Sets the value of ArgumentHeader[31:16].
Sourcepub const fn size_words(&self) -> u16
pub const fn size_words(&self) -> u16
The value of ArgumentHeader[15:4].
Sourcepub const fn set_size_words(&mut self, value: u16) -> &mut ArgumentHeader
pub const fn set_size_words(&mut self, value: u16) -> &mut ArgumentHeader
Sets the value of ArgumentHeader[15:4].
Sourcepub fn arg_type(&self) -> ArgumentTypewhere
ArgumentType: TryFromBytes,
pub fn arg_type(&self) -> ArgumentTypewhere
ArgumentType: TryFromBytes,
The value of ArgumentHeader[3:0].
§Panics
Panics if the field’s bit pattern is not a valid value of the custom representation. Use Self::try_arg_type to recover from invalid bit patterns.
Sourcepub fn try_arg_type(&self) -> Result<ArgumentType, InvalidBits<u8>>where
ArgumentType: TryFromBytes,
pub fn try_arg_type(&self) -> Result<ArgumentType, InvalidBits<u8>>where
ArgumentType: TryFromBytes,
Fallible variant of Self::arg_type.
Sourcepub fn set_arg_type(&mut self, value: ArgumentType) -> &mut ArgumentHeaderwhere
ArgumentType: IntoBytes + Immutable,
pub fn set_arg_type(&mut self, value: ArgumentType) -> &mut ArgumentHeaderwhere
ArgumentType: IntoBytes + Immutable,
Sets the value of ArgumentHeader[3:0].
Source§impl ArgumentHeader
impl ArgumentHeader
Sourcepub fn for_argument(
name_ref: u16,
size_words: u16,
arg_type: ArgumentType,
) -> ArgumentHeader
pub fn for_argument( name_ref: u16, size_words: u16, arg_type: ArgumentType, ) -> ArgumentHeader
Constructs an ArgumentHeader for an argument with the given name reference, size in words, and argument type.
Trait Implementations§
Source§impl Binary for ArgumentHeader
impl Binary for ArgumentHeader
Source§impl Clone for ArgumentHeader
impl Clone for ArgumentHeader
Source§fn clone(&self) -> ArgumentHeader
fn clone(&self) -> ArgumentHeader
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 ArgumentHeader
Source§impl Debug for ArgumentHeader
impl Debug for ArgumentHeader
Source§impl Default for ArgumentHeader
impl Default for ArgumentHeader
Source§fn default() -> ArgumentHeader
fn default() -> ArgumentHeader
Returns an instance with the default bits set (i.e,. with a
value of Self::DEFAULT.