Kern
On this page

Standard library reference

Generated by sh scripts/std-api.sh from std/: the public names of every module. A program imports a module with use std.<module> and calls it as <module>.<name>. The library is Kern source; its rules and tests run with kern test std.

use std.fmt
use std.json

fn main() {
    var out = fmt.builder(256)
    var state = json.tokens()
    json.begin_object(&mut out, &mut state)
    json.key(&mut out, &mut state, "ok")
    json.boolean(&mut out, &mut state, true)
    json.end_object(&mut out, &mut state)
    let body = json.to_owned(move out, move state)
    print(body)
    free(body)
}

std.bytes

pub enum ParseError { Empty, InvalidDigit, Overflow }
pub struct Splitter { value: []u8, separator: []u8, position: usize, done: bool }
pub const NOT_FOUND: usize = 18446744073709551615
pub fn to_lower(buffer: &mut []u8)
pub fn to_upper(buffer: &mut []u8)
pub fn equal_ignore_case(left: []u8, right: []u8) -> bool
pub fn clone(source: []u8) -> []u8
pub fn equal(left: []u8, right: []u8) -> bool
pub fn starts_with(value: []u8, prefix: []u8) -> bool
pub fn ends_with(value: []u8, suffix: []u8) -> bool
pub fn find_byte(value: []u8, byte: u8) -> usize
pub fn find(value: []u8, needle: []u8) -> usize
pub fn contains(value: []u8, needle: []u8) -> bool
pub fn parse_u64(text: []u8) -> u64 ! ParseError
pub fn parse_i64(text: []u8) -> i64 ! ParseError
pub fn split(value: []u8, separator: []u8) -> Splitter
pub fn split_next(parts: &mut Splitter, part: &mut []u8) -> bool
pub fn trim_start(value: []u8) -> []u8
pub fn trim_end(value: []u8) -> []u8
pub fn trim(value: []u8) -> []u8

std.cipher

pub enum AeadError { TooShort, Forged }
pub fn add32(left: u32, right: u32) -> u32
pub fn rotl32(value: u32, count: u32) -> u32
    requires ((count > 0) and (count < 32))
pub fn load32_le(bytes: []u8, offset: usize) -> u32
pub fn load32_be(bytes: []u8, offset: usize) -> u32
pub fn store32_le(out: &mut []u8, offset: usize, value: u32)
pub fn store32_be(out: &mut []u8, offset: usize, value: u32)
pub fn same_bytes(left: []u8, right: []u8) -> bool

std.collections

pub struct BytesMap[Value] { block: []u8, stored: usize, offsets: []usize, lengths: []usize, used: []u8, values: []Value, count: usize }
pub struct List[Value] { data: []Value, count: usize }
pub struct U64Map[Value] { keys: []u64, used: []u8, values: []Value, count: usize }
pub fn bytes_map[Value](capacity: usize) -> BytesMap[Value]
pub fn bytes_map_count[Value](map: BytesMap[Value]) -> usize
pub fn bytes_map_slots[Value](map: BytesMap[Value]) -> usize
pub fn bytes_map_release[Value](map: own BytesMap[Value])
pub fn bytes_hash(key: []u8) -> usize
pub fn bytes_map_mix(hash: usize, slots: usize) -> usize
pub fn bytes_equal_at[Value](map: BytesMap[Value], index: usize, key: []u8) -> bool
pub fn bytes_map_probe[Value](map: BytesMap[Value], key: []u8) -> usize
pub fn bytes_reserve[Value](map: &mut own BytesMap[Value], extra: usize)
pub fn bytes_store[Value](map: &mut BytesMap[Value], index: usize, key: []u8)
pub fn bytes_insert[Value](map: &mut own BytesMap[Value], index: usize, key: []u8, value: Value)
pub fn copy_key[Value](old: BytesMap[Value], index: usize, fresh: &mut BytesMap[Value])
pub fn bytes_rehash[Value](map: &mut own BytesMap[Value])
pub fn bytes_map_put[Value](map: &mut own BytesMap[Value], key: []u8, value: Value)
pub fn bytes_map_get[Value](map: BytesMap[Value], key: []u8, found: &mut bool) -> Value
pub fn bytes_map_has[Value](map: BytesMap[Value], key: []u8) -> bool
pub fn bytes_map_remove[Value](map: &mut BytesMap[Value], key: []u8) -> bool
pub fn bytes_map_key_at[Value](map: BytesMap[Value], index: usize, present: &mut bool) -> []u8
pub fn list_new[Value](capacity: usize) -> List[Value]
pub fn list_count[Value](list: List[Value]) -> usize
pub fn list_capacity[Value](list: List[Value]) -> usize
pub fn list_release[Value](list: own List[Value])
pub fn list_clear[Value](list: &mut List[Value])
pub fn list_reserve[Value](list: &mut own List[Value], extra: usize)
pub fn list_push[Value](list: &mut own List[Value], value: Value)
pub fn list_get[Value](list: List[Value], index: usize) -> Value
pub fn list_set[Value](list: &mut List[Value], index: usize, value: Value)
pub fn list_pop[Value](list: &mut List[Value]) -> Value
pub fn u64_map[Value](capacity: usize) -> U64Map[Value]
pub fn u64_map_slots[Value](map: U64Map[Value]) -> usize
pub fn u64_map_count[Value](map: U64Map[Value]) -> usize
pub fn u64_map_release[Value](map: own U64Map[Value])
pub fn mix(key: u64, slots: usize) -> usize
pub fn probe[Value](map: U64Map[Value], key: u64) -> usize
pub fn insert_slot[Value](map: &mut U64Map[Value], slot: usize, key: u64, value: Value)
pub fn rehash[Value](map: &mut own U64Map[Value])
pub fn u64_map_put[Value](map: &mut own U64Map[Value], key: u64, value: Value)
pub fn u64_map_has[Value](map: U64Map[Value], key: u64) -> bool
pub fn u64_map_get[Value](map: U64Map[Value], key: u64, found: &mut bool) -> Value
pub fn u64_map_remove[Value](map: &mut U64Map[Value], key: u64) -> bool
pub fn u64_map_clear[Value](map: &mut U64Map[Value])
pub fn u64_map_key_at[Value](map: U64Map[Value], index: usize, present: &mut bool) -> u64

std.compress

pub enum CompressError { Truncated, BadBlock, BadCode, BadDistance, BadHuffman, BadHeader, BadChecksum, BadLength, TooLarge }
pub fn crc32_update(crc: u32, data: []u8) -> u32
pub fn crc32(data: []u8) -> u32
pub fn deflate(data: []u8) -> []u8
pub fn gzip(data: []u8) -> []u8
pub fn gunzip(data: []u8, max_out: usize) -> []u8 ! CompressError
pub fn inflate_at(data: []u8, pos: &mut usize, max_out: usize) -> []u8 ! CompressError
pub fn inflate(data: []u8, max_out: usize) -> []u8 ! CompressError

std.crypto

pub enum KdfError { OutputTooLong, InvalidPrk, InvalidIterations, InvalidLength }
pub struct HmacSha256 { inner: Sha256, outer: Sha256 }
pub struct Sha256 { words: []u64, schedule: []u64, constants: []u64, buffer: []u8, fill: usize, total: u64 }
pub struct Sha512 { words: []u64, schedule: []u64, constants: []u64, buffer: []u8, fill: usize, total: u64 }
pub struct Sha384 { inner: Sha512 }
pub fn constant_time_eq(left: []u8, right: []u8) -> bool
pub fn erase(buffer: &mut []u8)
pub fn erase_free(buffer: own []u8)
pub fn erase_free32(buffer: own []u32)
pub fn erase_free64(buffer: own []u64)
pub fn hkdf_extract_sha256(salt: []u8, ikm: []u8) -> []u8
pub fn hkdf_expand_sha256(prk: []u8, info: []u8, length: usize) -> []u8 ! KdfError
pub fn hkdf_sha256(salt: []u8, ikm: []u8, info: []u8, length: usize) -> []u8 ! KdfError
pub fn hkdf_extract_sha384(salt: []u8, ikm: []u8) -> []u8
pub fn hkdf_expand_sha384(prk: []u8, info: []u8, length: usize) -> []u8 ! KdfError
pub fn hkdf_sha384(salt: []u8, ikm: []u8, info: []u8, length: usize) -> []u8 ! KdfError
pub fn hmac_sha256_init(key: []u8) -> HmacSha256
pub fn hmac_sha256_clone(ctx: HmacSha256) -> HmacSha256
pub fn hmac_sha256_update(ctx: &mut HmacSha256, data: []u8)
pub fn hmac_sha256_finish(ctx: HmacSha256) -> []u8
pub fn hmac_sha256_free(ctx: own HmacSha256)
pub fn hmac_sha256(key: []u8, message: []u8) -> []u8
pub fn hmac_sha384(key: []u8, message: []u8) -> []u8
pub fn hmac_sha512(key: []u8, message: []u8) -> []u8
pub fn pbkdf2_sha256(password: []u8, salt: []u8, iterations: u64, length: usize) -> []u8 ! KdfError
pub fn sha256_init() -> Sha256
pub fn sha256_clone(hasher: Sha256) -> Sha256
pub fn sha256_free(hasher: own Sha256)
pub fn sha256_update(hasher: &mut Sha256, data: []u8)
pub fn sha256_finish(hasher: Sha256) -> []u8
pub fn sha256(data: []u8) -> []u8
pub fn sha512_init() -> Sha512
pub fn sha384_init() -> Sha384
pub fn sha512_clone(hasher: Sha512) -> Sha512
pub fn sha384_clone(hasher: Sha384) -> Sha384
pub fn sha512_free(hasher: own Sha512)
pub fn sha384_free(hasher: own Sha384)
pub fn sha512_update(hasher: &mut Sha512, data: []u8)
pub fn sha384_update(hasher: &mut Sha384, data: []u8)
pub fn sha512_finish(hasher: Sha512) -> []u8
pub fn sha384_finish(hasher: Sha384) -> []u8
pub fn sha512(data: []u8) -> []u8
pub fn sha384(data: []u8) -> []u8

