pub trait PutObjectRequest: Send {
type ClientError: Error + Send + Sync + 'static;
// Required methods
async fn write(
&mut self,
slice: &[u8],
) -> ObjectClientResult<(), PutObjectError, Self::ClientError>;
async fn complete(
self,
) -> ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>;
async fn review_and_complete(
self,
review_callback: impl FnOnce(UploadReview) -> bool + Send + 'static,
) -> ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>;
}Expand description
A streaming put request which allows callers to asynchronously write the body of the request.
You can call the write method to write data to the object, and then call
complete to complete the upload. Alternatively, you can call
review_and_complete to review the upload before completing it,
giving the chance to cancel the request if the upload is not as expected.
This is an async trait defined with the async-trait
crate, and so implementations of this trait must use the #[async_trait::async_trait]
attribute.
Required Associated Types§
type ClientError: Error + Send + Sync + 'static
Required Methods§
sourceasync fn write(
&mut self,
slice: &[u8],
) -> ObjectClientResult<(), PutObjectError, Self::ClientError>
async fn write( &mut self, slice: &[u8], ) -> ObjectClientResult<(), PutObjectError, Self::ClientError>
Write the given slice to the put request body.
sourceasync fn complete(
self,
) -> ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>
async fn complete( self, ) -> ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>
Complete the put request and return a PutObjectResult.
sourceasync fn review_and_complete(
self,
review_callback: impl FnOnce(UploadReview) -> bool + Send + 'static,
) -> ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>
async fn review_and_complete( self, review_callback: impl FnOnce(UploadReview) -> bool + Send + 'static, ) -> ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>
Review and complete the put request and return a PutObjectResult.
Object Safety§
This trait is not object safe.