Trait ockam::ParserFragment [−][src]
pub trait ParserFragment<W> where
W: Worker, {
fn ids(&self) -> Vec<ProtocolId>ⓘ;
fn parse(
&self,
_state: &mut W,
_ctx: &mut Context,
_routed: &Routed<Any>,
_msg: ProtocolPayload
) -> Result<bool> { ... }
}Expand description
A parser for a protocol fragment
Protocols are implemented as separate structures, wrapped in a carrier type. Because Rust can’t have a function return different types from a function, each protocol message (here called “Fragment”) needs to be handled by a separate parser.