plushie/protocol

Wire protocol types and constants.

The plushie wire protocol supports two serialization formats: MessagePack (default, length-prefixed) and JSONL (newline-delimited, for debugging). Protocol version is embedded in the settings message sent to the Rust binary on startup.

Types

Decoding failed.

pub type DecodeError {
  DeserializationFailed(String)
  UnknownMessageType(String)
  UnknownEventFamily(String)
  MalformedEvent(String)
  ProtocolMismatch(expected: Int, got: Int)
}

Constructors

  • DeserializationFailed(String)
  • UnknownMessageType(String)
  • UnknownEventFamily(String)
  • MalformedEvent(String)
  • ProtocolMismatch(expected: Int, got: Int)

Encoding failed.

pub type EncodeError {
  SerializationFailed(String)
}

Constructors

  • SerializationFailed(String)

Wire serialization format.

pub type Format {
  Json
  Msgpack
}

Constructors

  • Json
  • Msgpack

Values

pub fn decode_error_to_string(err: DecodeError) -> String

Format a DecodeError as a human-readable string.

pub fn encode_error_to_string(err: EncodeError) -> String

Format an EncodeError as a human-readable string.

pub const protocol_version: Int
Search Document