Crate objectstore_client

Crate objectstore_client 

Source
Expand description

§Objectstore Client

The client is used to interface with the objectstore backend. It handles responsibilities like transparent compression, and making sure that uploads and downloads are done as efficiently as possible.

§Usage

use objectstore_client::{ClientBuilder, Usecase};

#[tokio::main]
let client = ClientBuilder::new("http://localhost:8888/").build().unwrap();
let usecase = Usecase::new("usecase");
let session = client.session(usecase.for_project(12345, 1337)).unwrap();

let response = session.put("hello world").send().await?;
let object = session.get(&response.key).send().await?.expect("object to exist");
assert_eq!(object.payload().await?, "hello world");

Structs§

Client
A client for Objectstore. Use Client::builder to get configure and construct this.
ClientBuilder
Builder to create a Client.
DeleteBuilder
A DELETE request builder.
GetBuilder
A GET request builder.
GetResponse
The result from a successful get() call.
PutBuilder
A PUT request builder.
PutResponse
The response returned from the service after uploading an object.
Scope
TODO: document
Session
TODO: document
Usecase
An identifier for a workload in Objectstore, along with defaults to use for all operations within that Usecase.

Enums§

Compression
The compression algorithm of an object to upload.
Error
Errors that can happen within the objectstore-client
ExpirationPolicy
The per-object expiration policy

Constants§

PARAM_SCOPE
HTTP request query parameter that contains the request scope.
PARAM_USECASE
HTTP request query parameter that contains the request usecase.

Type Aliases§

ClientStream
The type of Stream to be used for a PUT request.
DeleteResponse
The result from a successful delete() call.
Result
A convenience alias that defaults our Error type.