std.encoding

pub enum Base64 { Standard, StandardNoPad, Url, UrlNoPad }
pub enum EncodingError { InvalidChar, InvalidLength, InvalidPadding }
pub fn base64_encode(data: []u8, kind: Base64) -> []u8
pub fn base64_decode(text: []u8, kind: Base64) -> []u8 ! EncodingError
pub fn hex_encode(data: []u8) -> []u8
pub fn hex_decode(text: []u8) -> []u8 ! EncodingError
pub fn percent_encode(data: []u8) -> []u8
pub fn percent_decode(text: []u8) -> []u8 ! EncodingError
pub fn percent_decode_form(text: []u8) -> []u8 ! EncodingError

std.env

pub enum EnvError { Missing, Invalid }
pub fn get(name: []u8) -> []u8
pub fn get_or(name: []u8, fallback: []u8) -> []u8
pub fn is_set(name: []u8) -> bool
pub fn get_u64(name: []u8) -> u64 ! EnvError
pub fn required(name: []u8) -> []u8 ! EnvError

std.fmt

pub struct Builder { data: []u8, count: usize }
pub fn builder(capacity: usize) -> Builder
pub fn release(builder: own Builder)
pub fn to_owned(builder: own Builder) -> []u8
pub fn view(builder: Builder) -> []u8
pub fn clear(builder: &mut Builder)
pub fn append(builder: &mut own Builder, bytes: []u8)
pub fn append_byte(builder: &mut own Builder, byte: u8)
pub fn append_u64(builder: &mut own Builder, value: u64)
pub fn append_u64_padded(builder: &mut own Builder, value: u64, width: usize, pad: u8)
pub fn append_hex(builder: &mut own Builder, value: u64, width: usize)
pub fn append_i64(builder: &mut own Builder, value: i64)
pub fn append_i64_padded(builder: &mut own Builder, value: i64, width: usize, pad: u8)

std.grpc

pub struct Reply { code: u32, message: []u8, body: []u8, headers: http.Headers, trailers: http.Headers }
pub enum GrpcError { Truncated, Compressed, UnknownEncoding, BadCompression, TooLarge, BadContentType, BadStatus, BadRequest, Transport, Unexpected }
pub struct Message { compressed: bool, payload: []u8 }
pub struct Request { stream_id: u32, path: []u8, body: []u8, headers: http.Headers, has_deadline: bool, deadline_ms: u64 }
pub struct Stream { stream_id: u32, is_client: bool, path: []u8, headers: http.Headers, trailers: http.Headers, buf: fmt.Builder, pos: usize, ended: bool, has_deadline: bool, deadline_ms: u64, code: u32, message: []u8 }
pub struct Incoming { more: bool, payload: []u8 }
pub const DEFAULT_MAX_MESSAGE: usize = 4194304
pub const OK: u32 = 0
pub const CANCELLED: u32 = 1
pub const UNKNOWN: u32 = 2
pub const INVALID_ARGUMENT: u32 = 3
pub const DEADLINE_EXCEEDED: u32 = 4
pub const NOT_FOUND: u32 = 5
pub const ALREADY_EXISTS: u32 = 6
pub const PERMISSION_DENIED: u32 = 7
pub const RESOURCE_EXHAUSTED: u32 = 8
pub const FAILED_PRECONDITION: u32 = 9
pub const ABORTED: u32 = 10
pub const OUT_OF_RANGE: u32 = 11
pub const UNIMPLEMENTED: u32 = 12
pub const INTERNAL: u32 = 13
pub const UNAVAILABLE: u32 = 14
pub const DATA_LOSS: u32 = 15
pub const UNAUTHENTICATED: u32 = 16
pub fn reply_free(reply: own Reply)
pub fn open_call(conn: &mut own http2.Conn, authority: []u8, path: []u8, meta: http.Headers, timeout_ms: u64) -> Stream ! GrpcError
pub fn send_request(conn: &mut own http2.Conn, st: Stream, payload: []u8, timeout_ms: u64) ! GrpcError
pub fn send_request_with(conn: &mut own http2.Conn, st: Stream, payload: []u8, encoding: []u8, timeout_ms: u64) ! GrpcError
pub fn close_send(conn: &mut own http2.Conn, st: Stream, timeout_ms: u64) ! GrpcError
pub fn call_stream(conn: &mut own http2.Conn, st: own Stream, request: []u8, timeout_ms: u64) -> Reply ! GrpcError
pub fn call(conn: &mut own http2.Conn, authority: []u8, path: []u8, request: []u8, timeout_ms: u64) -> Reply ! GrpcError
pub fn unary_call(conn: &mut own http2.Conn, authority: []u8, path: []u8, request: []u8, timeout_ms: u64) -> Reply ! GrpcError
pub fn encode_message(payload: []u8) -> []u8
pub fn decode_message(buf: []u8, consumed: &mut usize, max_len: usize) -> Message ! GrpcError
pub fn next_message(buf: []u8, pos: &mut usize) -> []u8 ! GrpcError
pub fn metadata_add(headers: &mut own http.Headers, key: []u8, value: []u8) -> bool
pub fn metadata_get(headers: http.Headers, key: []u8, found: &mut bool) -> []u8
pub fn request_free(req: own Request)
pub fn peer_accepts_gzip(headers: http.Headers) -> bool
pub fn read_request(conn: &mut own http2.Conn, timeout_ms: u64) -> Request ! GrpcError
pub fn accept_stream(conn: &mut own http2.Conn, timeout_ms: u64) -> Stream ! GrpcError
pub fn send_head(conn: &mut own http2.Conn, stream_id: u32, timeout_ms: u64) ! GrpcError
pub fn send_head_meta(conn: &mut own http2.Conn, stream_id: u32, meta: http.Headers, timeout_ms: u64) ! GrpcError
pub fn send_message(conn: &mut own http2.Conn, stream_id: u32, payload: []u8, timeout_ms: u64) ! GrpcError
pub fn send_message_with(conn: &mut own http2.Conn, stream_id: u32, payload: []u8, encoding: []u8, timeout_ms: u64) ! GrpcError
pub fn send_trailers(conn: &mut own http2.Conn, stream_id: u32, code: u32, message: []u8, timeout_ms: u64) ! GrpcError
pub fn send_trailers_meta(conn: &mut own http2.Conn, stream_id: u32, trailers: http.Headers, timeout_ms: u64) ! GrpcError
pub fn reply_unary(conn: &mut own http2.Conn, stream_id: u32, payload: []u8, timeout_ms: u64) ! GrpcError
pub fn reply_unary_with(conn: &mut own http2.Conn, stream_id: u32, payload: []u8, encoding: []u8, timeout_ms: u64) ! GrpcError
pub fn reply_error(conn: &mut own http2.Conn, stream_id: u32, code: u32, message: []u8, timeout_ms: u64) ! GrpcError
pub fn status_name(code: u32) -> []u8
pub fn message_encode(text: []u8) -> []u8
pub fn message_decode(text: []u8) -> []u8
pub fn add_status_trailers(headers: &mut own http.Headers, code: u32, message: []u8)
pub fn read_code(headers: http.Headers, code: &mut u32) -> bool
pub fn read_message(headers: http.Headers) -> []u8
pub fn stream_free(st: own Stream)
pub fn incoming_free(msg: own Incoming)
pub fn recv_message(conn: &mut own http2.Conn, st: &mut own Stream, timeout_ms: u64) -> Incoming ! GrpcError

std.http

