Struct Cmd6

Source
#[repr(C)]
pub struct Cmd6(pub [u8; 6]);
Expand description

Represents the command format for CMD6.

Tuple Fields§

§0: [u8; 6]

Implementations§

Source§

impl Cmd6

Source

pub const fn bytes(&self) -> [u8; 6]

Gets the byte value for Cmd6.

Source§

impl Cmd6

Source

pub const LEN: usize = 6usize

Represents the byte length of the Cmd6.

Source

pub const COMMAND_INDEX: u8 = 6u8

Represents the command index of the [$cmd].

Source

pub const fn new() -> Self

Creates a new [$cmd].

Source

pub const fn start() -> u8

Gets the start sequence of the Cmd6.

Source

pub const fn command_type(&self) -> CommandType

Gets the command type for the Cmd6.

Source

pub const fn command_class(&self) -> CommandClass

Gets the command class for the Cmd6.

Source

pub const fn command_index(&self) -> u8

Gets the command indnex field of the Cmd6.

Source

pub const fn argument_bits(&self) -> u32

Gets the raw argument field of the Cmd6.

Source

pub const fn argument(&self) -> Result<Argument>

Gets the argument field of the Cmd6.

Source

pub fn set_argument(&mut self, val: Argument)

Sets the argument field of the Cmd6.

Source

pub const fn crc(&self) -> Crc7

Gets the CRC7 field of the Cmd6.

Source

pub fn calculate_crc(&mut self) -> Crc7

Calculates and sets the CRC7 field of the Cmd6.

Source

pub const fn response_type(&self) -> ResponseType

Gets the expected response type for the Cmd6.

Source

pub const fn try_from_bytes(val: &[u8]) -> Result<Self>

Attempts to convert a byte slice into a Cmd6.

Trait Implementations§

Source§

impl Clone for Cmd6

Source§

fn clone(&self) -> Cmd6

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Cmd6

Source§

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

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

impl Default for Cmd6

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Cmd6> for [u8; 6]

Source§

fn from(val: Cmd6) -> Self

Converts to this type from the input type.
Source§

impl From<Cmd6> for Command

Source§

fn from(val: Cmd6) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Cmd6

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&[u8]> for Cmd6

Source§

type Error = Error

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

fn try_from(val: &[u8]) -> Result<Self>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<&[u8; N]> for Cmd6

Source§

type Error = Error

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

fn try_from(val: &[u8; N]) -> Result<Self>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<[u8; N]> for Cmd6

Source§

type Error = Error

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

fn try_from(val: [u8; N]) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<Command> for Cmd6

Source§

type Error = Error

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

fn try_from(val: Command) -> Result<Self>

Performs the conversion.
Source§

impl Copy for Cmd6

Source§

impl Eq for Cmd6

Source§

impl StructuralPartialEq for Cmd6

Auto Trait Implementations§

§

impl Freeze for Cmd6

§

impl RefUnwindSafe for Cmd6

§

impl Send for Cmd6

§

impl Sync for Cmd6

§

impl Unpin for Cmd6

§

impl UnwindSafe for Cmd6

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.

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.