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§
Sourcefn protocol_id(&self) -> &str
fn protocol_id(&self) -> &str
Get the protocol ID
Sourcefn handle_message(&self, message: &[u8]) -> Web5Result<Vec<u8>>
fn handle_message(&self, message: &[u8]) -> Web5Result<Vec<u8>>
Handle a protocol message
Sourcefn get_definition(&self) -> ProtocolDefinition
fn get_definition(&self) -> ProtocolDefinition
Get protocol definition