pub struct ClientConfig { limits: Limits, has_proxy: bool, proxy: net.Address }
pub struct ClientConn { fd: i64, poller: net.Poller, state: u8, write_buf: []u8, write_pos: usize, read_buf: []u8, read_len: usize, last_active_ms: u64, limits: Limits, head_only: bool, saw_eof: bool, poll_events: []net.PollEvent }
pub struct Request { method: []u8, target: []u8, version_minor: u8, headers: Headers, body: []u8, keep_alive: bool }
pub struct Response { status: u64, reason: []u8, version_minor: u8, headers: Headers, body: []u8, keep_alive: bool, chunked: bool }
pub struct ServerPool { fds: []i64, states: []u8, write_pos: []usize, last_active: []u64, req_start: []u64, read_data: []u8, read_stored: usize, read_meta: []usize, write_data: []u8, write_stored: usize, write_meta: []usize, queued_bytes: usize }
pub struct RouteMatch { matched: bool, route_id: u64, status: u64, params: Headers }
pub struct Router { block: []u8, stored: usize, method_offs: []usize, method_lens: []usize, pattern_offs: []usize, pattern_lens: []usize, route_ids: []u64, count: usize }
pub interface Handler[Context] {
    fn handle(context: &mut Context, request: Request) -> Response
}
pub struct Server { poller: net.Poller, listener_fd: i64, port: u64, limits: Limits, shutting_down: bool, shutdown_deadline_ms: u64, active_count: usize, accept_retry_ms: u64, poll_events: []net.PollEvent, poll_ready: usize, poll_next: usize, pool: ServerPool }
pub enum HttpError { Incomplete, Malformed, HeadersTooLarge, BodyTooLarge, BadFraming, Timeout, ConnectionClosed, Network, InvalidUrl, UnsupportedVersion, InvalidArgument }
pub struct Limits { max_header_count: usize, max_header_bytes: usize, max_line_bytes: usize, max_body_bytes: usize, read_timeout_ms: u64, write_timeout_ms: u64, idle_timeout_ms: u64, min_write_rate: u64, max_connections: usize, max_queued_bytes: usize }
pub struct Headers { block: []u8, stored: usize, name_offsets: []usize, name_lengths: []usize, value_offsets: []usize, value_lengths: []usize, count: usize }
pub fn encode_chunked(data: []u8, chunk_size: usize) -> []u8
pub fn client_default() -> ClientConfig
pub fn client_with_proxy(proxy: net.Address, limits: Limits) -> ClientConfig
pub fn client_start(config: ClientConfig, method: []u8, url: []u8, headers: Headers, body: []u8) -> ClientConn ! HttpError
pub fn client_step(conn: &mut own ClientConn, timeout_ms: i64) -> bool ! HttpError
pub fn client_close(conn: own ClientConn)
pub fn client_finish(conn: own ClientConn) -> Response ! HttpError
pub fn request_new(method: []u8, target: []u8) -> Request
pub fn request_release(request: own Request)
pub fn request_path(request: Request) -> []u8
pub fn request_query(request: Request) -> []u8
pub fn request_set_body(request: &mut own Request, body: []u8)
pub fn response_new(status: u64) -> Response
pub fn response_text(status: u64, body: []u8) -> Response
pub fn response_set_body(response: &mut own Response, body: []u8)
pub fn response_release(response: own Response)
pub fn parse_request(data: []u8, limits: Limits, consumed: &mut usize) -> Request ! HttpError
pub fn parse_response(data: []u8, limits: Limits, consumed: &mut usize) -> Response ! HttpError
pub fn server_next_request(server: &mut own Server, timeout_ms: i64, slot_out: &mut usize) -> Request ! HttpError
pub fn server_step[Context: Handler](server: &mut own Server, context: &mut Context, timeout_ms: i64) -> bool ! HttpError
pub fn server_serve[Context: Handler](server: &mut own Server, context: &mut Context, grace_ms: u64) ! HttpError
pub fn client_request(config: ClientConfig, method: []u8, url: []u8, headers: Headers, body: []u8) -> Response ! HttpError
pub fn client_get(config: ClientConfig, url: []u8) -> Response ! HttpError
pub fn client_post(config: ClientConfig, url: []u8, content_type: []u8, body: []u8) -> Response ! HttpError
pub fn router_new() -> Router
pub fn router_release(router: own Router)
pub fn router_add(router: &mut own Router, method: []u8, pattern: []u8, route_id: u64)
pub fn router_match(router: Router, method: []u8, path: []u8) -> RouteMatch
pub fn route_param(found: RouteMatch, name: []u8) -> []u8
pub fn route_match_release(found: own RouteMatch)
pub fn router_allowed(router: Router, path: []u8) -> []u8
pub fn serialize_request(request: Request, host_header: []u8, close_conn: bool) -> []u8
pub fn serialize_response(response: Response) -> []u8
pub fn server_listen(address: net.Address, limits: Limits) -> Server ! HttpError
pub fn server_listen_fd(listener: i64, limits: Limits) -> Server ! HttpError
pub fn server_begin_shutdown(server: &mut Server, grace_ms: u64)
pub fn server_respond(server: &mut own Server, slot: usize, response: own Response, req_keep_alive: bool)
pub fn server_close(server: own Server)
pub fn router_handle(router: &mut Router, req: Request) -> Response
pub fn default_limits() -> Limits
pub fn headers_new() -> Headers
pub fn headers_release(headers: own Headers)
pub fn headers_add(headers: &mut own Headers, name: []u8, value: []u8)
pub fn headers_set(headers: &mut own Headers, name: []u8, value: []u8)
pub fn headers_name_at(headers: Headers, index: usize) -> []u8
pub fn headers_value_at(headers: Headers, index: usize) -> []u8
pub fn headers_get(headers: Headers, name: []u8, found: &mut bool) -> []u8
pub fn headers_has(headers: Headers, name: []u8) -> bool

std.http2

pub struct Response { status: u64, headers: http.Headers, body: []u8, trailers: http.Headers }
pub struct WireRx { buf: fmt.Builder, pos: usize, fd: i64 }
pub struct ConnFlow { send_win: i64, recv_win: i64, recv_unacked: i64, next_stream_id: u32, last_remote_id: u32, goaway_received: bool, goaway_last_id: u32, goaway_err: u32, ping_acks: u64, settings_acks: u64, peer_closed: bool, is_client: bool }
pub struct HeaderRx { stream_id: u32, end_stream: bool, buf: fmt.Builder }
pub struct Conn { kind: TransportKind, tls_cli: tls.TlsTcp, tls_srv: server.ServerConn, local_settings: Settings, peer_settings: Settings, enc: hpack.Context, dec: hpack.Context, rx: WireRx, streams: StreamTable, events: EventQueue, flow: ConnFlow, hdr_rx: HeaderRx }
pub enum H2Error { Incomplete, ProtocolError, FrameSizeError, FlowControlError, CompressionError, StreamClosed, RefusedStream, Cancel, Goaway, Timeout, Closed, Network, TlsError, AlpnMismatch, InvalidArgument }
pub enum FrameKind { Data, Headers, Priority, RstStream, Settings, PushPromise, Ping, Goaway, WindowUpdate, Continuation, Unknown }
pub enum StreamState { Idle, Open, HalfClosedLocal, HalfClosedRemote, Closed }
pub struct Frame { kind: FrameKind, raw_type: u8, flags: u8, stream_id: u32, payload: []u8 }
pub struct Settings { header_table_size: u32, enable_push: bool, max_concurrent_streams: u32, initial_window_size: u32, max_frame_size: u32, max_header_list_size: u32 }
pub enum EventKind { None, Headers, Data, Trailers, RstStream, Goaway, Closed }
pub struct Event { kind: EventKind, stream_id: u32, end_stream: bool, error_code: u32, headers: http.Headers, data: []u8 }
pub struct StreamSlot { id: u32, state: StreamState, send_win: i64, recv_win: i64, recv_unacked: i64, got_headers: bool }
pub struct QueuedEvent { kind: EventKind, stream_id: u32, end_stream: bool, error_code: u32, off: usize, len: usize }
pub struct EventQueue { items: []QueuedEvent, count: usize, head: usize, blob: fmt.Builder }
pub struct StreamTable { items: []StreamSlot, count: usize }
pub enum TransportKind { Plain, TlsClient, TlsServer }
pub const DEFAULT_WINDOW_SIZE: i64 = 65535
pub const DEFAULT_MAX_FRAME_SIZE: usize = 16384
pub fn response_free(resp: own Response)
pub fn client_connect_tcp(addr: net.Address, timeout_ms: u64) -> Conn ! H2Error
pub fn client_connect_tls(addr: net.Address, cfg: tls.TlsConfig, timeout_ms: u64) -> Conn ! H2Error
pub fn server_accept_tcp(fd: i64, timeout_ms: u64) -> Conn ! H2Error
pub fn server_accept_tls(fd: i64, cfg: server.ServerConfig, timeout_ms: u64) -> Conn ! H2Error
pub fn client_request(conn: &mut own Conn, headers: http.Headers, body: []u8, timeout_ms: u64) -> Response ! H2Error
pub fn conn_free(conn: own Conn)
pub fn conn_step(conn: &mut own Conn, timeout_ms: u64) -> bool ! H2Error
pub fn conn_next_event(conn: &mut own Conn, stream_id: u32, timeout_ms: u64) -> Event ! H2Error
pub fn default_settings() -> Settings
pub fn wire_error_code(err_val: H2Error) -> u32
pub fn encode_frame(kind: FrameKind, flags: u8, stream_id: u32, payload: []u8) -> []u8 ! H2Error
pub fn decode_frame(buf: []u8, max_frame_size: usize, consumed: &mut usize) -> Frame ! H2Error
pub fn conn_open_stream(conn: &mut own Conn, headers: http.Headers, end_stream: bool, timeout_ms: u64) -> u32 ! H2Error
pub fn conn_send_headers(conn: &mut own Conn, stream_id: u32, headers: http.Headers, end_stream: bool, timeout_ms: u64) ! H2Error
pub fn conn_send_data(conn: &mut own Conn, stream_id: u32, data: []u8, end_stream: bool, timeout_ms: u64) ! H2Error
pub fn conn_send_ping(conn: &mut own Conn, opaque: []u8, timeout_ms: u64) ! H2Error
pub fn conn_send_rst_stream(conn: &mut own Conn, stream_id: u32, error_code: u32, timeout_ms: u64) ! H2Error
pub fn conn_send_goaway(conn: &mut own Conn, error_code: u32, debug: []u8, timeout_ms: u64) ! H2Error
pub fn conn_send_window_update(conn: &mut own Conn, stream_id: u32, increment: u32, timeout_ms: u64) ! H2Error
pub fn event_free(ev: own Event)

std.json

