Skip to main content

http_type/websocket_frame/
struct.rs

1use super::*;
2
3/// Represents a decoded WebSocket frame.
4#[derive(Clone, Debug, DisplayDebug, Eq, Getter, PartialEq)]
5pub struct WebSocketFrame {
6    /// FIN flag indicating if this is the final frame.
7    #[get(type(copy))]
8    pub fin: bool,
9    /// Opcode indicating the frame type (text, binary, etc.).
10    pub opcode: WebSocketOpcode,
11    /// Mask flag indicating if the payload is masked.
12    #[get(type(copy))]
13    pub mask: bool,
14    /// The payload data of the frame.
15    pub payload_data: Vec<u8>,
16}