pub enum WebsocketFrameEvent {
Start {
frame_info: FrameInfo,
original_opcode: Opcode,
},
PayloadChunk {
original_opcode: Opcode,
},
End {
frame_info: FrameInfo,
original_opcode: Opcode,
},
}Expand description
Information that WebsocketFrameDecoder gives in return to bytes being fed to it.
Variants§
Start
Indicates a frame is started.
original_opcode is the same as frame_info.opcode, except for
Opcode::Continuation frames, for which it should refer to
initial frame in sequence (i.e. Opcode::Text or Opcode::Binary)
PayloadChunk
Bytes which were supplied to WebsocketFrameDecoder::add_data are payload bytes,
transformed for usage as a part of payload.
You should use WebsocketFrameDecoderAddDataResult::consumed_bytes to get actual
buffer to be handled as content coming from the WebSocket.
Mind the original_opcode to avoid mixing content of control frames and data frames.
End
Indicates that all PayloadChunks for the given frame are delivered and the frame
is ended.
You can watch for frame_info.fin together with checking original_opcode to know
wnen WebSocket message (not just a frame) ends.
frame_info is the same as in WebsocketFrameEvent::Start’s frame_info.
Trait Implementations§
Source§impl Clone for WebsocketFrameEvent
impl Clone for WebsocketFrameEvent
Source§fn clone(&self) -> WebsocketFrameEvent
fn clone(&self) -> WebsocketFrameEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more