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::builderto get configure and construct this. - Client
Builder - Builder to create a
Client. - Delete
Builder - 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
- Expiration
Policy - 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§
- Client
Stream - The type of
Streamto be used for a PUT request. - Delete
Response - The result from a successful
delete()call. - Result
- A convenience alias that defaults our
Errortype.