Skip to main content

FrameEncoder

Trait FrameEncoder 

Source
pub trait FrameEncoder {
    type Error;

    // Required methods
    fn encode_replication(
        &mut self,
        frame: &ReplicationFrame,
        out: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
    fn encode_command_ack(
        &mut self,
        frame: &CommandAckFrame,
        out: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
    fn encode_command(
        &mut self,
        frame: &CommandFrame,
        out: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
    fn encode_command_dispatch(
        &mut self,
        frame: &CommandDispatchFrame,
        out: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
    fn encode_station_event(
        &mut self,
        frame: &StationEventFrame,
        out: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
    fn encode_barrier(
        &mut self,
        frame: &BarrierFrame,
        out: &mut Vec<u8>,
    ) -> Result<(), Self::Error>;
}
Expand description

Encodes frames into bytes.

Required Associated Types§

Source

type Error

Encoder error type.

Required Methods§

Source

fn encode_replication( &mut self, frame: &ReplicationFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>

Encodes a replication frame into out.

Source

fn encode_command_ack( &mut self, frame: &CommandAckFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>

Encodes a command acknowledgement frame into out.

Source

fn encode_command( &mut self, frame: &CommandFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>

Encodes a client command frame into out.

Source

fn encode_command_dispatch( &mut self, frame: &CommandDispatchFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>

Encodes an internal command dispatch frame into out.

Source

fn encode_station_event( &mut self, frame: &StationEventFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>

Encodes a cross-station event frame into out.

Source

fn encode_barrier( &mut self, frame: &BarrierFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>

Encodes a barrier frame into out.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§