pub struct Address(/* private fields */);Expand description
PD bus address.
§Spec: §5.4
Bits 0..7 carry the address. Bit 7 (0x80) is the reply flag: it is set
in messages from PD → ACU. Address 0x7F is the broadcast group.
Implementations§
Source§impl Address
impl Address
Sourcepub const fn from_raw(byte: u8) -> Self
pub const fn from_raw(byte: u8) -> Self
Wrap an arbitrary byte. Use Address::pd / Address::reply for
validated constructors.
Sourcepub const fn pd(addr: u8) -> Result<Self, Error>
pub const fn pd(addr: u8) -> Result<Self, Error>
Construct an ACU → PD address. Errors if the requested address is
out of range (> 0x7F would clash with the reply flag).
Sourcepub const fn reply(addr: u8) -> Result<Self, Error>
pub const fn reply(addr: u8) -> Result<Self, Error>
Construct a PD → ACU address (i.e. with the reply flag set).
Sourcepub const fn is_broadcast(self) -> bool
pub const fn is_broadcast(self) -> bool
true if this is the broadcast address 0x7F.
Trait Implementations§
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more