pub struct ModbusServer<S: DataStore> { /* private fields */ }Expand description
Async Modbus server, generic over the data store implementation.
Implementations§
Source§impl<S: DataStore + 'static> ModbusServer<S>
impl<S: DataStore + 'static> ModbusServer<S>
Sourcepub async fn start(
config: ServerConfig,
store: Arc<S>,
) -> Result<Self, ServerError>
pub async fn start( config: ServerConfig, store: Arc<S>, ) -> Result<Self, ServerError>
Create and start a new Modbus server.
Binds to the configured address and begins accepting connections immediately.
§Errors
Returns ServerError::Bind if the address cannot be bound.
Sourcepub async fn stop(&self)
pub async fn stop(&self)
Graceful shutdown: stop accepting, wait for in-flight, close connections.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Local address the server is bound to.
Trait Implementations§
Source§impl<S: DataStore> Debug for ModbusServer<S>
impl<S: DataStore> Debug for ModbusServer<S>
Source§impl<S: DataStore> Drop for ModbusServer<S>
impl<S: DataStore> Drop for ModbusServer<S>
Auto Trait Implementations§
impl<S> Freeze for ModbusServer<S>
impl<S> RefUnwindSafe for ModbusServer<S>where
S: RefUnwindSafe,
impl<S> Send for ModbusServer<S>
impl<S> Sync for ModbusServer<S>
impl<S> Unpin for ModbusServer<S>
impl<S> UnsafeUnpin for ModbusServer<S>
impl<S> UnwindSafe for ModbusServer<S>where
S: RefUnwindSafe,
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