Trait ockam::ParserFragment[][src]

pub trait ParserFragment<W> where
    W: Worker
{ fn ids(&self) -> Vec<ProtocolId>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
; 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.

Required methods

Return the set of ProtocolIDs this parser can handle

Provided methods

Parse an incoming message for a particular worker

Implementors