pub struct EchoHandler {
pub fc: u8,
}Expand description
A simple handler that echoes the request data back as the response data. Useful for testing and as a default placeholder.
Fields§
§fc: u8The function code this handler responds to.
Trait Implementations§
Source§impl FunctionCodeHandler for EchoHandler
impl FunctionCodeHandler for EchoHandler
Source§fn handle(&self, req: &FunctionCodeRequest) -> FunctionCodeResponse
fn handle(&self, req: &FunctionCodeRequest) -> FunctionCodeResponse
Process the request and return a response.
Source§fn function_code(&self) -> u8
fn function_code(&self) -> u8
The Modbus function code byte this handler is responsible for.
Source§fn description(&self) -> &str
fn description(&self) -> &str
Short textual description of what this handler does.
Auto Trait Implementations§
impl Freeze for EchoHandler
impl RefUnwindSafe for EchoHandler
impl Send for EchoHandler
impl Sync for EchoHandler
impl Unpin for EchoHandler
impl UnsafeUnpin for EchoHandler
impl UnwindSafe for EchoHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more