pub enum Token { Nothing, BeginObject, EndObject, BeginArray, EndArray, Key(usize, usize), String(usize, usize), Number(i64), Truth, Falsity, Null, Finished }
pub enum JsonError { Unexpected(u8), UnterminatedString, BadEscape, BadNumber, TooDeep, TooLong, TooLarge, TooManyValues, UnexpectedEof, InvalidSyntax, InvalidEscape, InvalidNumber, TrailingData, TypeMismatch }
pub struct Reader { position: usize, depth: usize, limit: usize, object: []bool, key_next: bool }
pub struct Document { nodes: collections.List[Node], items: collections.List[usize], entries: collections.List[Entry], text: fmt.Builder, root: usize }
pub enum ValueKind { Null, Bool, Int, Number, String, Array, Object }
pub struct Limits { max_depth: usize, max_bytes: usize, max_values: usize }
pub struct Value { index: usize }
pub struct Node { kind: ValueKind, flag: bool, int_val: i64, start: usize, length: usize }
pub struct Entry { key_start: usize, key_len: usize, value: usize }
pub struct Tokens { depth: usize, first: []bool }
pub const MAX_DEPTH: usize = 32
pub const MAX_STRING: usize = 65536
pub fn emit_null(out: &mut own fmt.Builder)
pub fn emit_bool(out: &mut own fmt.Builder, value: bool)
pub fn emit_int(out: &mut own fmt.Builder, value: i64)
pub fn emit_string(out: &mut own fmt.Builder, value: []u8)
pub fn emit_into(doc: Document, val: Value, out: &mut own fmt.Builder)
pub fn emit_value(doc: Document, val: Value) -> []u8
pub fn emit(doc: Document) -> []u8
pub fn parse(input: []u8) -> Document ! JsonError
pub fn parse_with_limits(input: []u8, limits: Limits) -> Document ! JsonError
pub fn reader() -> Reader
pub fn reader_release(reader: own Reader)
pub fn reader_depth(reader: Reader) -> usize
pub fn next(reader: &mut Reader, text: []u8) -> Token ! JsonError
pub fn decode_string(text: []u8, start: usize, end: usize) -> []u8 ! JsonError
pub fn document_release(doc: own Document)
pub fn root(doc: Document) -> Value
pub fn kind(doc: Document, val: Value) -> ValueKind
pub fn as_bool(doc: Document, val: Value) -> bool ! JsonError
pub fn as_i64(doc: Document, val: Value) -> i64 ! JsonError
pub fn as_number_text(doc: Document, val: Value) -> []u8 ! JsonError
pub fn as_string(doc: Document, val: Value) -> []u8 ! JsonError
pub fn array_len(doc: Document, val: Value) -> usize ! JsonError
pub fn array_at(doc: Document, val: Value, index: usize) -> Value ! JsonError
pub fn object_len(doc: Document, val: Value) -> usize ! JsonError
pub fn object_key_at(doc: Document, val: Value, index: usize) -> []u8 ! JsonError
pub fn object_value_at(doc: Document, val: Value, index: usize) -> Value ! JsonError
pub fn object_get(doc: Document, val: Value, key: []u8, found: &mut bool) -> Value ! JsonError
pub fn default_limits() -> Limits
pub fn tokens() -> Tokens
pub fn tokens_release(state: own Tokens)
pub fn to_owned(out: own fmt.Builder, state: own Tokens) -> []u8
pub fn begin_object(out: &mut own fmt.Builder, state: &mut Tokens)
pub fn end_object(out: &mut own fmt.Builder, state: &mut Tokens)
pub fn begin_array(out: &mut own fmt.Builder, state: &mut Tokens)
pub fn end_array(out: &mut own fmt.Builder, state: &mut Tokens)
pub fn key(out: &mut own fmt.Builder, state: &mut Tokens, name: []u8)
pub fn text(out: &mut own fmt.Builder, state: &mut Tokens, value: []u8)
pub fn integer(out: &mut own fmt.Builder, state: &mut Tokens, value: i64)
pub fn raw_number(out: &mut own fmt.Builder, state: &mut Tokens, value: []u8)
pub fn boolean(out: &mut own fmt.Builder, state: &mut Tokens, value: bool)
pub fn nothing(out: &mut own fmt.Builder, state: &mut Tokens)
pub fn quote(out: &mut own fmt.Builder, value: []u8)

std.log

pub enum Level { Debug, Info, Warn, Error }
pub struct Line { buffer: []u8, length: usize, enabled: bool }
pub enum TraceError { InvalidFormat, UnsupportedVersion, InvalidHex, ZeroTraceId, ZeroSpanId }
pub struct TraceContext { trace_id: []u8, span_id: []u8, flags: u8 }
pub const TRACE_FLAG_SAMPLED: u8 = 1
pub fn start(level: Level, msg: []u8) -> Line
pub fn add_text(line: &mut Line, key: []u8, value: []u8)
pub fn add_int(line: &mut Line, key: []u8, value: i64)
pub fn finish(line: own Line) -> []u8
pub fn emit(line: own Line) -> bool
pub fn trace_release(ctx: own TraceContext)
pub fn trace_is_sampled(ctx: TraceContext) -> bool
pub fn parse_traceparent(header: []u8) -> TraceContext ! TraceError
pub fn new_trace() -> TraceContext
pub fn child_span(parent: TraceContext) -> TraceContext
pub fn format_traceparent(ctx: TraceContext) -> []u8
pub fn add_trace(line: &mut Line, ctx: TraceContext)

std.metrics

pub struct Counter { value: u64 }
pub struct Gauge { value: f64 }
pub struct Histogram { bounds: []f64, counts: []u64, sum: f64, count: u64 }
pub struct CounterHandle { id: usize }
pub struct GaugeHandle { id: usize }
pub struct HistogramHandle { id: usize }
pub struct Registry { text: fmt.Builder, families: collections.List[MetricFamily], series: collections.List[MetricSeries], labels: collections.List[LabelSlot], counters: collections.List[Counter], gauges: collections.List[Gauge], histograms: collections.List[HistogramSlot], hist_bounds: collections.List[f64], hist_counts: collections.List[u64] }
pub enum MetricKind { Counter, Gauge, Histogram }
pub struct MetricFamily { name_off: usize, name_len: usize, help_off: usize, help_len: usize, kind: MetricKind }
pub struct MetricSeries { family_id: usize, label_start: usize, label_count: usize, slot_id: usize }
pub struct LabelSlot { name_off: usize, name_len: usize, val_off: usize, val_len: usize }
pub struct HistogramSlot { bounds_start: usize, bounds_len: usize, counts_start: usize, sum: f64, count: u64 }
pub enum MetricsError { InvalidName, InvalidLabelName, InvalidBuckets, DuplicateMetric, InvalidHandle, TypeMismatch }
pub struct Label { name: []u8, value: []u8 }
pub fn counter_new() -> Counter
pub fn counter_inc(counter: &mut Counter)
pub fn counter_add(counter: &mut Counter, delta: u64)
pub fn counter_value(counter: Counter) -> u64
pub fn gauge_new() -> Gauge
pub fn gauge_set(gauge: &mut Gauge, value: f64)
pub fn gauge_inc(gauge: &mut Gauge)
pub fn gauge_dec(gauge: &mut Gauge)
pub fn gauge_add(gauge: &mut Gauge, delta: f64)
pub fn gauge_value(gauge: Gauge) -> f64
pub fn histogram_new(bounds: []f64) -> Histogram ! MetricsError
pub fn histogram_release(hist: own Histogram)
pub fn histogram_observe(hist: &mut Histogram, value: f64)
pub fn histogram_count(hist: Histogram) -> u64
pub fn histogram_sum(hist: Histogram) -> f64
pub fn histogram_bucket_count(hist: Histogram, index: usize) -> u64
pub fn registry_new() -> Registry
pub fn registry_release(reg: own Registry)
pub fn register_counter(reg: &mut own Registry, name: []u8, help: []u8, labels: []Label) -> CounterHandle ! MetricsError
pub fn register_gauge(reg: &mut own Registry, name: []u8, help: []u8, labels: []Label) -> GaugeHandle ! MetricsError
pub fn register_histogram(reg: &mut own Registry, name: []u8, help: []u8, labels: []Label, bounds: []f64) -> HistogramHandle ! MetricsError
pub fn registry_counter_inc(reg: &mut Registry, handle: CounterHandle) ! MetricsError
pub fn registry_counter_add(reg: &mut Registry, handle: CounterHandle, delta: u64) ! MetricsError
pub fn registry_counter_value(reg: Registry, handle: CounterHandle) -> u64 ! MetricsError
pub fn registry_gauge_set(reg: &mut Registry, handle: GaugeHandle, value: f64) ! MetricsError
pub fn registry_gauge_inc(reg: &mut Registry, handle: GaugeHandle) ! MetricsError
pub fn registry_gauge_dec(reg: &mut Registry, handle: GaugeHandle) ! MetricsError
pub fn registry_gauge_add(reg: &mut Registry, handle: GaugeHandle, delta: f64) ! MetricsError
pub fn registry_gauge_value(reg: Registry, handle: GaugeHandle) -> f64 ! MetricsError
pub fn registry_histogram_observe(reg: &mut Registry, handle: HistogramHandle, value: f64) ! MetricsError
pub fn registry_histogram_count(reg: Registry, handle: HistogramHandle) -> u64 ! MetricsError
pub fn registry_histogram_sum(reg: Registry, handle: HistogramHandle) -> f64 ! MetricsError
pub fn render(reg: Registry) -> []u8
pub fn label(name: []u8, value: []u8) -> Label
pub fn is_valid_metric_name(name: []u8) -> bool
pub fn is_valid_label_name(name: []u8) -> bool
pub fn escape_label_value(value: []u8) -> []u8

std.mqtt

