pub trait ExtensionEncoder {
    type Error: 'static + Error + Send + Sync;

    fn encode(
        &mut self,
        payload: &mut BytesMut,
        header: &mut FrameHeader
    ) -> Result<(), Self::Error>; }
Expand description

A per-message frame encoder.

Required Associated Types

The error type produced by this extension if encoding fails.

Required Methods

Invoked when a frame has been received.

Continuation frames

If this frame is not final or a continuation frame then payload will contain all of the data received up to and including this frame.

Note

If a condition is not met an implementation may opt to not encode this frame; such as the payload length not being large enough to require encoding.

Implementors