Skip to main content

Crate uarp_sdk

Crate uarp_sdk 

Source
Expand description

Async Rust client for the UARP (Snaga) Universal Agent Runtime Platform.

use futures_util::StreamExt;

#[tokio::main]
async fn main() -> Result<(), uarp_sdk::Error> {
    let client = uarp_sdk::Client::from_env()?;
    let agents = client.agents();
    let params = uarp_sdk::api::ListAgentsParams { limit: Some(50), ..Default::default() };

    // Every item across every page.
    let mut all = std::pin::pin!(agents.list_all(&params));
    while let Some(agent) = all.next().await {
        println!("{:?}", agent?.name);
    }
    Ok(())
}

The API surface under api is generated from spec/openapi.json; the transport, error, pagination and SSE layers are hand-written.

Modules§

api
One module per OpenAPI tag, each with its own *Api accessor on Client.
models
Data models for UARP — Universal Agent Runtime Platform (spec version 0.4.0).

Structs§

ApiError
A non-2xx response, with the parsed problem document attached.
Client
Client for the UARP platform API.
ClientBuilder
Fluent configuration for Client.
Event
One decoded text/event-stream frame.
EventStream
A live SSE stream.
FieldError
FilePart
A file to upload. data is sent verbatim as the part body.
Problem
RFC 9457 problem document returned by the API on failure.
Request
What a generated method hands to the transport.
RequestOptions
Per-call overrides.
StreamOptions
Reconnection and lifecycle behaviour for EventStream. Every field defaults to a generic, spec-compliant SSE stream; the platform-specific knobs (terminal events, an inactivity watchdog, retry: pacing) are opt-in so a caller that passes Default::default gets standard SSE.

Enums§

ApiErrorKind
A coarse classification of an ApiError, convenient for match.
Error
Everything that can go wrong while talking to the platform.
StreamState
Connection-lifecycle states reported by EventStream via StreamOptions::on_state.

Constants§

DEFAULT_BASE_URL
Production base URL.
NO_BODY
Placeholder for “this request has no body”.
NO_QUERY
Placeholder for “this request has no query string”.
SCOPES
Every scope named by the UARP security scheme.
SPEC_VERSION
Version of the OpenAPI document this SDK was generated from.
VERSION
The version of this crate.

Type Aliases§

Result