kithara-net
HTTP networking with retry, timeout, and streaming support. Provides the Net trait for HTTP operations and HttpClient as the default reqwest-based implementation. Includes TimeoutNet decorator and MockNet for testing.
Usage
use ;
let client = new;
let bytes = client.get_bytes.await?;
let stream = client.stream.await?;
Decorators
TimeoutNet<N> wraps all methods with tokio::time::timeout and is exported in the public API. A retry decorator with exponential backoff (retries on 5xx, 429, 408, timeouts; does not retry on other 4xx) is also available, but only via the NetExt builder methods — the wrapper type itself is not part of the public surface.
Decorators compose via the NetExt extension trait:
use ;
use Duration;
use CancellationToken;
let client = new
.with_retry
.with_timeout;
Key Types
Timeout Behavior
get_bytes()andhead(): applyrequest_timeoutfrom options.stream(): no timeout (designed for long-running downloads).- The
TimeoutNetdecorator can override with a custom timeout.
Integration
Used by kithara-file and kithara-hls for all HTTP operations. MockNet (behind the mock feature) enables deterministic testing without network access.