pub struct Client { conn: tls.TlsTcp, secure: bool, core: Core }
pub struct Timers { keep_alive_ms: u64, last_tx_ms: u64, ping_ms: u64, ping_out: bool }
pub struct Core { rbuf: []u8, rlen: usize, consumed: usize, wbuf: Out, inflight: []u32, timers: Timers, next_id: u16, high_id: u16, max_packet: usize, closed: bool, session: bool }
pub struct Out { data: []u8, count: usize }
pub struct Message { topic: []u8, payload: []u8, qos: u8, retain: bool }
pub enum MqttError { InvalidArgument, Unsupported, Resolve, Io, Timeout, Closed, Tls, Certificate, Protocol, TooLarge, InflightFull, RefusedVersion, RefusedIdentifier, RefusedServer, RefusedCredentials, RefusedAuthorization }
pub enum EventKind { Idle, Message, PubAck, SubAck, UnsubAck, PingResp }
pub struct Event { kind: EventKind, packet_id: u16, qos: u8, dup: bool, retain: bool, code: u8, topic_off: usize, topic_len: usize, payload_off: usize, payload_len: usize }
pub struct Will { topic: []u8, payload: []u8, qos: u8, retain: bool }
pub struct Config { host: []u8, port: u64, client_id: []u8, username: []u8, password: []u8, will: Will, keep_alive_s: u64, clean_session: bool, max_packet: usize, timeout_ms: u64, max_inflight: usize }
pub fn connect(cfg: Config) -> Client ! MqttError
pub fn connect_tls(cfg: Config, tls_cfg: tls.TlsConfig) -> Client ! MqttError
pub fn publish(c: &mut own Client, msg: Message) -> u16 ! MqttError
pub fn publish_dup(c: &mut own Client, msg: Message, id: u16) ! MqttError
pub fn subscribe(c: &mut own Client, filter: []u8, qos: u8) -> u16 ! MqttError
pub fn unsubscribe(c: &mut own Client, filter: []u8) -> u16 ! MqttError
pub fn poll(c: &mut own Client, wait_ms: u64) -> Event ! MqttError
pub fn event_topic(c: Client, ev: Event) -> []u8
pub fn event_payload(c: Client, ev: Event) -> []u8
pub fn session_present(c: Client) -> bool
pub fn is_open(c: Client) -> bool
pub fn close(c: own Client)
pub fn config(host: []u8, port: u64, client_id: []u8) -> Config

std.net

pub struct Address { version: u64, high: u64, low: u64, port: u64 }
pub enum NetError { Invalid, Blocked, Failed, Timeout, NotFound }
pub struct ResolvConfig { nameservers: []Address, search: []u8 }
pub enum DnsError { InvalidHost, InvalidPacket, NotFound, ServerFailure, Refused, FormatError, Timeout, NetworkFailed, NoNameservers }
pub struct PollEvent { fd: i64, events: u64 }
pub struct Poller { fd: i64, buffer: []u8 }
pub const DNS_PORT: u64 = 53
pub const QTYPE_A: u16 = 1
pub const QTYPE_AAAA: u16 = 28
pub const QCLASS_IN: u16 = 1
pub const POLL_READ: u64 = 1
pub const POLL_WRITE: u64 = 2
pub const POLL_ERROR: u64 = 4
pub const POLL_HUP: u64 = 8
pub fn parse_ip(text: []u8, port: u64) -> Address ! NetError
pub fn resolv_config_release(config: own ResolvConfig)
pub fn lookup_hosts_text(contents: []u8, host: []u8) -> []Address
pub fn lookup_hosts(host: []u8) -> []Address
pub fn parse_resolv_conf(contents: []u8) -> ResolvConfig
pub fn read_resolv_conf() -> ResolvConfig
pub fn send_query(descriptor: i64, server: Address, host: []u8, qtype: u16) -> u16 ! DnsError
pub fn receive_response(descriptor: i64, expected_id: u16, port: u64, timeout_ms: u64) -> []Address ! DnsError
pub fn resolve_with_server(server: Address, host: []u8, timeout_ms: u64) -> []Address ! DnsError
pub fn resolve(host: []u8, port: u64) -> []Address ! DnsError
pub fn encode_query(id: u16, host: []u8, qtype: u16) -> []u8 ! DnsError
pub fn decode_response(packet: []u8, expected_id: u16, port: u64) -> []Address ! DnsError
pub fn format_address(address: Address) -> []u8
pub fn poller_open() -> Poller ! NetError
pub fn poller_close(poller: own Poller) -> bool
pub fn poller_add(poller: Poller, fd: i64, events: u64) -> bool
pub fn poller_modify(poller: Poller, fd: i64, events: u64) -> bool
pub fn poller_remove(poller: Poller, fd: i64) -> bool
pub fn poller_poll(poller: &mut Poller, out: &mut []PollEvent, timeout_ms: i64) -> usize ! NetError
pub fn bind(address: Address, datagram: bool) -> i64 ! NetError
pub fn bind_shared(address: Address, datagram: bool) -> i64 ! NetError
pub fn connect(address: Address) -> i64 ! NetError
pub fn accept(listener: i64) -> i64 ! NetError
pub fn local_address(descriptor: i64) -> Address ! NetError
pub fn send(descriptor: i64, bytes: []u8, to: Address) -> usize ! NetError
pub fn receive(descriptor: i64, buffer: &mut []u8, from: &mut Address) -> usize ! NetError

std.postgres

pub struct Connection { fd: i64, tx_status: u8, backend_pid: i32, backend_secret: i32, timeout_ms: u64, read_buf: []u8, read_pos: usize, read_end: usize, closed: bool, broken: bool, cleartext_ok: bool, tls_stream: ssl.TlsStream }
pub enum PgErrorKind { Connection, Timeout, Protocol, Auth, UnsupportedAuth, Syntax, UniqueViolation, ForeignKeyViolation, NotNullViolation, CheckViolation, Serialization, Deadlock, DataException, Server, PoolExhausted, Closed }
pub struct PgError { kind: PgErrorKind, severity: []u8, code: []u8, message: []u8, detail: []u8, hint: []u8, constraint: []u8 }
pub struct Params { data: fmt.Builder, offsets: collections.List[usize], lengths: collections.List[usize], nulls: collections.List[u8], formats: collections.List[u16] }
pub struct PreparedStmt { name: []u8, param_oids: collections.List[u32], col_names: fmt.Builder, columns: collections.List[ColumnMeta] }
pub struct IdleSlot { fd: i64, tx_status: u8, backend_pid: i32, backend_secret: i32, timeout_ms: u64 }
pub struct Pool { cfg: Config, idle: []IdleSlot, idle_count: usize, active: usize, max_size: usize }
pub struct QueryResult { col_names: fmt.Builder, columns: collections.List[ColumnMeta], cell_data: fmt.Builder, cell_offsets: collections.List[usize], cell_lengths: collections.List[usize], cell_nulls: collections.List[u8], row_count: usize, command_tag: []u8 }
pub struct Config { host: []u8, port: u64, user: []u8, password: []u8, database: []u8, app_name: []u8, timeout_ms: u64, is_unix: bool, ssl_mode: ssl.SslMode, ssl_root_cert_pem: []u8 }
pub enum Value { Null, Bool(bool), Int64(i64), Text([]u8), Bytes([]u8) }
pub struct ColumnMeta { name_offset: usize, name_len: usize, table_oid: u32, column_attr: i32, type_oid: u32, type_size: i32, type_mod: i32, format_code: u16 }
pub const OID_BOOL: u32 = 16
pub const OID_BYTEA: u32 = 17
pub const OID_INT8: u32 = 20
pub const OID_INT2: u32 = 21
pub const OID_INT4: u32 = 23
pub const OID_TEXT: u32 = 25
pub const OID_VARCHAR: u32 = 1043
pub fn connect(cfg: Config) -> Connection ! PgError
pub fn close(conn: own Connection)
pub fn tx_status(conn: Connection) -> u8
pub fn backend_pid(conn: Connection) -> i32
pub fn pg_error_free(problem: own PgError)
pub fn classify_sqlstate(code: []u8) -> PgErrorKind
pub fn params_new() -> Params
pub fn params_free(params: own Params)
pub fn params_add_null(params: &mut own Params)
pub fn params_add_text(params: &mut own Params, value: []u8)
pub fn params_add_binary(params: &mut own Params, value: []u8)
pub fn params_add_i64(params: &mut own Params, value: i64)
pub fn params_add_bool(params: &mut own Params, value: bool)
pub fn prepared_free(stmt: own PreparedStmt)
pub fn hmac_sha256(key: []u8, message: []u8) -> []u8
pub fn pbkdf2_sha256(password: []u8, salt: []u8, iterations: u64, dk_len: usize) -> []u8 ! PgError
pub fn pool_new(cfg: Config, max_size: usize) -> Pool ! PgError
pub fn pool_idle(pool: Pool) -> usize
pub fn pool_acquire(pool: &mut own Pool) -> Connection ! PgError
pub fn pool_release(pool: &mut own Pool, conn: own Connection)
pub fn pool_close(pool: own Pool)
pub fn query(conn: &mut own Connection, sql: []u8) -> QueryResult ! PgError
pub fn query_params(conn: &mut own Connection, sql: []u8, params: Params) -> QueryResult ! PgError
pub fn prepare(conn: &mut own Connection, name: []u8, sql: []u8, param_oids: []u32) -> PreparedStmt ! PgError
pub fn execute_prepared(conn: &mut own Connection, stmt_name: []u8, params: Params) -> QueryResult ! PgError
pub fn close_stmt(conn: &mut own Connection, stmt_name: []u8) ! PgError
pub fn ping(conn: &mut own Connection) ! PgError
pub fn cancel(cfg: Config, pid: i32, secret: i32) ! PgError
pub fn result_free(res: own QueryResult)
pub fn result_column_count(res: QueryResult) -> usize
pub fn result_row_count(res: QueryResult) -> usize
pub fn result_column_name(res: QueryResult, col: usize) -> []u8
pub fn result_column_oid(res: QueryResult, col: usize) -> u32
pub fn result_command_tag(res: QueryResult) -> []u8
pub fn result_is_null(res: QueryResult, row: usize, col: usize) -> bool
pub fn result_value(res: QueryResult, row: usize, col: usize) -> Value ! PgError
pub fn result_get_i64(res: QueryResult, row: usize, col: usize) -> i64 ! PgError
pub fn result_get_bytes(res: QueryResult, row: usize, col: usize) -> []u8 ! PgError
pub fn config_tcp(host: []u8, port: u64, user: []u8, password: []u8, database: []u8) -> Config
pub fn config_unix(socket_path: []u8, user: []u8, password: []u8, database: []u8) -> Config
pub fn decode_bytea(raw: []u8, format: u16) -> []u8 ! PgError
pub fn decode_value(oid: u32, format: u16, raw: []u8, is_null: bool) -> Value ! PgError

