pub struct Bucket { /* private fields */ }Expand description
A handle bound to one exact bucket identity.
Implementations§
Source§impl Bucket
impl Bucket
Sourcepub fn reference(&self) -> BucketRef
pub fn reference(&self) -> BucketRef
Copy the complete opaque bucket identity for durable application state.
Sourcepub async fn destroy(&self, options: MutationOptions) -> Result<bool>
pub async fn destroy(&self, options: MutationOptions) -> Result<bool>
Delete this exact bucket when it has no versions, markers, or multipart uploads.
§Errors
Returns an error when the bucket is not empty or the service cannot complete the request.
Sourcepub async fn put(
&self,
object_key: impl Into<String>,
body: Bytes,
options: PutOptions,
) -> Result<ObjectVersion>
pub async fn put( &self, object_key: impl Into<String>, body: Bytes, options: PutOptions, ) -> Result<ObjectVersion>
Create one immutable version from buffered bytes.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn put_stream<S>(
&self,
object_key: impl Into<String>,
body: S,
options: PutOptions,
) -> Result<ObjectVersion>
pub async fn put_stream<S>( &self, object_key: impl Into<String>, body: S, options: PutOptions, ) -> Result<ObjectVersion>
Stream one immutable version without buffering it in the SDK.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn get(
&self,
object_key: impl Into<String>,
options: GetOptions,
) -> Result<StoredObject>
pub async fn get( &self, object_key: impl Into<String>, options: GetOptions, ) -> Result<StoredObject>
Open a streaming object read.
§Errors
Returns an error when the service rejects the read or violates framing.
Sourcepub async fn head(
&self,
object_key: impl Into<String>,
options: GetOptions,
) -> Result<ObjectVersion>
pub async fn head( &self, object_key: impl Into<String>, options: GetOptions, ) -> Result<ObjectVersion>
Read immutable object metadata without transferring its body.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn delete(
&self,
object_key: impl Into<String>,
options: DeleteOptions,
) -> Result<DeleteObjectResponse>
pub async fn delete( &self, object_key: impl Into<String>, options: DeleteOptions, ) -> Result<DeleteObjectResponse>
Publish a delete marker or delete one exact immutable version.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn list_page(&self, options: ListOptions) -> Result<ListPage>
pub async fn list_page(&self, options: ListOptions) -> Result<ListPage>
Read one page from a fixed 24-hour listing view.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn snapshot(&self, options: MutationOptions) -> Result<Snapshot>
pub async fn snapshot(&self, options: MutationOptions) -> Result<Snapshot>
Capture an immutable whole-bucket snapshot.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn fork_current(
&self,
destination_name: impl Into<String>,
options: MutationOptions,
) -> Result<Self>
pub async fn fork_current( &self, destination_name: impl Into<String>, options: MutationOptions, ) -> Result<Self>
Atomically fork the current complete bucket state.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn create_multipart(
&self,
object_key: impl Into<String>,
options: PutOptions,
) -> Result<MultipartUpload>
pub async fn create_multipart( &self, object_key: impl Into<String>, options: PutOptions, ) -> Result<MultipartUpload>
Begin a multipart upload.
§Errors
Returns an error when the service rejects or cannot complete the request.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Bucket
impl !RefUnwindSafe for Bucket
impl !UnwindSafe for Bucket
impl Send for Bucket
impl Sync for Bucket
impl Unpin for Bucket
impl UnsafeUnpin for Bucket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request