pub struct ResumableUpload<'client, Response: DeserializeOwned> { /* private fields */ }
Expand description
A resumable upload in progress, useful for sending large objects.
Implementations§
Source§impl<'client, Response: DeserializeOwned> ResumableUpload<'client, Response>
impl<'client, Response: DeserializeOwned> ResumableUpload<'client, Response>
pub fn new( to: Uri, cl: &'client TlsClient, max_chunksize: usize, ) -> ResumableUpload<'client, Response>
pub fn set_max_chunksize(&mut self, size: usize) -> Result<&mut Self>
Sourcepub async fn upload<R: AsyncRead + Unpin>(
&self,
f: R,
size: usize,
) -> Result<Response>
pub async fn upload<R: AsyncRead + Unpin>( &self, f: R, size: usize, ) -> Result<Response>
Upload data from a reader; use only if the reader cannot be seeked. Memory usage is higher, because data needs to be cached if the server hasn’t accepted all data.
Sourcepub async fn upload_file(&self, f: File) -> Result<Response>
pub async fn upload_file(&self, f: File) -> Result<Response>
Upload content from a file. This is most efficient if you have an actual file, as seek can be used in case the server didn’t accept all data.
Auto Trait Implementations§
impl<'client, Response> !Freeze for ResumableUpload<'client, Response>
impl<'client, Response> !RefUnwindSafe for ResumableUpload<'client, Response>
impl<'client, Response> Send for ResumableUpload<'client, Response>where
Response: Send,
impl<'client, Response> Sync for ResumableUpload<'client, Response>where
Response: Sync,
impl<'client, Response> Unpin for ResumableUpload<'client, Response>where
Response: Unpin,
impl<'client, Response> !UnwindSafe for ResumableUpload<'client, Response>
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 more