Trait ratchet_ext::ExtensionEncoder
source · [−]pub trait ExtensionEncoder {
type Error: Error + Send + Sync + 'static;
fn encode(
&mut self,
payload: &mut BytesMut,
header: &mut FrameHeader
) -> Result<(), Self::Error>;
}
Expand description
A per-message frame encoder.
Associated Types
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.