std.proto

pub enum WireType { Varint, Fixed64, LengthDelimited, StartGroup, EndGroup, Fixed32 }
pub enum ProtoError { Truncated, VarintOverflow, InvalidTag, InvalidWireType, WireTypeMismatch, LengthOverflow, TooDeep, InvalidGroup, InvalidUtf8 }
pub struct Tag { field: u32, wire: WireType }
pub struct Writer { out: fmt.Builder }
pub struct Reader { data: []u8, pos: usize }
pub fn f64_to_bits(value: f64) -> u64
pub fn bits_to_f64(bits: u64) -> f64
pub fn read_f64(reader: &mut Reader) -> f64 ! ProtoError
pub fn write_f64_field(writer: &mut own Writer, field: u32, value: f64) ! ProtoError
pub fn write_bytes_field(writer: &mut own Writer, field: u32, data: []u8) ! ProtoError
pub fn write_string_field(writer: &mut own Writer, field: u32, text: []u8) ! ProtoError
pub fn write_message_field(writer: &mut own Writer, field: u32, encoded: []u8) ! ProtoError
pub fn read_bytes(reader: &mut Reader) -> []u8 ! ProtoError
pub fn read_string(reader: &mut Reader) -> []u8 ! ProtoError
pub fn read_submessage(reader: &mut Reader) -> Reader ! ProtoError
pub fn write_packed_u64(writer: &mut own Writer, field: u32, values: []u64) ! ProtoError
pub fn write_packed_sint64(writer: &mut own Writer, field: u32, values: []i64) ! ProtoError
pub fn write_packed_fixed32(writer: &mut own Writer, field: u32, values: []u32) ! ProtoError
pub fn write_packed_fixed64(writer: &mut own Writer, field: u32, values: []u64) ! ProtoError
pub fn read_i64(reader: &mut Reader) -> i64 ! ProtoError
pub fn read_sint64(reader: &mut Reader) -> i64 ! ProtoError
pub fn read_bool(reader: &mut Reader) -> bool ! ProtoError
pub fn read_fixed32(reader: &mut Reader) -> u32 ! ProtoError
pub fn read_sfixed32(reader: &mut Reader) -> i32 ! ProtoError
pub fn read_fixed64(reader: &mut Reader) -> u64 ! ProtoError
pub fn read_sfixed64(reader: &mut Reader) -> i64 ! ProtoError
pub fn skip_field(reader: &mut Reader, tag: Tag) ! ProtoError
pub fn writer_new() -> Writer
pub fn writer_release(writer: own Writer)
pub fn writer_to_owned(writer: own Writer) -> []u8
pub fn reader_new(data: []u8) -> Reader
pub fn reader_done(reader: Reader) -> bool
pub fn zigzag_encode_u64(value: i64) -> u64
pub fn zigzag_decode_i64(value: u64) -> i64
pub fn write_varint(writer: &mut own Writer, value: u64)
pub fn read_varint(reader: &mut Reader) -> u64 ! ProtoError
pub fn write_tag(writer: &mut own Writer, field: u32, wire: WireType) ! ProtoError
pub fn read_tag(reader: &mut Reader) -> Tag ! ProtoError
pub fn write_u64_field(writer: &mut own Writer, field: u32, value: u64) ! ProtoError
pub fn write_i64_field(writer: &mut own Writer, field: u32, value: i64) ! ProtoError
pub fn write_sint64_field(writer: &mut own Writer, field: u32, value: i64) ! ProtoError
pub fn write_bool_field(writer: &mut own Writer, field: u32, value: bool) ! ProtoError
pub fn write_fixed32_field(writer: &mut own Writer, field: u32, value: u32) ! ProtoError
pub fn write_sfixed32_field(writer: &mut own Writer, field: u32, value: i32) ! ProtoError
pub fn write_fixed64_field(writer: &mut own Writer, field: u32, value: u64) ! ProtoError
pub fn write_sfixed64_field(writer: &mut own Writer, field: u32, value: i64) ! ProtoError

std.redis

pub struct Config { host: []u8, port: u64, user: []u8, password: []u8, db: u64, protocol: u8, timeout_ms: u64, tls: bool, verify_peer: bool, ca_pem: []u8, limits: Limits }
pub struct Conn { fd: i64, link: tls.TlsTcp, secure: bool, rbuf: []u8, rpos: usize, rend: usize, timeout_ms: u64, limits: Limits, broken: bool, dirty: bool, subscribed: bool, protocol: u8 }
pub enum ErrorKind { Connection, Timeout, Protocol, Limit, Tls, Auth, Server, Closed, PoolExhausted, Usage }
pub struct RedisError { kind: ErrorKind, message: []u8 }
pub struct Pipeline { wire: fmt.Builder, count: usize, dirty: bool }
pub struct IdleSlot { fd: i64, timeout_ms: u64, parked_ms: u64 }
pub struct Pool { cfg: Config, idle: []IdleSlot, idle_count: usize, active: usize, max_size: usize, ping_after_idle_ms: u64 }
pub struct Limits { max_depth: usize, max_nodes: usize, max_bulk: usize, max_total: usize }
pub enum Kind { Null, Simple, Error, Int, Bulk, Array, Map, Set, Push, Bool, Double, BigNumber, Verbatim }
pub struct Node { kind: Kind, num: i64, off: usize, len: usize, span: usize }
pub struct Reply { nodes: collections.List[Node], data: fmt.Builder }
pub fn get(conn: &mut own Conn, key: []u8) -> Reply ! RedisError
pub fn set(conn: &mut own Conn, key: []u8, value: []u8, ex_seconds: u64, nx: bool) -> bool ! RedisError
pub fn del(conn: &mut own Conn, key: []u8) -> i64 ! RedisError
pub fn exists(conn: &mut own Conn, key: []u8) -> i64 ! RedisError
pub fn incr(conn: &mut own Conn, key: []u8) -> i64 ! RedisError
pub fn expire(conn: &mut own Conn, key: []u8, seconds: u64) -> bool ! RedisError
pub fn hget(conn: &mut own Conn, key: []u8, field: []u8) -> Reply ! RedisError
pub fn hset(conn: &mut own Conn, key: []u8, field: []u8, value: []u8) -> i64 ! RedisError
pub fn lpush(conn: &mut own Conn, key: []u8, value: []u8) -> i64 ! RedisError
pub fn rpop(conn: &mut own Conn, key: []u8) -> Reply ! RedisError
pub fn publish(conn: &mut own Conn, channel: []u8, message: []u8) -> i64 ! RedisError
pub fn scan(conn: &mut own Conn, cursor: []u8, pattern: []u8, count: u64) -> Reply ! RedisError
pub fn subscribe(conn: &mut own Conn, channels: [][]u8) ! RedisError
pub fn next_message(conn: &mut own Conn, timeout_ms: u64) -> Reply ! RedisError
pub fn config(host: []u8, port: u64) -> Config
pub fn close(conn: own Conn)
pub fn command(conn: &mut own Conn, args: [][]u8) -> Reply ! RedisError
pub fn error_free(problem: own RedisError)
pub fn pipeline_new() -> Pipeline
pub fn pipeline_free(pipeline: own Pipeline)
pub fn pipeline_add(pipeline: &mut own Pipeline, args: [][]u8) ! RedisError
pub fn pipeline_run(conn: &mut own Conn, pipeline: Pipeline) -> Reply ! RedisError
pub fn transaction(conn: &mut own Conn, pipeline: Pipeline) -> Reply ! RedisError
pub fn watch(conn: &mut own Conn, keys: [][]u8) ! RedisError
pub fn multi(conn: &mut own Conn) ! RedisError
pub fn discard(conn: &mut own Conn) ! RedisError
pub fn exec(conn: &mut own Conn) -> Reply ! RedisError
pub fn pool_new(cfg: Config, max_size: usize) -> Pool ! RedisError
pub fn pool_ping_after_idle(pool: &mut own Pool, idle_ms: u64)
pub fn pool_idle(pool: Pool) -> usize
pub fn pool_acquire(pool: &mut own Pool) -> Conn ! RedisError
pub fn pool_release(pool: &mut own Pool, conn: own Conn)
pub fn pool_close(pool: own Pool)
pub fn connect(cfg: Config) -> Conn ! RedisError
pub fn default_limits() -> Limits
pub fn reply_free(reply: own Reply)
pub fn reply_kind(reply: Reply, index: usize) -> Kind
pub fn reply_int(reply: Reply, index: usize) -> i64
pub fn reply_bytes(reply: Reply, index: usize) -> []u8
pub fn reply_len(reply: Reply, index: usize) -> usize
pub fn reply_next(reply: Reply, index: usize) -> usize
pub fn reply_child(reply: Reply, index: usize, n: usize) -> usize
pub fn reply_is_null(reply: Reply, index: usize) -> bool
pub fn reply_is_error(reply: Reply, index: usize) -> bool

std.sqlite

