#[non_exhaustive]
pub enum CmdAddr { SelectAddr(u8), ReplyFromAddr(u8), DiscoveryOffer(u8), DiscoveryClaim(u8), DiscoverySuccess(u8), }
Expand description

Command + Address byte

CmdAddr is a combined Command and Address byte. It consists of:

  • 3 command-bits (0..=7)
  • 5 address-bits (0..=31)

The command bits are most significant, and the address bits are least significant, e.g. 0bCCC_AAAAA, where C are command bits and A are address bits.

The address bits are the logical address of the target, which may be a source or destination, depending on the message kind.

Commands 1, 2, 4, 5, and 7 are assigned as described below. Commands 0, 3, and 6 are reserved for future use, and currently considered invalid.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SelectAddr(u8)

Select - 0b001

Used when the Controller is addressing a Target.

§

ReplyFromAddr(u8)

Reply - 0b010

Used when the Target is responding to the Controller.

§

DiscoveryOffer(u8)

Discovery Offer - 0b100

Used when the Controller is offering an unused logical address to Targets without one. The offered address is the one in the 5-bit address field.

§

DiscoveryClaim(u8)

Discovery Claim - 0b0101

Used when a Target attempts to claim a Discovery Offer message.

§

DiscoverySuccess(u8)

Discovery Success - 0b111

used when the Controller is informing a Target that its address claim is (tentatively) successful. The Target must respond to this message with an empty Reply.

Trait Implementations§

source§

impl Debug for CmdAddr

source§

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

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

impl From<CmdAddr> for u8

source§

fn from(val: CmdAddr) -> Self

Converts to this type from the input type.
source§

impl PartialEq for CmdAddr

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<u8> for CmdAddr

§

type Error = CmdAddrError

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

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for CmdAddr

source§

impl StructuralEq for CmdAddr

source§

impl StructuralPartialEq for CmdAddr

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> 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>,

§

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>,

§

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.