pub struct ResumableUploadHelper<'a, A: 'a, S>
where S: Service<Uri> + Clone + Send + Sync + 'static, S::Response: Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static, S::Future: Send + Unpin + 'static, S::Error: Into<Box<dyn StdError + Send + Sync>>,
{ pub client: &'a Client<S, Body>, pub delegate: &'a mut dyn Delegate, pub start_at: Option<u64>, pub auth: &'a A, pub user_agent: &'a str, pub auth_header: String, pub url: &'a str, pub reader: &'a mut dyn ReadSeek, pub media_type: Mime, pub content_length: u64, }
Expand description

A utility type to perform a resumable upload from start to end.

Fields§

§client: &'a Client<S, Body>§delegate: &'a mut dyn Delegate§start_at: Option<u64>§auth: &'a A§user_agent: &'a str§auth_header: String§url: &'a str§reader: &'a mut dyn ReadSeek§media_type: Mime§content_length: u64

Implementations§

source§

impl<'a, A, S> ResumableUploadHelper<'a, A, S>
where S: Service<Uri> + Clone + Send + Sync + 'static, S::Response: Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static, S::Future: Send + Unpin + 'static, S::Error: Into<Box<dyn StdError + Send + Sync>>,

source

pub async fn upload(&mut self) -> Option<Result<Response<Body>>>

returns None if operation was cancelled by delegate, or the HttpResult. It can be that we return the result just because we didn’t understand the status code - caller should check for status himself before assuming it’s OK to use

Auto Trait Implementations§

§

impl<'a, A, S> !RefUnwindSafe for ResumableUploadHelper<'a, A, S>

§

impl<'a, A, S> Send for ResumableUploadHelper<'a, A, S>
where A: Sync,

§

impl<'a, A, S> !Sync for ResumableUploadHelper<'a, A, S>

§

impl<'a, A, S> Unpin for ResumableUploadHelper<'a, A, S>

§

impl<'a, A, S> !UnwindSafe for ResumableUploadHelper<'a, A, S>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more