pub struct Cursor { pages: []usize, steps: []usize, depth: usize, is_index: bool, visited: usize, payload: fmt.Builder, rowid: i64, max_payload: usize, loaded: usize, max_loaded: usize }
pub struct Cell { kind: usize, num: i64, start: usize, len: usize }
pub struct Rows { ncols: usize, stride: usize, count: usize, first: usize, seen: usize, cells: collections.List[Cell], names: collections.List[Cell], perm: collections.List[usize], cols: collections.List[usize], data: fmt.Builder, scratch: Scratch, limits: Limits }
pub struct Scratch { first: fmt.Builder, second: fmt.Builder }
pub struct Ctx { table: Table, params: []Value, payload: []u8, rowid: i64 }
pub struct PageSource { data: []u8, page_size: usize, usable: usize, page_count: usize }
pub enum SqliteError { CannotOpen, NotDatabase, Utf16Unsupported, WalPresent, JournalPresent, UnknownSchemaFormat, Corrupt, LimitExceeded, Syntax, Unsupported, NoSuchTable, NoSuchColumn, ParamCount, Busy }
pub struct Limits { max_rows: usize, max_cells: usize, max_bytes: usize, max_payload: usize, max_loaded: usize }
pub struct Database { src: PageSource, schema: Schema, limits: Limits }
pub enum Value { Null, Int(i64), Real(u64), Text([]u8), Blob([]u8) }
pub struct Column { name_start: usize, name_len: usize, affinity: usize, pk_pos: usize, pk_desc: bool, binary: bool, int_type: bool, default_kind: usize, default_int: i64, default_start: usize, default_len: usize, rec_pos: usize }
pub struct Table { name_start: usize, name_len: usize, root: usize, col_start: usize, ncols: usize, rowid_alias: usize, without_rowid: bool, usable: bool, pk_plain: bool }
pub struct IndexInfo { table_start: usize, table_len: usize, col_start: usize, col_len: usize, root: usize, usable: bool }
pub struct Schema { names: fmt.Builder, columns: collections.List[Column], tables: collections.List[Table], indexes: collections.List[IndexInfo] }
pub struct Node { kind: usize, op: usize, left: usize, right: usize, num: i64 }
pub struct Item { node: usize, alias_start: usize, alias_len: usize }
pub struct OrderTerm { node: usize, desc: bool }
pub struct Select { texts: fmt.Builder, nodes: collections.List[Node], items: collections.List[Item], order: collections.List[OrderTerm], table_start: usize, table_len: usize, where_node: usize, limit_node: usize, offset_node: usize, nparams: usize, count_star: bool, star: bool }
pub fn cursor_new(max_payload: usize, max_loaded: usize) -> Cursor
pub fn cursor_release(c: own Cursor)
pub fn cursor_start(c: &mut Cursor, src: PageSource, root: usize, is_index: bool) ! SqliteError
pub fn cursor_next(c: &mut own Cursor, src: PageSource) -> bool ! SqliteError
pub fn cursor_seek_rowid(c: &mut own Cursor, src: PageSource, root: usize, target: i64) ! SqliteError
pub fn cursor_seek_key(c: &mut own Cursor, src: PageSource, root: usize, target: Value) ! SqliteError
pub fn rows_release(rows: own Rows)
pub fn rows_name(rows: Rows, col: usize) -> []u8
pub fn rows_value(rows: Rows, row: usize, col: usize) -> Value
pub fn query(db: Database, sql: []u8, params: []Value) -> Rows ! SqliteError
pub fn scratch_new() -> Scratch
pub fn scratch_release(scratch: own Scratch)
pub fn bind(s: &mut own Select, schema: Schema, table: Table) ! SqliteError
pub fn row_matches(s: Select, schema: Schema, ctx: Ctx, scratch: &mut own Scratch) -> bool ! SqliteError
pub fn source_from_bytes(data: own []u8) -> PageSource ! SqliteError
pub fn source_release(source: own PageSource)
pub fn source_open(path: []u8) -> PageSource ! SqliteError
pub fn error_message(error: SqliteError) -> []u8
pub fn default_limits() -> Limits
pub fn open_bytes(data: own []u8, limits: Limits) -> Database ! SqliteError
pub fn open(path: []u8, limits: Limits) -> Database ! SqliteError
pub fn close(db: own Database)
pub fn schema_release(schema: own Schema)
pub fn schema_load(src: PageSource, payload_limit: usize) -> Schema ! SqliteError
pub fn select_release(s: own Select)
pub fn parse_select(sql: []u8) -> Select ! SqliteError

std.sse

pub struct SseMessage { name: []u8, data: []u8, id: []u8, has_id: bool }
pub struct SseParser { line: fmt.Builder, state: SseState, bom_state: usize, skip_lf: bool, failed: bool }
pub struct SseReconnect { last_id: []u8, retry_ms: u64, max_delay_ms: u64, attempts: u64 }
pub enum SseError { LineTooLong, EventTooLarge, Poisoned, InvalidField }
pub struct SseLimits { max_line_bytes: usize, max_event_bytes: usize }
pub struct SseEvent { ready: bool, name: []u8, data: []u8, id: []u8 }
pub struct SseState { limits: SseLimits, data: fmt.Builder, name: fmt.Builder, id_buffer: fmt.Builder, last_id: []u8, retry_ms: u64, has_retry: bool }
pub enum SseStreamError { InvalidField, WriteFailed, Timeout, Closed }
pub struct SseStream { fd: i64, timeout_ms: u64, closed: bool }
pub fn sse_encode_event(message: SseMessage) -> []u8 ! SseError
pub fn sse_encode_comment(text: []u8) -> []u8
pub fn sse_encode_retry(milliseconds: u64) -> []u8
pub fn sse_parser_new(limits: SseLimits, last_id: []u8) -> SseParser
pub fn sse_parser_free(parser: own SseParser)
pub fn sse_last_event_id(parser: SseParser) -> []u8
pub fn sse_retry_ms(parser: SseParser, found: &mut bool) -> u64
pub fn sse_next(parser: &mut own SseParser, chunk: []u8, pos: &mut usize) -> SseEvent ! SseError
pub fn sse_reconnect_new(retry_ms: u64, max_delay_ms: u64) -> SseReconnect
pub fn sse_reconnect_free(state: own SseReconnect)
pub fn sse_reconnect_observe(state: &mut own SseReconnect, parser: SseParser)
pub fn sse_reconnect_connected(state: &mut SseReconnect)
pub fn sse_reconnect_next_delay_ms(state: &mut SseReconnect, random: u64) -> u64
pub fn sse_limits_default() -> SseLimits
pub fn sse_event_free(event: own SseEvent)
pub fn open_stream(fd: i64, timeout_ms: u64) -> SseStream ! SseStreamError
pub fn send_event(stream: &mut SseStream, message: SseMessage) ! SseStreamError
pub fn send_data(stream: &mut SseStream, data: []u8) ! SseStreamError
pub fn send_comment(stream: &mut SseStream, text: []u8) ! SseStreamError
pub fn send_retry(stream: &mut SseStream, milliseconds: u64) ! SseStreamError
pub fn close_stream(stream: &mut SseStream) ! SseStreamError

std.time

pub struct Civil { year: i64, month: i64, day: i64, hour: i64, minute: i64, second: i64 }
pub enum TimeError { Clock, Invalid, Range }
pub enum Unit { Millisecond, Second, Minute }
pub fn civil_from_unix(seconds: i64) -> Civil
pub fn now_unix_ns() -> i64 ! TimeError
pub fn monotonic_ns() -> u64
pub fn duration(count: u64, unit: Unit) -> u64
pub fn to_unit(nanos: u64, unit: Unit) -> u64
pub fn format_rfc3339(unix_ns: i64) -> []u8
pub fn parse_rfc3339(text: []u8) -> i64 ! TimeError

std.tls

pub struct ConnStatus { encrypted: bool, handshake_done: bool, closed: bool, peer_closed: bool, last_alert_level: u8, last_alert_desc: u8, failed: bool, skipped: usize, deadline_ms: u64, handshake_timeout_ms: u64 }
pub struct ClientBuffers { hs_buf: []u8, hs_pos: usize, hs_len: usize, app_buf: []u8, app_pos: usize, app_len: usize }
pub struct TlsConfig { server_name: []u8, roots: x509.CertStore, verify_peer: bool, verify_host: bool, check_time: bool, now_unix_ns: i64, alpn: []u8, fixed_random: []u8, fixed_ephemeral: []u8 }
pub struct TlsSession { suite: u16, alpn: []u8, status: ConnStatus, bufs: ClientBuffers, sched: kdf.KeySchedule, read_state: record.CipherState, write_state: record.CipherState }
pub struct TlsTcp { io: NetTransport, session: TlsSession }
pub enum TlsError { IoError, UnexpectedEof, HandshakeFailed, BadRecordMac, BadCertificate, BadSignature, HostnameMismatch, UntrustedRoot, Expired, ProtocolError, AlertReceived, Unsupported, Closed, Timeout }
pub interface Transport[Io] {
    fn transport_read(io: &mut Io, buf: &mut []u8) -> usize ! TlsError
    fn transport_write(io: &mut Io, data: []u8) -> usize ! TlsError
}
pub struct NetTransport { fd: i64, timeout_ms: u64 }
pub struct MemoryTransport { rx: []u8, rx_pos: usize, rx_len: usize, tx: []u8, tx_len: usize }
pub fn default_config(server_name: []u8) -> TlsConfig
pub fn config_free(cfg: own TlsConfig)
pub fn config_set_roots(cfg: &mut own TlsConfig, roots: own x509.CertStore)
pub fn tls_session_new() -> TlsSession
pub fn tls_session_free(sess: own TlsSession)
pub fn tls_key_update[Io: Transport](sess: &mut own TlsSession, io: &mut Io, request_peer: bool) ! TlsError
pub fn tls_read[Io: Transport](sess: &mut own TlsSession, io: &mut Io, out: &mut []u8) -> usize ! TlsError
pub fn tls_write[Io: Transport](sess: &mut own TlsSession, io: &mut Io, data: []u8) ! TlsError
pub fn tls_close[Io: Transport](sess: &mut own TlsSession, io: &mut Io) ! TlsError
pub fn tls_handshake[Io: Transport](sess: &mut own TlsSession, io: &mut Io, cfg: TlsConfig) ! TlsError
pub fn tls_connect_tcp(address: net.Address, server_name: []u8, timeout_ms: u64) -> TlsTcp ! TlsError
pub fn tls_connect_tcp_with_config(address: net.Address, cfg: TlsConfig, timeout_ms: u64) -> TlsTcp ! TlsError
pub fn tls_tcp_read(conn: &mut own TlsTcp, out: &mut []u8) -> usize ! TlsError
pub fn tls_tcp_write(conn: &mut own TlsTcp, data: []u8) ! TlsError
pub fn tls_tcp_close(conn: &mut own TlsTcp) ! TlsError
pub fn tls_tcp_free(conn: own TlsTcp)
pub fn net_transport(fd: i64, timeout_ms: u64) -> NetTransport
pub fn net_read(io: &mut NetTransport, buf: &mut []u8) -> usize ! TlsError
pub fn net_write(io: &mut NetTransport, data: []u8) -> usize ! TlsError
pub fn memory_transport() -> MemoryTransport
pub fn memory_free(io: own MemoryTransport)
pub fn memory_feed(io: &mut own MemoryTransport, data: []u8)
pub fn memory_take_tx(io: &mut MemoryTransport) -> []u8
pub fn memory_read(io: &mut MemoryTransport, buf: &mut []u8) -> usize ! TlsError
pub fn memory_write(io: &mut MemoryTransport, data: []u8) -> usize ! TlsError
pub fn write_all[Io: Transport](io: &mut Io, data: []u8) ! TlsError
pub fn read_exact[Io: Transport](io: &mut Io, buf: &mut []u8) -> bool ! TlsError

