osrv library

Classes

Headers
Request
Native request contract shell aligned with the MDN Request surface.
RequestContext
Adds per-request controls on top of the shared lifecycle context.
RequestInit
Initialization options for Request, aligned with the MDN Fetch RequestInit surface.
Response
ResponseInit
Runtime
Represents a running server hosted by a concrete runtime family.
RuntimeCapabilities
Describes which runtime-backed features are available to a server instance.
RuntimeExtension
Marker interface for runtime-specific values attached to request contexts.
RuntimeInfo
Identifies a runtime family and the role it is performing.
Server
Declares the runtime-agnostic server contract consumed by osrv.
ServerLifecycleContext
Carries runtime metadata shared by lifecycle hooks and request handling.

Enums

HttpMethod
Standard HTTP methods used by both client and server side APIs.

Typedefs

ServerErrorHook = FutureOr<Response?> Function(Object error, StackTrace stackTrace, ServerLifecycleContext context)
Converts uncaught request errors into an optional response.
ServerFetch = FutureOr<Response> Function(Request request, RequestContext context)
Handles a single incoming request.
ServerHook = FutureOr<void> Function(ServerLifecycleContext context)
Runs during runtime startup and shutdown.

Exceptions / Errors

RuntimeConfigurationError
Thrown when a runtime configuration is structurally invalid.
RuntimeStartupError
Thrown when a runtime fails during startup or binding.
UnsupportedRuntimeCapabilityError
Thrown when application code requires a capability the runtime does not expose.