Skip to main content

parse_frame

Function parse_frame 

Source
pub fn parse_frame(line: &str, max_bytes: usize) -> Result<RpcCommand, RpcEvent>
Expand description

Parse a raw UTF-8 line into an RpcCommand, enforcing the 1 MiB frame limit.

§Returns

  • Ok(RpcCommand) on success.
  • Err(RpcEvent::Error { id: None, … }) on oversize or malformed input — the caller should emit the error event and continue (do not exit).