pub struct Object { /* private fields */ }Expand description
Convenience wrapper around repeated operations on one object key.
Implementations§
Source§impl Object
impl Object
Sourcepub async fn stat(&mut self) -> Result<ObjectMeta, S3Error>
pub async fn stat(&mut self) -> Result<ObjectMeta, S3Error>
Fetches metadata for the current object.
Sourcepub async fn exists(&mut self) -> Result<bool, S3Error>
pub async fn exists(&mut self) -> Result<bool, S3Error>
Reports whether the current object exists.
Sourcepub async fn stream(
&mut self,
options: Option<ReadOptions>,
) -> Result<ObjectReader, S3Error>
pub async fn stream( &mut self, options: Option<ReadOptions>, ) -> Result<ObjectReader, S3Error>
Opens a streaming reader for the current object.
Sourcepub async fn bytes(
&mut self,
options: Option<ReadOptions>,
) -> Result<Vec<u8>, S3Error>
pub async fn bytes( &mut self, options: Option<ReadOptions>, ) -> Result<Vec<u8>, S3Error>
Reads the entire object into memory.
Sourcepub async fn text(
&mut self,
options: Option<ReadOptions>,
) -> Result<String, S3Error>
pub async fn text( &mut self, options: Option<ReadOptions>, ) -> Result<String, S3Error>
Reads the entire object as UTF-8 text.
Sourcepub async fn json<T>(
&mut self,
options: Option<ReadOptions>,
) -> Result<T, S3Error>where
T: DeserializeOwned,
pub async fn json<T>(
&mut self,
options: Option<ReadOptions>,
) -> Result<T, S3Error>where
T: DeserializeOwned,
Reads and decodes the entire object as JSON.
Sourcepub async fn write<B>(
&mut self,
body: B,
options: Option<WriteOptions>,
) -> Result<ObjectMeta, S3Error>
pub async fn write<B>( &mut self, body: B, options: Option<WriteOptions>, ) -> Result<ObjectMeta, S3Error>
Uploads a new object body.
Sourcepub async fn write_chunks<I, B>(
&mut self,
chunks: I,
options: Option<WriteOptions>,
) -> Result<ObjectMeta, S3Error>
pub async fn write_chunks<I, B>( &mut self, chunks: I, options: Option<WriteOptions>, ) -> Result<ObjectMeta, S3Error>
Uploads a pre-chunked object body.
Sourcepub async fn write_bytes(
&mut self,
body: impl AsRef<[u8]>,
options: Option<WriteOptions>,
) -> Result<ObjectMeta, S3Error>
pub async fn write_bytes( &mut self, body: impl AsRef<[u8]>, options: Option<WriteOptions>, ) -> Result<ObjectMeta, S3Error>
Uploads raw bytes.
Sourcepub async fn write_string(
&mut self,
body: impl AsRef<str>,
options: Option<WriteOptions>,
) -> Result<ObjectMeta, S3Error>
pub async fn write_string( &mut self, body: impl AsRef<str>, options: Option<WriteOptions>, ) -> Result<ObjectMeta, S3Error>
Uploads UTF-8 text.
Sourcepub async fn write_json<T>(
&mut self,
value: &T,
options: Option<WriteOptions>,
) -> Result<ObjectMeta, S3Error>
pub async fn write_json<T>( &mut self, value: &T, options: Option<WriteOptions>, ) -> Result<ObjectMeta, S3Error>
Uploads JSON, defaulting the content type when omitted.
Sourcepub async fn presign(
&mut self,
options: Option<PresignOptions>,
) -> Result<PresignResult, S3Error>
pub async fn presign( &mut self, options: Option<PresignOptions>, ) -> Result<PresignResult, S3Error>
Creates a presigned URL for the current object.
Sourcepub async fn create_access_url(
&mut self,
options: Option<ObjectAccessURLOptions>,
) -> Result<ObjectAccessURL, S3Error>
pub async fn create_access_url( &mut self, options: Option<ObjectAccessURLOptions>, ) -> Result<ObjectAccessURL, S3Error>
Creates a host-mediated object-access URL for the current object.
Auto Trait Implementations§
impl !Freeze for Object
impl !RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnsafeUnpin for Object
impl !UnwindSafe for Object
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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Wrap the input message
T in a tonic::Request