Mint.WebSocket.Extension.init

You're seeing just the callback init, go back to Mint.WebSocket.Extension module for more information.
Link to this callback

init(this_extension, all_extensions)

View Source

Specs

init(this_extension :: t(), all_extensions :: t()) ::
  {:ok, t()} | {:error, term()}

Invoked when the WebSocket server accepts an extension

This callback should be used to initialize any :state that the extension needs to operate. For example, this callback is used by the "permessage-deflate" extension to setup t::zlib.zstream()s and store them in state.

The all_extensions argument is passed so that the extension can know about the existence and ordering of other extensions. This can be useful if a client declares multiple extensions which accomplish the same job (such as multiple compression extensions) but want to only enable one based on what the server accepts.

Note that extensions are initialized in the order in which the server accepts them: any extensions preceeding this_extension in all_extensions are initialized while any extensions after this_extension are not yet initialized.

Error tuples bubble up to Mint.WebSocket.upgrade/4.