pub struct ModbusTcpServer { /* private fields */ }Expand description
Modbus TCP server.
Implementations§
Source§impl ModbusTcpServer
impl ModbusTcpServer
Sourcepub fn new(config: ModbusServerConfig) -> Self
pub fn new(config: ModbusServerConfig) -> Self
Create a new Modbus TCP server.
Sourcepub fn add_device(&self, device: ModbusDevice)
pub fn add_device(&self, device: ModbusDevice)
Add a device to the server.
Get shared register store.
Sourcepub fn active_connections(&self) -> u64
pub fn active_connections(&self) -> u64
Get active connections count.
Sourcepub fn total_requests(&self) -> u64
pub fn total_requests(&self) -> u64
Get total requests processed.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Check if shutdown is requested.
Sourcepub async fn run(&self) -> ModbusResult<()>
pub async fn run(&self) -> ModbusResult<()>
Run the server.
Auto Trait Implementations§
impl !Freeze for ModbusTcpServer
impl !RefUnwindSafe for ModbusTcpServer
impl Send for ModbusTcpServer
impl Sync for ModbusTcpServer
impl Unpin for ModbusTcpServer
impl UnsafeUnpin for ModbusTcpServer
impl !UnwindSafe for ModbusTcpServer
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