Skip to main content

trusted_router/
lib.rs

1//! Official Rust SDK for [TrustedRouter](https://trustedrouter.com).
2//!
3//! The crate keeps inference traffic on the attested API plane and account or
4//! catalog traffic on the control plane. The async [`Client`] is the primary
5//! API. Enable the default `blocking` feature for `BlockingClient`.
6
7#![doc = include_str!("../README.md")]
8#![deny(missing_docs, rustdoc::broken_intra_doc_links)]
9
10mod attestation;
11mod blocking;
12mod client;
13mod constants;
14mod error;
15mod oauth;
16mod receipts;
17mod sse;
18mod telemetry;
19mod tools;
20mod transport;
21mod types;
22
23pub use attestation::{
24    policy_from_trust_release, verify_gateway_attestation, verify_gateway_attestation_document,
25    AttestationBinding, AttestationPolicy, AttestationVerificationOptions,
26    DocumentVerificationOptions, GatewayAttestation, GatewayAttestationDocument, TrustRelease,
27    TrustReleaseDataPolicy, TrustReleaseTls, EXPORTER_LABEL, EXPORTER_LENGTH, GCP_ISSUER,
28    GCP_JWKS_URL,
29};
30#[cfg(feature = "blocking")]
31pub use blocking::BlockingClient;
32pub use client::{CallOptions, Client, ClientBuilder, Plane};
33pub use constants::*;
34pub use error::{ApiError, Error, ErrorKind, Result};
35pub use oauth::{
36    create_pkce_pair, random_oauth_state, OAuthAuthorization, OAuthAuthorizeOptions, OAuthCallback,
37    OAuthKeyExchangeRequest, OAuthKeyExchangeResponse, OAuthLoopback, OAuthLoopbackOptions,
38    OAuthPkcePair,
39};
40pub use receipts::{
41    verify_receipt, MissingAttestationError, MissingBindingError, ReceiptAttestationStatus,
42    ReceiptCapture, ReceiptClaims, ReceiptHashClaims, ReceiptIssuerError, ReceiptModelClaims,
43    ReceiptResult, ReceiptUpstreamClaims, ReceiptVerificationError, ReceiptVerificationOptions,
44    UnsupportedAttestationError,
45};
46pub use sse::{JsonStream, ResponseEventStream, SseEvent, SseStream, TextStream};
47pub use tools::{
48    advisor_tool, map_reduce_tool, selector_tool, subagent_tool, synth_tool, AdvisorToolOptions,
49    MapReduceToolOptions, SelectionStrategy, SelectorToolOptions, SubagentToolOptions,
50    SynthToolOptions,
51};
52pub use types::*;