Expand description
Convenient re-exports for application code.
use better_fetch::prelude::*;Modules§
Macros§
- define_
params - Defines path parameters for a route and implements
EndpointParams. - endpoint
- Defines a simple
Endpointwith optional typed params and query. - impl_
serde_ endpoint_ query - Implements
EndpointQueryfor a serde-serializable query struct (featurejson).
Structs§
- Cancellation
Token - A token which can be used to signal a cancellation request to one or more tasks.
- Client
- Typed HTTP client built on reqwest.
- Client
Builder - Builder for
Client. - Client
Config - Shared client configuration (returned by
Client::config). - Endpoint
Request Builder - Fluent builder for a typed
Endpoint. - Hooks
- Lifecycle hooks for the HTTP client.
- 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.
- Recording
Backend - Wraps an
HttpBackendand records each executed request. - Request
Builder - Fluent builder for a single HTTP request.
- Reqwest
Backend - Reqwest-backed HTTP backend.
- Response
- HTTP response wrapper.
- Streaming
Response - HTTP response with a streaming body.
Enums§
- Auth
- Authentication configuration for a client or request.
- Error
- Error type for better-fetch operations.
- Query
Value - Query parameter value (scalar or repeated).
- Recorded
Body Kind - Kind of request body last observed (streaming bodies are not replayed).
- Response
Body Kind - Parsed response body selected from
Content-Type. - Retry
Policy - Retry policy configuration.
- Token
Source - Source for credential values (static, sync, or async).
- Transport
Kind - Classification of underlying transport failures (connection, body, decode, etc.).
Traits§
- ApiResponse
Ext - Extension trait for
Response. - 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. - Http
Backend - 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
Tor API errorEby HTTP status.