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.