Skip to content

Reference

简体中文 · Documentation

Every public header under include/pace/, one section per module. Each module page follows the same order: overview, synopsis, types, functions, errors, threads and concurrency, lifetime and ownership, limits and defaults. Headers under src/ are internal and not documented here.

Module Umbrella header Package config Pages
Runtime <pace/runtime.hpp> always included overview · task · io_context · runtime · run · structured concurrency · I/O backends
Networking <pace/net.hpp> always included overview · TCP · UDP
TLS <pace/tls.hpp> tls = true or native_tls = true TLS
DNS <pace/dns.hpp> dns = true DNS
QUIC <pace/quic.hpp> quic = true QUIC
HTTP <pace/http.hpp> always included overview · routing · URL clients
HTTP/1.1 <pace/http1.hpp> http1 (on by default) overview · server · client · http::app
HTTP/2 <pace/http2.hpp> http2 = true HTTP/2
HTTP/3 <pace/http3.hpp> http3 = true HTTP/3
WebSocket <pace/websocket.hpp> websocket (on by default) WebSocket
Gateway <pace/gateway.hpp> http1 (on by default) gateway

<pace/pace.hpp> includes the umbrella header of every enabled module.

Across modules
Errors Exception types and error codes used everywhere
Build options Package configs, source-build options and targets, named modules, diagnostics
Platform support Systems, compilers, I/O backends, native handles

Rules every module shares

These hold for every API unless its page says otherwise; the runtime overview states them precisely and Explanation gives the reasons.

  • Ownership. Tasks are lazy and consumed once. Parameters passed by value belong to the task; references, spans and string views are borrowed and must outlive it. A socket stays at a stable address until its operations finish, and the context outlives its sockets. More
  • Threads. One thread runs each context. Only spawn, post and stop may be called from other threads. More
  • Concurrency per object. TCP allows one read and one write at a time; TLS, WebSocket and the HTTP clients allow one operation at a time. Each page states its limit.
  • Errors. Exceptions, rethrown through co_await. More
  • Cancellation. stop() and cancellation tokens resume suspended operations with std::errc::operation_canceled; deadlines with std::errc::timed_out.