Mint.WebSocket.encode

You're seeing just the function encode, go back to Mint.WebSocket module for more information.
Link to this function

encode(websocket, frame)

View Source

Specs

encode(t(), shorthand_frame() | frame()) ::
  {:ok, t(), binary()} | {:error, t(), any()}

Encodes a frame into a binary

The resulting binary may be sent with Mint.HTTP.stream_request_body/3.

This function will invoke the Mint.WebSocket.Extension.encode/2 callback for any accepted extensions.

Examples

{:ok, websocket, data} = Mint.WebSocket.encode(websocket, {:text, "hello world"})
{:ok, conn} = Mint.HTTP.stream_request_body(conn, ref, data)