Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix: Crates, Features, Dependency Graph

The go-look-here reference, drawn from the family registry and the workspace manifests. For the narrative of how these fit together, see How the Crates Fit Together; this is the exhaustive index. The framework and its add-ons are at version 0.5, and every family dependency between repos is a plain version requirement resolved through the patch table until the family publishes.

The capi_rs framework workspace

The framework proper — contracts and their in-tree reference implementations, thirty-two members. All are #![no_std] + alloc except the proc-macro crates (capi_derive, capi_cookies_macro) and the macro-authoring kit they share (capi_macro_support), which are build-time only.

CrateJob / key exports
capi_rsThe facade — re-exports the members under short module aliases, plus prelude and reexport
capi_coreEndpoint, OverrideEndpoint, IntoEndpoint, ApiConfig, ApiInterface, ResponseDecoder and the body-decode traits, the error taxonomy, RequestSpecs, ApiRedact, presign
capi_protocolThe protocol-generic core: Protocol, Speaks, ApiClient, Duplex / DuplexError, StdError, the budget markers, the carrier module (Carrier / AsyncCarrier / PollDuplex / WakeCarrier, Dial / AsyncDial, DatagramCarrier / TimedDatagramCarrier / PollDatagram / DialDatagram), context re-exported
capip_httpThe HTTP protocol: Http / Grpc, Capability, Supports<Cap>, ResponseEnvelope / ExtensionOf, FollowUpChannel, ClientFuture
capi_transportTraversal and the seal; ApiRequest / ApiResponse / ScopedRequest; Runner / RunnerAccess / DirectRunner; FollowUp, Finalize, PackagedRequest, PackagedResponse
capi_middlewarePipeline, Phase, the three member traits, RequestFlow / ResponseFlow, Body, TransportError
capi_authenticationAuthStore / AuthEntry / AuthKey / AuthSettings, RequestSigner / OneShotSigner / Signing / NO_SIGNING / ToSigner, Cosigning, KeyMaterial custody, EntryRefresher / Freshness, presign_url / begin_policy / finish_policy
capi_rate_limitRateLimiter, WaitableRateLimiter, RateLimit, ToRateLimiter, LimiterUnit, NO_RATE_LIMIT
capi_limitersGcraLimiter, HeaderLimiter, MeteredLimiter, Rate, the provider presets
capi_base_configBaseConfig, CosignerCell, the auth config extensions
capi_base_interfaceBaseInterface, AuthScheme / AuthFlow / AuthEndpoint, Token / Basic and their flows, AuthTierInterface, Discoverable
capi_base_decodersBodyDecoder, PagedDecoder, SwitchDecoder, SseDecoder / EventDecoder, DocumentStreamDecoder, ChunkedDecoder, BytestreamDecoder, ResumableStreamDecoder / ResumeDownloadDecoder / StreamFnDecoder, FlatMapDecoder, ResponseBoundary
capi_base_encodersMultipart, Part, FileBlob
capi_extrasThe runners and their verbs (RetryRunner, RetryAfterRunner, RedirectRunner, RefreshRunner, WaitUntilRunner, WithHead, Raw, Wrapped), EndpointQuery, BackgroundRefresh / RefreshSchedule, the InjectRequestId and FollowRedirects members, the Progress / Throttle stages
capiw_wire_headersThe wire-model HTTP header encoder
capi_cookies (+ _macro)CookieJar, Cookie, CookieMiddleware, CookieConfigExt, CookieSessionSource, HasCookieJar, cookie_auth
capi_firewallFirewall<Client>, EgressPolicy, Mode
capi_debug_dumpDebugClient, the exchange dump in the canonical text format
capi_notificationNotificationSender / NotificationReceiver, Notification / NotificationKind, LogNotification
capi_contextApiContext, ApiRng, ContextId, CancelToken, SendError, Refusal
capi_bytestreamBytestream, ContentLength, BodySource, StreamCodec, MaybeSend / MaybeSync
capi_http_typesMethod, StatusCode, Version, HeaderMap / HeaderName / HeaderValue, Request / Response and their heads, TrailerCell / TrailerState, Extensions, the url::Url a head carries, the text format
capi_urlUrlBuilder, ToUrl, UrlError
capi_timeApiClock, Instant, SystemTime, sleep
capi_lockSyncMutex / SyncRwLock / SharedCell / SyncCondvar, AsyncMutex / AsyncRwLock
capi_feature_stateassert_feature_alignment!, assert_lane_alignment!, the feature-state constants
capi_deriveApiEndpoint, capi, AuthScheme
capi_macro_supportThe macro-authoring toolkit: lane primitives, diagnostics, auth templates
capi_test_coreMockClient / MockResponse / Fault, TestConfig / TestInterface, the mock clock and RNG, the pipeline test doubles

The other workspaces

