pub struct IndividualAddress(/* private fields */);Expand description
A device’s own address: 4 bits of area, 4 bits of line, and 8 bits of device, held as the 2 octets a frame carries.
This is where a frame comes from, never where a group telegram is going -
a telegram is addressed to a GroupAddress. Written and parsed as
area.line.device.
Implementations§
Source§impl IndividualAddress
impl IndividualAddress
Sourcepub const fn new(area: u8, line: u8, device: u8) -> Result<Self>
pub const fn new(area: u8, line: u8, device: u8) -> Result<Self>
Builds an address from its 3 parts, refusing an area or a line past 15: each has 4 bits. Every device value fits the 8 bits it has.
Sourcepub const fn from_raw(raw: u16) -> Self
pub const fn from_raw(raw: u16) -> Self
The address the given 2 octets state, as a frame carries them.
Infallible: every u16 maps to a structurally valid individual address (4-bit area + 4-bit line + 8-bit device covers the full 16-bit space), so there is no invalid input a checked constructor could reject.
Trait Implementations§
Source§impl Clone for IndividualAddress
impl Clone for IndividualAddress
Source§fn clone(&self) -> IndividualAddress
fn clone(&self) -> IndividualAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for IndividualAddress
Source§impl Debug for IndividualAddress
impl Debug for IndividualAddress
Source§impl Display for IndividualAddress
impl Display for IndividualAddress
impl Eq for IndividualAddress
Source§impl FromStr for IndividualAddress
impl FromStr for IndividualAddress
Source§impl Hash for IndividualAddress
impl Hash for IndividualAddress
Source§impl Ord for IndividualAddress
impl Ord for IndividualAddress
Source§fn cmp(&self, other: &IndividualAddress) -> Ordering
fn cmp(&self, other: &IndividualAddress) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for IndividualAddress
impl PartialEq for IndividualAddress
Source§impl PartialOrd for IndividualAddress
impl PartialOrd for IndividualAddress
impl StructuralPartialEq for IndividualAddress
Auto Trait Implementations§
impl Freeze for IndividualAddress
impl RefUnwindSafe for IndividualAddress
impl Send for IndividualAddress
impl Sync for IndividualAddress
impl Unpin for IndividualAddress
impl UnsafeUnpin for IndividualAddress
impl UnwindSafe for IndividualAddress
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