Skip to main content

apply

Function apply 

Source
pub fn apply<H: WorkerProtocolHandler>(
    code: u32,
    body: &[u8],
    handler: &H,
) -> Result<DispatchOutcome, SpecError>
Expand description

Dispatch one wire-arriving opcode against a handler. Looks up the opcode by code in the canonical catalog, then routes to handler.dispatch.

§Errors

  • unknown-opcode if code doesn’t appear in the canonical opcode set.
  • dispatch-failed if the handler returns an error.