WorkspaceMembers
capi_wirecapi_wire_model (Codec<F>, Format, CodecError, Binding, WireModel / WireEncode / WireDecode / WireShape / WireScalar, Redact), capi_wire_derive (the three wire derives), capi_wire_value (Value), capi_wire_datetime (Date / DateTime / Time / Timestamp), capi_wire_decimal (Decimal, FixedDecimal<SCALE>)
capi_authcapi_auth_oauth2 (ConfigOAuth2Grant, Oauth2Flow, TokenEndpoint, Oauth2Refresher, discovery, PKCE), capi_auth_jwt (ConfigJwtAuth, JwtBearerFlow, JwtRefresher, JwtBuilder / JwtClaims / JwtSigningKey)
capi_test_frameworkcapi_test_framework (ReplayClient, ReplayConfig, FixtureClass, FixtureAudit, QueryRedacted, the .ws session recorder), capi_test_macros (capi_test, development, strip_await)
capi_enginecapi_engine (the sans-io Conversation / Engine contract, the per-lane drivers, and the carrier traits re-exported from capi_protocol), capip_http1, capip_http2, capip_redis (the Redis marker, RedisConnect / RedisSession), the VOIP stack (capip_sip, capi_sdp, capip_stun, capip_rtp, capip_voip — the Sip and Media markers, SipEndpoint / MediaSession), and the engine-backed client capic_native_client (+ _interop)
capi_graphqlcapi_graphql (GraphqlCall, GraphqlApiConfig, Persisted, batching), capi_graphql_macros (graphql_schema! / graphql!), capi_graphql_schema (the host-only schema IR)

Single-crate repos

RepoKind
capic_reqwest / capic_ureq / capic_wasm_fetch / capic_reqwlessclient adapters — with capic_native_client above, the five in the capability table
capiw_serde_json / capiw_urlencoded / capiw_quick_xml / capiw_prostconcrete codecs, each carrying its format’s conformance suite
capiw_ext_json / capiw_ext_urlencoded (+ _macro) / capiw_ext_xml / capiw_ext_protobufformat contracts: the Json, UrlForm, Xml, and protobuf markers and their attribute vocabularies
capi_websocketthe WebSocket capability marker, RFC 6455 framing, TypedWsConnection, WsSession and the tunnel protocols, the split halves
capi_grpcunary, client-streaming, and server-streaming gRPC: Frame / FramedBody / MessageSource, GrpcDecoder / GrpcError / GrpcConfig, CompressionPolicy / MessageCoding, RequestMetadata / ResponseMetadata, GrpcStatus / GrpcCode
capi_html_formsFormFlow / FormFlowDecoder, HtmlForm, FormSelector, FieldUpdate / FormUpdate, HasUrlEncodedLib
capi_http_batchBatchConfig / ChangesetConfig, Batchable, BatchProfile, ArmedBatch, IntoBatch
capie_gzip / capie_miniz_oxide / capie_brotli / capie_aws_chunkedcontent-coding StreamCodecs: gzip, deflate, br, aws-chunked; the first two also drive gRPC per-message compression
capim_x402the x402 payment runner: X402 / X402Ext, RemoteAuthorizer, Terms / Requirement / Settlement
capi_auth_aws_sigv4 / capi_auth_azure / capi_auth_digestsigners: Sigv4Signer / AwsCredentials, SharedKeySigner / AzureKeyCredential, DigestSigner / DigestCredentials
capi_auth_googleGoogle service-account JWT and OAuth2 helpers
capiw_conformance_testscross-codec properties (private, unpublished)

Reference clients (*_capi_rs): aws_s3, azure_tables, generic_llm (a workspace over the OpenAI and Claude clients), google_places, google_routes, graphqlzero, grok, icecast_connect, paychex, ringcentral; the canaries grpc_test (tonic interop), nostd_canary (bare-metal QEMU), and runtime_canary (non-Tokio executors).

Tooling: capi_verify — a workspace of its own, the capi_verify planner library and the cargo-capi binary; capi-extension-template — the cargo generate template for a new codec, transport, auth, middleware, or client crate; and the private capi_test_suite — the registry, dev-config, and the family sweep.

The facade and prelude

capi_rs re-exports the Capi framework workspace under short module aliases — ::core, ::config, ::decoders, ::encoders, ::interface, ::protocol, ::transport, ::middleware, ::extras, ::authentication, ::rate_limiters, ::notification, ::lock, ::time, ::feature_state, ::http_headers, ::http_types, ::derive (behind derive), and ::cookies (behind cookies) — plus reexport for downstream forwarding. The protocol-generic core is reachable as capi_rs::protocol. The derives it surfaces are ApiEndpoint, capi, and AuthScheme, all behind derive. use capi_rs::prelude::*; brings the endpoint-authoring surface into scope — the core’s Protocol, Speaks, ApiClient, and Duplex among the names it carries; the seams that are meant to be unusual — FollowUp, Finalize, the capture types — ride no prelude and are imported from ::transport by name.

