encode_stream_frame

Function encode_stream_frame 

Source
pub fn encode_stream_frame<T: Serialize, E: Encoding>(data: T) -> Option<Bytes>
Expand description

This function encodes a single frame of a streaming payload using the specified encoding.

The resulting Bytes object is encoded as a websocket frame, so you can send it over a streaming HTTP response or even a websocket connection.

Note that the packet is not masked, as it is assumed to be sent over a trusted connection.