Skip to main content

FunctionCodeHandler

Trait FunctionCodeHandler 

Source
pub trait FunctionCodeHandler: Send + Sync {
    // Required methods
    fn handle(&self, req: &FunctionCodeRequest) -> FunctionCodeResponse;
    fn function_code(&self) -> u8;
    fn description(&self) -> &str;
}
Expand description

Trait for objects that can handle a specific Modbus function code.

Required Methods§

Source

fn handle(&self, req: &FunctionCodeRequest) -> FunctionCodeResponse

Process the request and return a response.

Source

fn function_code(&self) -> u8

The Modbus function code byte this handler is responsible for.

Source

fn description(&self) -> &str

Short textual description of what this handler does.

Implementors§