Crates outside that workspace are named directly by the client that uses them: the wire derives from capi_wire_model, Json from capiw_ext_json, UrlForm and urlform_extension from capiw_ext_urlencoded, the date and money carriers from capi_wire_datetime / capi_wire_decimal, and the capabilities and auth flows from capi_websocket, capi_grpc, capi_html_forms, capi_auth_oauth2, and capi_auth_jwt. capi_firewall and capi_debug_dump are members of the workspace but not of the facade: a wrapper is chosen by the application that seats the client, and depended on directly so that a look-alike cannot be substituted.

Feature matrix

capi_rsdefault = ["std", "derive"].

The three axes (the compilation target picks the platform; see Features and Targets):

FeatureEffect
std (default)standard-library support on native and WASI; on browser wasm the platform-capability switch that enables each crate’s js bindings
asyncthe async trait shapes; browser wasm always carries the async surface
single-threadeddrops Send / Sync graph-wide — additive to the build, non-additive to the API contract; implied by browser wasm

Add-ons: auth-basic, cookies, cookies-jar-access, derive (default). That is the whole list: the facade re-exports the framework workspace and nothing else, so the OAuth2 and JWT flows, WebSocket, gRPC, HTML forms, and the wire model are direct dependencies of the client that uses them, with their lanes forwarded from that client’s own features.

Adapter features that gate a lane: websocket on capic_reqwest, capic_ureq, capic_wasm_fetch, and capic_native_client; grpc on capic_reqwest (implying trailers, and therefore async) and capic_native_client; redis and voip on capic_native_client for the protocols it speaks off the pipeline. capic_reqwless is single-threaded by design and declares no lane beyond Http.

Harness features: capi_test_framework adds reqwest / native-client (the bundled live recorder, each exclusive with single-threaded), grpc, websocket, oauth2, serde-json / serde-form-urlencoded / quick-xml (structural body comparison), and js.

assert_feature_alignment! takes the tokens "async", "single-threaded", !"async", !"single-threaded", "native-only", and "browser-only"; assert_lane_alignment!("single-threaded") is the lane form. None of them is a Cargo feature, and std has no token.

Dependency graph

The edges are the manifests’ own — each workspace member’s family [dependencies], collapsed into layers:

graph TD
    client["client crate"] --> facade["capi_rs (facade)"]
    client --> protocols["capi_websocket / capi_grpc / capi_html_forms / capi_http_batch / capi_graphql"]
    client --> flows["capi_auth_oauth2 / capi_auth_jwt / signers"]
    client --> contracts["capiw_ext_json / capiw_ext_urlencoded / capiw_ext_xml / capiw_ext_protobuf"]
    facade --> interface["capi_base_interface"]
    facade --> extras["capi_extras"]
    facade --> config["capi_base_config / capi_limiters"]
    facade --> addons["capi_cookies / capiw_wire_headers"]
    facade --> codecs_in["capi_base_decoders / capi_base_encoders"]
    interface --> extras
    interface --> codecs_in
    extras --> codecs_in
    extras --> transport["capi_transport"]
    codecs_in --> transport
    config --> core["capi_core"]
    addons --> config
    addons --> core
    protocols --> core
    flows --> core
    transport --> core
    core --> planes["capip_http / capi_middleware / capi_authentication / capi_rate_limit / capi_url"]
    core --> wire["capi_wire_model (+ derive / value / datetime / decimal)"]
    contracts --> wire
    planes --> types["capi_http_types / capi_bytestream"]
    planes --> floor["capi_protocol (+ capi_context)"]
    types --> leaves["capi_notification / capi_time / capi_lock / capi_feature_state"]
    floor --> leaves
    wrappers["capi_firewall / capi_debug_dump"] --> planes
    codecs["capiw_serde_json / urlencoded / quick_xml / prost"] -.implements.-> contracts
    adapters["capic_reqwest / ureq / wasm_fetch / reqwless / native_client"] -.implements.-> planes
    harness["capi_test_framework"] --> facade
    harness --> testcore["capi_test_core"]
    testcore --> core

Three edges deserve a sentence. capi_base_config depends on capi_core and nothing above it — a config carries codecs and stores, and the decoders reach it through the endpoint, never the reverse. capi_base_decoders depends on capi_transport, because the paged, resumable, and flat-map decoders open the door and run traversals. And the wrappers depend only on capip_http and the HTTP vocabulary, which is what lets a firewall wrap any client the family or a third party ships.


That closes the book. From the decoupling thesis to here: you can build a Capi client, understand why it is shaped the way it is, and consume, patch, test, verify, and ship one everywhere.