gramps/websocket
Types
pub type ControlFrame {
CloseFrame(payload_length: Int, payload: BitArray)
PingFrame(payload_length: Int, payload: BitArray)
PongFrame(payload_length: Int, payload: BitArray)
}
Constructors
-
CloseFrame(payload_length: Int, payload: BitArray)
-
PingFrame(payload_length: Int, payload: BitArray)
-
PongFrame(payload_length: Int, payload: BitArray)
pub type DataFrame {
TextFrame(payload_length: Int, payload: BitArray)
BinaryFrame(payload_length: Int, payload: BitArray)
}
Constructors
-
TextFrame(payload_length: Int, payload: BitArray)
-
BinaryFrame(payload_length: Int, payload: BitArray)
pub type Frame {
Data(DataFrame)
Control(ControlFrame)
Continuation(length: Int, payload: BitArray)
}
Constructors
-
Data(DataFrame)
-
Control(ControlFrame)
-
Continuation(length: Int, payload: BitArray)
pub type FrameParseError {
NeedMoreData(BitArray)
InvalidFrame
}
Constructors
-
NeedMoreData(BitArray)
-
InvalidFrame
pub type ParsedFrame {
Complete(Frame)
Incomplete(Frame)
}
Constructors
-
Complete(Frame)
-
Incomplete(Frame)
Constants
pub const client_key: String
Functions
pub fn aggregate_frames(
frames: List(ParsedFrame),
previous: Option(Frame),
joined: List(Frame),
) -> Result(List(Frame), Nil)
pub fn compressed_frame_to_bytes_tree(
frame: Frame,
context: Context,
mask: Option(BitArray),
) -> BytesTree
pub fn frame_from_message(
message: BitArray,
context: Option(Context),
) -> Result(#(ParsedFrame, BitArray), FrameParseError)
pub fn frame_to_bytes_tree(
frame: Frame,
mask: Option(BitArray),
) -> BytesTree
pub fn get_messages(
data: BitArray,
frames: List(ParsedFrame),
context: Option(Context),
) -> #(List(ParsedFrame), BitArray)
pub fn has_deflate(extensions: List(String)) -> Bool
pub fn parse_websocket_key(key: String) -> String
pub fn to_binary_frame(
data: BitArray,
context: Option(Context),
mask: Option(BitArray),
) -> BytesTree
pub fn to_text_frame(
data: String,
context: Option(Context),
mask: Option(BitArray),
) -> BytesTree