pub struct Session { /* private fields */ }Expand description
Represents a session with Objectstore, tied to a specific Usecase and Scope within it.
Create a Session using Client::session or Scope::session.
Implementations§
Source§impl Session
impl Session
Sourcepub fn object_url(&self, object_key: &str) -> Url
pub fn object_url(&self, object_key: &str) -> Url
Generates a GET url to the object with the given key.
This can then be used by downstream services to fetch the given object.
NOTE however that the service does not strictly follow HTTP semantics,
in particular in relation to Accept-Encoding.
Source§impl Session
impl Session
Sourcepub fn delete(&self, key: &str) -> DeleteBuilder
pub fn delete(&self, key: &str) -> DeleteBuilder
Deletes the object with the given key.
Source§impl Session
impl Session
Sourcepub fn get(&self, key: &str) -> GetBuilder
pub fn get(&self, key: &str) -> GetBuilder
Retrieves the object with the given key.
Source§impl Session
impl Session
Sourcepub fn many(&self) -> ManyBuilder
pub fn many(&self) -> ManyBuilder
Creates a ManyBuilder associated with this session.
A ManyBuilder can be used to enqueue multiple operations, which the client can choose to
send as batch requests via a dedicated endpoint, minimizing network overhead.
Source§impl Session
impl Session
Sourcepub fn put(&self, body: impl Into<Bytes>) -> PutBuilder
pub fn put(&self, body: impl Into<Bytes>) -> PutBuilder
Creates or replaces an object using a [Bytes]-like payload.
Sourcepub fn put_stream(&self, body: ClientStream) -> PutBuilder
pub fn put_stream(&self, body: ClientStream) -> PutBuilder
Creates or replaces an object using a streaming payload.
Sourcepub fn put_read<R>(&self, body: R) -> PutBuilder
pub fn put_read<R>(&self, body: R) -> PutBuilder
Creates or replaces an object using an [AsyncRead] payload.
Sourcepub fn put_file(&self, file: File) -> PutBuilder
pub fn put_file(&self, file: File) -> PutBuilder
Creates or replaces an object using the contents of a file.
The file is attempted to be read when the request is sent. It’s therefore possible for the file to be moved or changed in the meantime. If you want to avoid this possibility, use one of the other functions to supply a payload directly instead.