Expand description
Core types and traits for pincer declarative HTTP client.
This crate provides the foundational types used by pincer:
Method- HTTP method enumRequestandRequestBuilder- HTTP request typesResponse- HTTP response typeErrorandResult- Error handlingHttpClient- Core client trait for HTTP executionPincerClient- Extended client trait with base URL supportStatusCode- HTTP status codes (re-exported fromhttpcrate)header- HTTP header names (re-exported fromhttpcrate)ToQueryPairs- Trait for converting types to query parameter pairsPathTemplate- Original path template for middleware access
Modules§
Structs§
- Default
Error Decoder - Default error decoder that always returns
None. - Form
- A multipart form containing multiple parts.
- Param
Meta - Metadata about a single parameter.
- Parameter
Metadata - All parameter metadata for a method call.
- Part
- A single part in a multipart form.
- Path
Template - The original path template before parameter substitution.
- Request
- An HTTP request with method, URL, headers, optional body, and extensions.
- Request
Builder - Builder for constructing
Requestinstances. - Response
- HTTP response with status, headers, and body.
- Status
Code - An HTTP status code (
status-codein RFC 9110 et al.).
Enums§
- Content
Type - Content type for request bodies.
- Error
- Main error type for pincer operations.
- Method
- HTTP request method.
- Param
Location - Parameter location in the HTTP request.
Traits§
- Error
Decoder - Trait for decoding HTTP error responses into typed errors.
- Http
Client - Core HTTP client trait.
- Http
Client Ext - Extension trait for
HttpClientwith convenience methods. - Pincer
Client - Trait for types that can be used as pincer API clients.
- ToQuery
Pairs - Trait for types that can be converted to query parameter pairs.
Functions§
- from_
json - Deserialize JSON bytes to a value with path-aware error messages.
- to_form
- Serialize a value to form URL-encoded bytes.
- to_json
- Serialize a value to JSON bytes.
- to_
query_ string - Serialize a value to a query string.
Type Aliases§
- Result
- Result type alias using
crate::Error.