pub struct ResumableUpload { /* private fields */ }Expand description
A handle bound to one resumable upload session.
See the crate-level documentation for more information and examples on using this API.
Implementations§
Source§impl ResumableUpload
impl ResumableUpload
Sourcepub fn token(&self) -> &SessionToken
pub fn token(&self) -> &SessionToken
Returns the session token bound to this upload.
Sourcepub fn granularity(&self) -> Option<u64>
pub fn granularity(&self) -> Option<u64>
Returns this upload’s granularity in bytes, if known.
The granularity is the persistence unit for non-final chunks: chunks shorter than one unit are rejected, and larger chunks may persist only an aligned prefix.
Sourcepub fn progress(&self) -> UploadProgressBuilder
pub fn progress(&self) -> UploadProgressBuilder
Builds a request for the server’s authoritative upload progress.
Sourcepub fn put(&self, offset: u64, chunk: impl Into<Bytes>) -> PutChunkBuilder
pub fn put(&self, offset: u64, chunk: impl Into<Bytes>) -> PutChunkBuilder
Builds a request to write chunk starting at offset.
put doesn’t perform any automatic compression of the payload, so the caller is
responsible for applying compression to the entire payload beforehand and passing chunks
of the already compressed payload to this method.
The returned progress contains the authoritative server offset, which should be used for subsequent requests.
Sourcepub fn put_stream(
&self,
offset: u64,
length: u64,
stream: ClientStream,
) -> PutChunkBuilder
pub fn put_stream( &self, offset: u64, length: u64, stream: ClientStream, ) -> PutChunkBuilder
Builds a request to write a streaming chunk of length bytes at offset.
The stream must yield exactly length bytes. If this upload records compression,
those bytes must come from the object after it has been compressed in full.
Sourcepub fn put_read<R>(
&self,
offset: u64,
length: u64,
reader: R,
) -> PutChunkBuilder
pub fn put_read<R>( &self, offset: u64, length: u64, reader: R, ) -> PutChunkBuilder
Builds a request to write an [AsyncRead] chunk of length bytes at offset.
The reader must produce exactly length bytes. If this upload records compression,
those bytes must come from the object after it has been compressed in full.
Sourcepub fn cancel(&self) -> CancelUploadBuilder
pub fn cancel(&self) -> CancelUploadBuilder
Builds a request to cancel this upload session, discarding any uploaded bytes.
Trait Implementations§
Source§impl Clone for ResumableUpload
impl Clone for ResumableUpload
Source§fn clone(&self) -> ResumableUpload
fn clone(&self) -> ResumableUpload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ResumableUpload
impl !UnwindSafe for ResumableUpload
impl Freeze for ResumableUpload
impl Send for ResumableUpload
impl Sync for ResumableUpload
impl Unpin for ResumableUpload
impl UnsafeUnpin for ResumableUpload
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 more