std.webhook

pub enum WebhookError { MalformedHeader, HeaderTooLarge, TooManySignatures, MissingTimestamp, MissingSignature, InvalidTimestamp, InvalidId, InvalidSecret, NoSecrets, TooManySecrets, TimestampStale, TimestampFuture, BadClock, BadSignature }
pub struct WebhookLimits { max_header_bytes: usize, max_signatures: usize }
pub struct Signatures { timestamp: u64, tags: []u8, count: usize }
pub struct RetryPolicy { base_ms: u64, max_delay_ms: u64, max_attempts: u64 }
pub enum OutcomeKind { Response, Transient, Permanent }
pub struct Outcome { kind: OutcomeKind, status: u64, retry_after_ms: u64 }
pub enum PlanAction { Delivered, Retry, GiveUp }
pub struct Plan { action: PlanAction, delay_ms: u64 }
pub struct VerifyPolicy { now_unix: i64, tolerance_s: u64, limits: WebhookLimits }
pub struct StandardHeaders { id: []u8, timestamp: []u8, signature: []u8 }
pub fn webhook_limits_default() -> WebhookLimits
pub fn webhook_signatures_free(signatures: own Signatures)
pub fn webhook_parse_timestamp(text: []u8) -> u64 ! WebhookError
pub fn webhook_parse_header(header: []u8, limits: WebhookLimits) -> Signatures ! WebhookError
pub fn webhook_parse_standard(header: []u8, limits: WebhookLimits) -> Signatures ! WebhookError
pub fn retry_policy_default() -> RetryPolicy
pub fn status_retries(status: u64) -> bool
pub fn webhook_plan(policy: RetryPolicy, outcome: Outcome, attempt: u64, random: u64) -> Plan
pub fn webhook_sign(key: []u8, timestamp: u64, body: []u8) -> []u8
pub fn webhook_signature_header(keys: [][]u8, timestamp: u64, body: []u8) -> []u8 ! WebhookError
pub fn webhook_verify(keys: [][]u8, header: []u8, body: []u8, policy: VerifyPolicy) ! WebhookError
pub fn standard_sign(key: []u8, id: []u8, timestamp: []u8, body: []u8) -> []u8
pub fn standard_signature_header(keys: [][]u8, id: []u8, timestamp: u64, body: []u8) -> []u8 ! WebhookError
pub fn standard_verify(keys: [][]u8, headers: StandardHeaders, body: []u8, policy: VerifyPolicy) ! WebhookError
pub fn standard_secret_decode(secret: []u8) -> []u8 ! WebhookError
pub fn webhook_secret_free(secret: own []u8)

std.websocket

pub struct Assembler { data: []u8, count: usize, opcode: u8, delivered: bool, utf8: frame.Utf8, max: usize }
pub struct Message { kind: u8, data: []u8, code: u16 }
pub struct Conn[Io] { io: Io, session: Session, timeout_ms: u64, protocol: []u8, chunk: []u8 }
pub enum WsError { Protocol, InvalidUtf8, TooBig, Closed, Timeout, Io, BadArgument, NoRandom }
pub struct Options { max_frame: usize, max_message: usize, timeout_ms: u64, origin: []u8, protocols: []u8, allowed_origins: []u8 }
pub struct Control { payload: []u8, count: usize, pong: []u8, pong_count: usize, pong_due: bool }
pub struct Session { client: bool, decoder: frame.Decoder, message: Assembler, out: frame.Buffer, ctl: Control, key: []u8, close_sent: bool, close_received: bool, close_code: u16 }
pub enum WireError { Timeout, Closed, Failed }
pub interface Wire[Io] {
    fn wire_read(io: &mut own Io, buffer: &mut []u8, timeout_ms: u64) -> usize ! WireError
    fn wire_write(io: &mut own Io, data: []u8, timeout_ms: u64) ! WireError
    fn wire_free(io: own Io)
}
pub struct PlainWire { fd: i64, poller: net.Poller, events: []net.PollEvent }
pub const CLOSE_NORMAL: u16 = 1000
pub const CLOSE_PROTOCOL: u16 = 1002
pub const CLOSE_NO_STATUS: u16 = 1005
pub const CLOSE_INVALID_DATA: u16 = 1007
pub const CLOSE_TOO_BIG: u16 = 1009
pub const CLOSE_INTERNAL: u16 = 1011
pub fn message_free(message: own Message)
pub fn receive[Io: Wire](conn: &mut own Conn[Io]) -> Message ! WsError
pub fn send_text[Io: Wire](conn: &mut own Conn[Io], text: []u8) ! WsError
pub fn send_binary[Io: Wire](conn: &mut own Conn[Io], data: []u8) ! WsError
pub fn send_ping[Io: Wire](conn: &mut own Conn[Io], data: []u8) ! WsError
pub fn send_part[Io: Wire](conn: &mut own Conn[Io], opcode: u8, fin: bool, data: []u8) ! WsError
pub fn close[Io: Wire](conn: &mut own Conn[Io], code: u16, reason: []u8) ! WsError
pub fn conn_protocol[Io](conn: Conn[Io]) -> []u8
pub fn conn_free[Io: Wire](conn: own Conn[Io])
pub fn close_code_of(problem: WsError) -> u16
pub fn valid_close_code(code: u16) -> bool
pub fn plain_receive(conn: &mut own Conn[PlainWire]) -> Message ! WsError
pub fn plain_send_text(conn: &mut own Conn[PlainWire], text: []u8) ! WsError
pub fn plain_send_binary(conn: &mut own Conn[PlainWire], data: []u8) ! WsError
pub fn plain_send_ping(conn: &mut own Conn[PlainWire], data: []u8) ! WsError
pub fn plain_send_part(conn: &mut own Conn[PlainWire], opcode: u8, fin: bool, data: []u8) ! WsError
pub fn plain_close(conn: &mut own Conn[PlainWire], code: u16, reason: []u8) ! WsError
pub fn plain_conn_free(conn: own Conn[PlainWire])
pub fn session_send(session: &mut own Session, opcode: u8, fin: bool, payload: []u8) ! WsError
pub fn session_send_text(session: &mut own Session, text: []u8) ! WsError
pub fn session_send_binary(session: &mut own Session, data: []u8) ! WsError
pub fn session_send_ping(session: &mut own Session, data: []u8) ! WsError
pub fn session_close(session: &mut own Session, code: u16, reason: []u8) ! WsError
pub fn default_options() -> Options
pub fn session_new(client: bool, options: Options) -> Session
pub fn session_free(session: own Session)
pub fn session_feed(session: &mut own Session, data: []u8)
pub fn session_next(session: &mut own Session) -> u8 ! WsError
pub fn session_message(session: Session) -> []u8
pub fn session_control(session: Session) -> []u8
pub fn session_close_code(session: Session) -> u16
pub fn session_closed(session: Session) -> bool
pub fn session_close_sent(session: Session) -> bool
pub fn session_output(session: &mut own Session) -> []u8
pub fn session_output_done(session: &mut Session)
pub fn client_start[Io: Wire](wire: own Io, to: upgrade.Target, options: Options) -> Conn[Io] ! upgrade.UpgradeError
pub fn client_start_from[Io: Wire](wire: own Io, to: upgrade.Target, options: Options, started: u64) -> Conn[Io] ! upgrade.UpgradeError
pub fn server_start[Io: Wire](wire: own Io, options: Options) -> Conn[Io] ! upgrade.UpgradeError
pub fn connect(url: []u8, options: Options) -> Conn[PlainWire] ! upgrade.UpgradeError
pub fn accept_fd(fd: i64, options: Options) -> Conn[PlainWire] ! upgrade.UpgradeError
pub fn plain_wire(fd: i64) -> PlainWire ! WireError
pub fn plain_connect(address: net.Address, timeout_ms: u64) -> PlainWire ! WireError
pub fn left_ms(started: u64, total_ms: u64) -> u64
pub fn wait_readable(poller: &mut net.Poller, events: &mut []net.PollEvent, timeout_ms: u64) -> bool

Source: STD.md in the repository.