glyde/websocket/sendcode

A close code a client may put on the wire: 1000, or 3000 to 4999. Opaque so a socket cannot be closed with one RFC 6455 forbids.

Types

pub opaque type SendCode

Values

pub fn new(number: Int) -> Result(SendCode, Int)

The Error hands the number back.

pub const resume: SendCode

4000, the start of the application range.

pub const shutdown: SendCode

1000, normal closure.

pub fn to_int(code: SendCode) -> Int
Search Document