ProtocolHandler

Trait ProtocolHandler 

Source
pub trait ProtocolHandler: Send + Sync {
    // Required methods
    fn protocol_id(&self) -> &str;
    fn handle_message(&self, message: &[u8]) -> Web5Result<Vec<u8>>;
    fn get_definition(&self) -> ProtocolDefinition;
}
Expand description

Protocol Handler trait

Defines the interface for protocol handlers in the Web5 system, following the Hexagonal Architecture principles.

Required Methods§

Source

fn protocol_id(&self) -> &str

Get the protocol ID

Source

fn handle_message(&self, message: &[u8]) -> Web5Result<Vec<u8>>

Handle a protocol message

Source

fn get_definition(&self) -> ProtocolDefinition

Get protocol definition

Implementors§