Skip to content

Gossamer standard library

One page per module. Source is crates/gossamer-std/src/; this index is regenerated from manifest::ALL_MODULES by gos doc --emit-stdlib.

For receiver methods on built-in types, see Methods by type.

Module Summary
std::archive::tar Unix tar reader and writer (USTAR / PAX-aware decode).
std::archive::zip ZIP archive reader and writer.
std::bufio Buffered readers, writers, and line scanners.
std::bytes Byte buffers, builders, and slice helpers.
std::collections Built-in container types.
std::collections::deque Double-ended queue over Vec. Re-bind shape on every mutator.
std::collections::heap Binary min-heap (priority queue) over Vec. Re-bind shape: let h = heap::push(h, v).
std::collections::ordered_map Sorted key/value map (i64 -> i64) backed by a flat pair Vec. Re-bind on every mutator.
std::collections::ordered_set Sorted set of i64 with binary-search lookups. Re-bind shape on every mutator.
std::collections::ordered_vec Sorted-on-insert Vec with binary-search lookups.
std::collections::queue FIFO queue over Vec. Re-bind shape: let q = queue::push(q, v).
std::collections::stack LIFO stack over Vec. Re-bind shape: let s = stack::push(s, v).
std::compress::bzip2 bzip2 encoder / decoder (BZh format).
std::compress::flate Raw DEFLATE (RFC 1951) encoder / decoder.
std::compress::gzip gzip encoder / decoder (RFC 1952; flate2-backed).
std::compress::zlib zlib (RFC 1950) encoder / decoder.
std::compress::zstd Zstandard encoder / decoder (RFC 8478; libzstd-vendored).
std::context Request-scoped cancellation, deadlines, and timeouts.
std::crypto::aead Authenticated encryption with associated data.
std::crypto::blake3 BLAKE3 hashing.
std::crypto::ecdsa ECDSA over the NIST P-256 curve.
std::crypto::ed25519 Ed25519 digital signatures.
std::crypto::hmac HMAC-SHA-256 keyed MACs.
std::crypto::insecure Legacy / broken hashes (MD5, SHA-1). Compat only - never use for new code.
std::crypto::kdf Password-based key-derivation functions.
std::crypto::password Argon2id password hashing facade: PHC-string hash / verify / re-hash policy.
std::crypto::rand Secure random bytes from the host CSPRNG.
std::crypto::sha256 SHA-256 hashing.
std::crypto::sha512 SHA-512 hashing.
std::crypto::subtle Constant-time comparison helpers.
std::crypto::x509 X.509 certificate parsing.
std::database::sql Driver-pluggable SQL database access. No driver ships in the box; bring your own (Postgres, MySQL, SQLite, ...) by registering one at startup.
std::encoding::ascii85 ASCII85 / base85 encode / decode.
std::encoding::base32 RFC 4648 base32 (uppercase) encode / decode.
std::encoding::base64 RFC 4648 base64 encode/decode.
std::encoding::binary Big/little-endian integer packing and varint codecs.
std::encoding::csv CSV record reader and writer.
std::encoding::hex Lowercase hex encode/decode.
std::encoding::json JSON parser, emitter, and derive support.
std::encoding::pem PEM block encoder and decoder.
std::encoding::toml TOML 1.0 parsing + emission. Pair with the turbofish from_toml::<Type> for typed decoding (struct auto-derive).
std::encoding::xml Streaming XML decoder + builder (quick-xml).
std::encoding::yaml YAML 1.2 parser/emitter (serde_norway-backed).
std::env Process environment, command-line arguments, working directory.
std::errors Error construction, wrapping, and chain traversal.
std::flag Batteries-included CLI argument parsing.
std::fmt Formatted printing and string interpolation.
std::fs Filesystem reading, writing, and traversal (Rust std::fs shape).
std::hash::adler32 Adler-32 checksums.
std::hash::crc32 CRC-32 (IEEE) checksums.
std::hash::fnv FNV-1a non-cryptographic hash (32-bit, 64-bit).
std::html HTML text escaping and unescaping.
std::html::template Context-aware HTML templates with auto-escape (text/attr/URL/JS). The context classifier is heuristic - sound for typical server-rendered responses but NOT a content-security-policy substitute; sanitize untrusted HTML fragments with a dedicated sanitizer.
std::http HTTP/1.1 and HTTP/2 client and server. HTTP/2 negotiates via ALPN over TLS automatically (Go-style); h2c entry points are explicit.
std::http::chunked RFC 7230 ยง4.1 chunked transfer-encoding reader and writer.
std::http::cookie RFC 6265 cookie parser and Set-Cookie builder.
std::http::csrf Double-submit-cookie CSRF protection with Origin / Referer allowlist.
std::http::form application/x-www-form-urlencoded parser and builder.
std::http::health Liveness / readiness probes for HTTP health endpoints.
std::http::middleware Composable middleware: logger, recoverer, request_id, cors, basic_auth, compress_gzip.
std::http::multipart RFC 7578 multipart/form-data streaming parser.
std::http::native_client Goroutine-driven HTTP/1.1 client over std::net (no ureq, no blocking pool).
std::http::proxy Reverse proxy on top of http::Client. Director-style request mutator + hop-by-hop strip + error handler.
std::http::query Typed wrapper over URL query strings.
std::http::router Go 1.22-class ServeMux: method-aware path patterns with parameter captures + prefix routes.
std::http::session Signed-cookie session store with pluggable backend trait.
std::http::sse Server-Sent Events (text/event-stream) emitter with heartbeat ticks and retry hint.
std::http::state Handler-side dependency injection via a typed AppState.
std::http::static_files Caching static-file handler: ETag, Last-Modified, byte ranges, MIME sniff.
std::http::websocket RFC 6455 WebSocket support. Server-side accept + send_text / send_binary / ping / pong / close.
std::http_h3 HTTP/3 over QUIC. std::http_h3 is the retained 0.27 spelling; no std::http::h3 alias.
std::httptest Loopback HTTP fixtures for source integration tests.
std::image Opaque RGBA8 image handles with PNG and JPEG codecs.
std::io Stream-oriented I/O abstractions and process standard streams.
std::iter Sequence adapters over Vec: map, filter, fold, zip, enumerate, chain, etc.
std::jwt RFC 7519 sign / verify for HS256 / HS384 / HS512, ES256, and EdDSA tokens.
std::lifecycle Graceful-shutdown coordinator with signal handling and sd_notify support.
std::math Mathematical constants and f64 functions (Go's math package shape).
std::math::big Arbitrary-precision integers (num-bigint).
std::math::bits Integer bit-manipulation operations (Go's math/bits shape).
std::math::rand Deterministic pseudo-random number generation.
std::metrics Prometheus-compatible primitives (Counter, Gauge, Histogram) and a Registry rendering the standard text-exposition format.
std::mime RFC 2045 media type parsing, parameter extraction, and extension lookup.
std::net TCP/UDP networking primitives.
std::net::ip String-level IPv4 / IPv6 parsing and classification helpers.
std::net::netip Typed IP-address parsing, classification, and addr:port helpers (Go's net/netip shape).
std::net::url Network URL parsing and component escaping; never use filesystem-path rules.
std::option Data-last Option combinators for pipeline chaining: map, filter, unwrap_or, and_then, etc.
std::os Operating-system identity.
std::os::exec Deprecated compatibility facade for child processes; new code uses std::process.
std::os::signal POSIX-style signal subscription (Go's os/signal shape).
std::os::user POSIX user / group lookup. Unix-backed by nix; Windows falls back to env vars.
std::panic Panic / catch_unwind integration.
std::path Lexical filesystem-path operations; platform path grammar, no URL parsing or I/O.
std::process Canonical process control and child-process API; std::os::exec is compatibility-only.
std::regex Compiled regular expressions (Rust regex crate syntax; no backreferences or look-around).
std::result Data-last Result combinators for pipeline chaining: map, map_err, unwrap_or_else, etc.
std::runtime Goroutine / scheduler introspection and tuning.
std::slog Structured, levelled logging.
std::strconv Conversions between strings and primitive numeric types.
std::strings String operations.
std::sync Synchronisation primitives beyond channels.
std::testing Assertions and sub-test harness helpers.
std::thread OS-thread scheduling hints and CPU introspection; user concurrency uses goroutines, not thread spawning.
std::time Wall-clock and monotonic time facilities.
std::tls Rustls-backed TLS support exposed through http::serve_tls and net::TcpStream TLS upgrades. The configuration constructors are host-runtime internals, not Gossamer callables.
std::trace W3C trace-context-compatible distributed tracing. Identifier types, request-scoped SpanContext, process-level Tracer, and OTLP JSON export.
std::unicode Unicode general-category predicates, casing, normalization, and segmentation.
std::utf16 UTF-16 encoding/decoding and surrogate pair helpers.
std::utf8 UTF-8 validation and scalar decoding.
std::uuid UUID v4 (random) and v7 (timestamp-ordered) generation, parse, and normalize.
std::validate Trait-based field validation: implement Validate, collect FieldErrors into Errors.