client
ModuleThe HTTP client S3 sends its requests through.
Contents
use utopia_storage::s3::client::HttpClient;pub struct HttpClientThe default client: HTTP/1.1 over plain TCP or TLS (the web PKI's
roots), keeping connections alive, with no overall deadline. Request
payloads go out chunk by chunk, and Client::stream hands the
response body over as it arrives.
Default.use utopia_storage::s3::client::Payload;pub struct Payload(Contents)The body of a [Request]: bytes in memory, or a seekable Body
streamed from its start each time the request is sent, so a retry sends
the same bytes and only one chunk of a large upload is in memory at a
time.
use utopia_storage::Body;
use utopia_storage::s3::Payload;
let payload = Payload::from_body(Body::from("Hello World"));
assert_eq!(&payload.bytes().await?[..], b"Hello World");
assert_eq!(&payload.bytes().await?[..], b"Hello World"); // read again from the startDebug, From.use utopia_storage::s3::client::Request;pub struct RequestA request, as a Client sends it.
use utopia_storage::s3::client::Response;pub struct Response<B = Bytes>A response, as a Client returns it: its body in memory (Bytes, from
Client::send) or still to read (Body, from Client::stream).
use utopia_storage::s3::client::Retry;pub struct Retry<C>A client that retries what a RetryStrategy says to. Each attempt
sends the request's Payload again from its start.
use utopia_storage::s3::client::Method;pub enum MethodAn HTTP method S3 requests use.
use utopia_storage::s3::client::TransportError;pub enum TransportErrorWhy a request got no response.
use utopia_storage::s3::client::Client;pub trait Client: Send + SyncSends HTTP requests. Implement it to route S3 traffic through a client of your own (a proxy, a test double).