Skip to main content

BebopWire

Trait BebopWire 

Source
pub trait BebopWire: WireValue + Sized {
    // Required methods
    fn bebop_encode(&self) -> Result<Vec<u8>, CodecError>;
    fn bebop_decode(bytes: &[u8]) -> Result<Self, CodecError>;
}
Expand description

Per-message-type Bebop encode/decode contract.

Implementors emit a Bebop-compatible byte stream (typically by composing bebop::SubRecord::_serialize_chained calls on each field) inside bebop_encode, and reverse the process in bebop_decode.

Required Methods§

Source

fn bebop_encode(&self) -> Result<Vec<u8>, CodecError>

Serialise self into the Bebop wire format.

Source

fn bebop_decode(bytes: &[u8]) -> Result<Self, CodecError>

Parse a Bebop-encoded byte slice back into Self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§