Skip to main content

Crate api_fetch

Crate api_fetch 

Source
Expand description

§api-fetch

This crate is an alias for better-fetch: same types, same API, alternate name on crates.io.

Modules§

auth
backend
client
endpoint
error
hooks
plugin
plugins
request
response
retry

Macros§

endpoint
Helper macro for simple endpoint definitions.

Structs§

Client
Typed HTTP client built on reqwest.
ClientBuilder
Builder for Client.
ClientConfig
Shared client configuration.
ErrorContext
Context when an error occurs.
Hooks
Lifecycle hooks for the HTTP client.
HttpRequest
Prepared HTTP request passed to a backend.
HttpResponse
Raw HTTP response from a backend.
LoggerPlugin
Tracing-based logger plugin (request, response, retry, error).
PluginRegistry
Ordered plugin list.
PreparedRequest
Prepared request state passed to plugin init.
RequestBuilder
Fluent builder for a single HTTP request.
RequestContext
Context for an outgoing request.
ReqwestBackend
Reqwest-backed HTTP backend.
Response
HTTP response wrapper.
ResponseContext
Context after a response is received.
SuccessContext
Context after a successful HTTP response (2xx).

Enums§

Auth
Authentication configuration for a client or request.
Error
Error type for better-fetch operations.
RetryPolicy
Retry policy configuration.
TokenSource
Source for credential values (static, sync, or async).

Traits§

AsyncTokenProvider
Async token resolver.
Endpoint
Describes a typed API route.
HttpBackend
Plugin
Plugin extension point for better-fetch.

Functions§

default_should_retry
json_parser
Wraps a custom JSON parse function for use with ClientBuilder::json_parser.
serde_json_parser
Default parser using serde_json::from_slice.

Type Aliases§

JsonParserFn
Parses response bytes into JSON before deserializing to T.
Result
Result alias using Error.
ShouldRetryFn
Predicate for whether a response should be retried.