HTTP.WebSocket.ArrayBuffer (http_web_socket v0.10.0)

View Source

Explicit binary frame payload wrapper for HTTP.WebSocket.send/2.

Plain Elixir binaries are also strings, so HTTP.WebSocket.send/2 treats a bare binary as text. Wrap binary data with this struct when the WebSocket frame opcode must be binary.

Summary

Functions

Creates a new array buffer wrapper.

Types

t()

@type t() :: %HTTP.WebSocket.ArrayBuffer{
  byte_length: non_neg_integer(),
  data: binary()
}

Functions

new(data)

@spec new(binary()) :: t()

Creates a new array buffer wrapper.