rightkit_http/lib.rs
1//! `rightkit-http`: the shared blocking HTTP client for Right Suite apps.
2//!
3//! - [`Client`]: timeouts, bounded bodies, retry/backoff honoring `Retry-After`,
4//! retry-safety rules for non-idempotent methods, streaming responses.
5//! - [`sse`]: WHATWG-compliant Server-Sent Events decoding.
6//! - [`untrusted`]: tamper-evident wrapping of external text for model input.
7//! - [`secret`]: redacted [`Secret`] and the [`SecretStore`] interface that
8//! `rightkit-secrets` implements.
9//! - `async_client` (feature `async`): [`AsyncClient`], the same policy layer on
10//! reqwest/tokio, with a body [`BodyStream`] and an async [`SseStream`].
11//! - `testing` (feature): in-process mock server that records exact requests.
12
13#[cfg(feature = "async")]
14pub mod async_client;
15pub mod client;
16pub mod error;
17pub mod retry;
18pub mod secret;
19pub mod sse;
20pub mod untrusted;
21
22#[cfg(feature = "testing")]
23pub mod testing;
24
25pub use client::{
26 form_encode, percent_decode, percent_encode, Client, ClientConfig, Method, Request, Response,
27 RetryEvent, StreamResponse,
28};
29pub use error::HttpError;
30pub use retry::{parse_retry_after, RetryPolicy};
31pub use secret::{MemorySecretStore, Secret, SecretError, SecretStore};
32pub use sse::{SseDecoder, SseEvent, SseReader};
33pub use untrusted::{wrap_untrusted_web_text, wrap_untrusted_web_text_with, WrapOptions};
34
35#[cfg(feature = "async")]
36pub use async_client::{AsyncClient, AsyncStreamResponse, BodyStream, SseStream};