pub struct UnitId(/* private fields */);Expand description
Which device on the far side of the connection is being asked.
Zero is a broadcast — a frame nobody answers, which on a read-only client can only be a mistake — and 248 to 254 are reserved. 255 is what the specification tells a device with no serial line behind it to use, so it is accepted.
Implementations§
Source§impl UnitId
impl UnitId
Sourcepub const fn new(unit: u8) -> Result<Self, ModbusError>
pub const fn new(unit: u8) -> Result<Self, ModbusError>
An addressed unit.
§Errors
Returns ModbusError::BroadcastUnit for 0 and
ModbusError::ReservedUnit for 248 to 254.
Trait Implementations§
impl Copy for UnitId
impl Eq for UnitId
Source§impl Ord for UnitId
impl Ord for UnitId
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for UnitId
impl PartialOrd for UnitId
impl StructuralPartialEq for UnitId
Auto Trait Implementations§
impl Forget for UnitId
impl Freeze for UnitId
impl Move for UnitId
impl RefUnwindSafe for UnitId
impl Send for UnitId
impl Sync for UnitId
impl Unpin for UnitId
impl UnsafeUnpin for UnitId
impl UnwindSafe for UnitId
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