Expand description
§API
The api module provides the entry point to the public API. Requests are routed to the appropriate handler for processing, returning a response that can be serialized to a JSON object or directly to HTTP.
§Example Usage
ⓘ
use omnia_sdk::{Body, Client, Headers};
// Create a client (typestate builder)
let client = Client::new("alice").provider(provider);
// Simple request without headers
let response = client.request(my_request).await?;
// Request with headers
let response = client.request(my_request).headers(my_headers).await?;Structs§
- Client
- Build an API client to execute the request.
- Context
- Request-scoped context passed to
Handler::handle. - Http
Error - Error type for HTTP requests.
- NoOwner
- Marker type indicating no owner has been set yet.
- NoProvider
- Marker type indicating no provider has been set yet.
- NoRequest
- Marker type indicating no request has been set yet.
- Owner
Set - Marker type indicating the owner has been set.
- Provider
Set - Marker type indicating the provider has been set.
- Reply
- Top-level response data structure common to all handlers.
- Request
Handler - Request router.
- Request
Set - Marker type wrapping a request that has been set.
Traits§
- Body
- The
Bodytrait is used to restrict the types able to implement request body. It is implemented by allxxxRequesttypes. - Handler
- Trait to provide a common interface for request handling.
- Into
Body - Implemented by the
Reply::bodyto convert itself into a format compatible with[IntoResponse]. - Provider
- Provider trait for request handlers.
Type Aliases§
- Http
Result - Result type for HTTP requests.
- Request
- Type alias for a
RequestHandler.