Skip to main content

Module prelude

Module prelude 

Source
Expand description

Convenient re-exports for application code.

use better_fetch::prelude::*;

Modules§

endpoint
Typed API routes via the Endpoint trait.

Macros§

define_params
Defines path parameters for a route and implements EndpointParams.
endpoint
Defines a simple Endpoint with optional typed params and query.
impl_serde_endpoint_query
Implements EndpointQuery for a serde-serializable query struct (feature json).

Structs§

CancellationToken
A token which can be used to signal a cancellation request to one or more tasks.
Client
Typed HTTP client built on reqwest.
ClientBuilder
Builder for Client.
ClientConfig
Shared client configuration (returned by Client::config).
EndpointRequestBuilder
Fluent builder for a typed Endpoint.
Hooks
Lifecycle hooks for the HTTP client.
NeedsBody
Type-state: request body required before send (POST with typed body via #[derive(Endpoint)]).
NeedsParams
Type-state: path parameters still required before send.
Ready
Type-state: ready to configure query/headers and send.
RecordingBackend
Wraps an HttpBackend and records each executed request.
RequestBuilder
Fluent builder for a single HTTP request.
ReqwestBackend
Reqwest-backed HTTP backend.
Response
HTTP response wrapper.
StreamingResponse
HTTP response with a streaming body.

Enums§

Auth
Authentication configuration for a client or request.
Error
Error type for better-fetch operations.
QueryValue
Query parameter value (scalar or repeated).
RecordedBodyKind
Kind of request body last observed (streaming bodies are not replayed).
ResponseBodyKind
Parsed response body selected from Content-Type.
RetryPolicy
Retry policy configuration.
TokenSource
Source for credential values (static, sync, or async).
TransportKind
Classification of underlying transport failures (connection, body, decode, etc.).

Traits§

ApiResponseExt
Extension trait for Response.
DefaultParamsInitial
Default () params initial state when E::Params is [()].
Endpoint
Describes a typed API route.
EndpointBody
Applies a typed request body before send.
EndpointHeaders
Applies typed default headers before send.
EndpointParams
Applies path parameters to a RequestBuilder.
EndpointParamsInitial
Creates the initial EndpointRequestBuilder for client.call::<E>().
EndpointQuery
Applies query parameters to a RequestBuilder.
HttpBackend
Pluggable HTTP transport used by Client.

Functions§

apply_serialized_query
Applies a serde-serializable query struct to a request builder (feature json).
into_api_result
Deserializes a buffered response into success T or API error E by HTTP status.

Type Aliases§

Result
Result alias using Error.