Skip to main content

SwitchbackCodec

Trait SwitchbackCodec 

Source
pub trait SwitchbackCodec: Send + Sync {
    // Required methods
    async fn serialize(&self, manual: &ReferenceManual) -> Result<Vec<u8>>;
    async fn deserialize(&self, bytes: &[u8]) -> Result<ReferenceManual>;
}
Expand description

Async codec for I/O-backed serialize/deserialize of ReferenceManual artifacts.

Primary API per ADR 0002. Implementations live in codec crates (e.g. protobuf switchback wire format).

Required Methods§

Source

async fn serialize(&self, manual: &ReferenceManual) -> Result<Vec<u8>>

Serializes a reference manual to switchback wire bytes.

Source

async fn deserialize(&self, bytes: &[u8]) -> Result<ReferenceManual>

Deserializes switchback wire bytes into a reference manual.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§