Struct tokio_modbus::slave::Slave
source · pub struct Slave(pub SlaveId);Expand description
A single byte for addressing Modbus slave devices.
Tuple Fields§
§0: SlaveIdImplementations§
source§impl Slave
impl Slave
sourcepub const fn broadcast() -> Self
pub const fn broadcast() -> Self
The special address for sending a broadcast message to all connected Modbus slave devices at once. Broadcast messages are one-way and sent from the master to all slaves, i.e. a request without a response.
Some devices may use a custom id from the reserved range 248-255 for broadcasting.
sourcepub const fn min_device() -> Self
pub const fn min_device() -> Self
The minimum address of a single Modbus slave device.
sourcepub const fn max_device() -> Self
pub const fn max_device() -> Self
The maximum address of a single Modbus slave device.
sourcepub const fn tcp_device() -> Self
pub const fn tcp_device() -> Self
The reserved address for sending a message to a directly connected Modbus TCP device, i.e. if not forwarded through a TCP/RTU gateway according to the unit identifier.
Modbus Messaging on TCP/IP Implementation Guide, page 23 “On TCP/IP, the Modbus server is addressed using its IP address; therefore, the Modbus Unit Identifier is useless. The value 0xFF has to be used.”
sourcepub fn is_broadcast(self) -> bool
pub fn is_broadcast(self) -> bool
Check if the SlaveId is used for broadcasting
sourcepub fn is_single_device(self) -> bool
pub fn is_single_device(self) -> bool
Check if the SlaveId addresses a single device
sourcepub fn is_reserved(self) -> bool
pub fn is_reserved(self) -> bool
Check if the SlaveId is reserved
Trait Implementations§
source§impl Ord for Slave
impl Ord for Slave
source§impl PartialEq for Slave
impl PartialEq for Slave
source§impl PartialOrd for Slave
impl PartialOrd for Slave
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Copy for Slave
impl Eq for Slave
impl StructuralPartialEq for Slave
Auto Trait Implementations§
impl Freeze for Slave
impl RefUnwindSafe for Slave
impl Send for Slave
impl Sync for Slave
impl Unpin for Slave
impl UnwindSafe for Slave
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)