pub struct Upload { /* private fields */ }Expand description
Upload manages the lifecycle of an AWS S3 multipart upload.
This type realizes MultipartWrite through the following:
poll_readyensures that there is a valid, active multipart upload, and that the number of pending part upload requests does not exceed configured capacity.start_sendaccepts aPartBody, creates a part upload request future from it, and pushes it to a collection of these, where the responses are resolved asynchronously and independently. Current statistics of the upload are returned in the valueUploadStatus.poll_flushawaits all pending part upload request futures, draining the collection.poll_completeflushes and then submits the request to complete the multipart upload, returning the response as the valueUploaded.
On completion, a new upload is started if possible. This relies on the
ability of the ObjectUriIter that it was created with to generate the
next upload URI. Polling for readiness ensures that the new upload has
resolved to an upload ID before allowing start_send.
§Fusing
If ObjectUriIter::next ever produces None, the multipart upload will
transition to a terminated state and it is not polled again.
Trait Implementations§
Source§impl FusedMultipartWrite<PartBody> for Upload
impl FusedMultipartWrite<PartBody> for Upload
Source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns
true if the writer should no longer be polled.Source§impl MultipartWrite<PartBody> for Upload
impl MultipartWrite<PartBody> for Upload
Source§type Output = Uploaded
type Output = Uploaded
The type of value assembled from the parts when they have all been
written.
Source§type Recv = UploadStatus
type Recv = UploadStatus
The type of value returned when sending a part to be written began
successfully.
Source§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
MultipartWrite to receive a new part. Read moreSource§fn start_send(
self: Pin<&mut Self>,
part: PartBody,
) -> Result<Self::Recv, Self::Error>
fn start_send( self: Pin<&mut Self>, part: PartBody, ) -> Result<Self::Recv, Self::Error>
Begin the process of writing a part to this writer, returning the
associated type confirming it was received successfully. Read more
impl<'pin> Unpin for Uploadwhere
PinnedFieldsOf<__Upload<'pin>>: Unpin,
Auto Trait Implementations§
impl !Freeze for Upload
impl !RefUnwindSafe for Upload
impl Send for Upload
impl !Sync for Upload
impl UnsafeUnpin for Upload
impl !UnwindSafe for Upload
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.
Source§impl<Wr, Part> MultipartWriteExt<Part> for Wrwhere
Wr: MultipartWrite<Part>,
impl<Wr, Part> MultipartWriteExt<Part> for Wrwhere
Wr: MultipartWrite<Part>,
Source§fn boxed<'a>(
self,
) -> Pin<Box<dyn MultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + Send + 'a>>
fn boxed<'a>( self, ) -> Pin<Box<dyn MultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + Send + 'a>>
Wrap this writer in a
Box, pinning it.Source§fn box_fused<'a>(
self,
) -> Pin<Box<dyn FusedMultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + Send + 'a>>
fn box_fused<'a>( self, ) -> Pin<Box<dyn FusedMultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + Send + 'a>>
Wrap this writer, which additionally has conditions making it a
FusedMultipartWrite, in a Box, pinning it.Source§fn box_fused_local<'a>(
self,
) -> Pin<Box<dyn FusedMultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + 'a>>where
Self: Sized + FusedMultipartWrite<Part> + 'a,
fn box_fused_local<'a>(
self,
) -> Pin<Box<dyn FusedMultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + 'a>>where
Self: Sized + FusedMultipartWrite<Part> + 'a,
Wrap this writer, which additionally has conditions making it a
FusedMultipartWrite, in a Box, pinning it. Read moreSource§fn boxed_local<'a>(
self,
) -> Pin<Box<dyn MultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(
self,
) -> Pin<Box<dyn MultipartWrite<Part, Error = Self::Error, Recv = Self::Recv, Output = Self::Output> + 'a>>where
Self: Sized + 'a,
Wrap this writer in a
Box, pinning it. Read moreSource§fn buffered(self, capacity: impl Into<Option<usize>>) -> Buffered<Self, Part>where
Self: Sized,
fn buffered(self, capacity: impl Into<Option<usize>>) -> Buffered<Self, Part>where
Self: Sized,
Adds a fixed size buffer to the current writer. Read more
Source§fn complete(&mut self) -> Complete<'_, Self, Part>where
Self: Unpin,
fn complete(&mut self) -> Complete<'_, Self, Part>where
Self: Unpin,
A future that runs this writer to completion, returning the associated
output.
Source§fn fanout<U>(self, other: U) -> Fanout<Self, U, Part>
fn fanout<U>(self, other: U) -> Fanout<Self, U, Part>
Fanout the part to multiple writers. Read more
Source§fn feed(&mut self, part: Part) -> Feed<'_, Self, Part>where
Self: Unpin,
fn feed(&mut self, part: Part) -> Feed<'_, Self, Part>where
Self: Unpin,
A future that completes after the given part has been received by the
writer. Read more
Source§fn filter_part<F>(self, f: F) -> FilterPart<Self, Part, F>
fn filter_part<F>(self, f: F) -> FilterPart<Self, Part, F>
Apply a filter to this writer’s parts, returning a new writer with the
same output. Read more
Source§fn filter_map_part<P, F>(self, f: F) -> FilterMapPart<Self, Part, P, F>
fn filter_map_part<P, F>(self, f: F) -> FilterMapPart<Self, Part, P, F>
Attempt to map the input to a part for this writer, filtering out the
inputs where the mapping returns
None. Read moreSource§fn flush(&mut self) -> Flush<'_, Self, Part>where
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self, Part>where
Self: Unpin,
A future that completes when the underlying writer has been flushed.
Source§fn fold_sent<T, F>(self, id: T, f: F) -> FoldSent<Self, T, F, Part>
fn fold_sent<T, F>(self, id: T, f: F) -> FoldSent<Self, T, F, Part>
Accumulate the values returned by starting a send, returning it with the
output. Read more
Source§fn for_each_recv<Fut, F>(self, f: F) -> ForEachRecv<Self, Part, Fut, F>
fn for_each_recv<Fut, F>(self, f: F) -> ForEachRecv<Self, Part, Fut, F>
Evaluate the given async closure on the associated
Self::Recv for this
writer. Read moreSource§fn fuse<F>(self, f: F) -> Fuse<Self, Part, F>
fn fuse<F>(self, f: F) -> Fuse<Self, Part, F>
Returns a new writer that fuses according to the provided closure. Read more
Source§fn lift<U, P>(self, other: U) -> Lift<Self, U, P, Part>where
Self: Sized,
Self::Error: From<<U as MultipartWrite<P>>::Error>,
U: MultipartWrite<P, Output = Part>,
fn lift<U, P>(self, other: U) -> Lift<Self, U, P, Part>where
Self: Sized,
Self::Error: From<<U as MultipartWrite<P>>::Error>,
U: MultipartWrite<P, Output = Part>,
Produce the parts for this writer from the output of another writer. Read more
Source§fn map_sent<R, F>(self, f: F) -> MapSent<Self, Part, R, F>
fn map_sent<R, F>(self, f: F) -> MapSent<Self, Part, R, F>
Map this writer’s return type to a different value, returning a new
multipart writer with the given return type. Read more
Source§fn map_err<E, F>(self, f: F) -> MapErr<Self, Part, E, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, Part, E, F>
Map this writer’s error type to a different value, returning a new
multipart writer with the given error type.
Source§fn map_ok<T, F>(self, f: F) -> MapOk<Self, Part, T, F>
fn map_ok<T, F>(self, f: F) -> MapOk<Self, Part, T, F>
Map this writer’s output type to a different type, returning a new
multipart writer with the given output type.
Source§fn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
fn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
A convenience method for calling
MultipartWrite::poll_ready on
Unpin writer types.Source§fn poll_flush_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
fn poll_flush_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
A convenience method for calling
MultipartWrite::poll_flush on
Unpin writer types.Source§fn poll_complete_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::Output, Self::Error>>where
Self: Unpin,
fn poll_complete_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::Output, Self::Error>>where
Self: Unpin,
A convenience method for calling
MultipartWrite::poll_complete on
Unpin writer types.Source§fn ready_part<P, Fut, F>(self, f: F) -> ReadyPart<Self, Part, P, Fut, F>
fn ready_part<P, Fut, F>(self, f: F) -> ReadyPart<Self, Part, P, Fut, F>
Provide a part to this writer in the output of a future. Read more
Source§fn send_flush(&mut self, part: Part) -> SendFlush<'_, Self, Part>where
Self: Unpin,
fn send_flush(&mut self, part: Part) -> SendFlush<'_, Self, Part>where
Self: Unpin,
A future that completes when a part has been fully processed into the
writer, including flushing.