Expand description
Typed API routes via the Endpoint trait.
Define routes as types, then use Client::call for a typed
EndpointRequestBuilder. Path params use .params()
with type-state (NeedsParams); query uses .query()
with structs when you want a query string — not enforced by type-state (see EndpointQuery).
For ad-hoc string paths, use Client::get instead (see RequestBuilder).
Helpers: [endpoint!], [define_params!], and (feature macros) EndpointParamsDerive /
EndpointQueryDerive.
Structs§
- Endpoint
Request Builder - Fluent builder for a typed
Endpoint. - Needs
Body - Type-state: request body required before send (POST with typed body via
#[derive(Endpoint)]). - Needs
Params - Type-state: path parameters still required before send.
- Ready
- Type-state: ready to configure query/headers and send.
Traits§
- Default
Params Initial - Default
()params initial state whenE::Paramsis [()]. - Endpoint
- Describes a typed API route.
- Endpoint
Body - Applies a typed request body before send.
- Endpoint
Headers - Applies typed default headers before send.
- Endpoint
Params - Applies path parameters to a
RequestBuilder. - Endpoint
Params Initial - Creates the initial
EndpointRequestBuilderforclient.call::<E>(). - Endpoint
Query - Applies query parameters to a
RequestBuilder.
Functions§
- apply_
serialized_ query - Applies a serde-serializable query struct to a request builder (feature
json).
Type Aliases§
- Params
Builder State - Initial builder state for an endpoint’s path parameters.
- Params
Builder State After - Builder state after path params when
E::Bodymay require a body.