Trait tokio_modbus::server::Service
source · pub trait Service {
type Request;
type Response: Into<Option<Response>>;
type Exception: Into<Exception>;
type Future: Future<Output = Result<Self::Response, Self::Exception>> + Send;
// Required method
fn call(&self, req: Self::Request) -> Self::Future;
}
Expand description
A Modbus server service.
Required Associated Types§
sourcetype Request
type Request
Requests handled by the service.
Both tokio_modbus::Request
and
tokio_modbus::SlaveRequest
are possible choices.
sourcetype Response: Into<Option<Response>>
type Response: Into<Option<Response>>
Responses sent by the service.
Both tokio_modbus::Response
and
Option<tokio_modbus::Response>
are possible choices.
The latter allows to selectively ignore requests
by not sending a response.
sourcetype Exception: Into<Exception>
type Exception: Into<Exception>
Exceptional responses sent by the service.
Use tokio_modbus::Exception
as default.