pub struct DownloadReport<'a> {
Show 15 fields pub url: Cow<'a, str>, pub file_name: Cow<'a, str>, pub origin_file_name: Cow<'a, str>, pub storage_path: Cow<'a, str>, pub file_path: Cow<'a, str>, pub file_size: Option<u64>, pub range_from: Option<u64>, pub download_start_at: Option<DateTime<Utc>>, pub download_end_at: Option<DateTime<Utc>>, pub download_status: Option<DownloadStatus>, pub headers: Option<HeaderMap>, pub head_status: Option<u16>, pub resp_status: Option<u16>, pub time_used: Option<i64>, pub msg: Option<Cow<'a, str>>,
}

Fields§

§url: Cow<'a, str>§file_name: Cow<'a, str>§origin_file_name: Cow<'a, str>§storage_path: Cow<'a, str>§file_path: Cow<'a, str>§file_size: Option<u64>§range_from: Option<u64>§download_start_at: Option<DateTime<Utc>>§download_end_at: Option<DateTime<Utc>>§download_status: Option<DownloadStatus>§headers: Option<HeaderMap>§head_status: Option<u16>§resp_status: Option<u16>§time_used: Option<i64>§msg: Option<Cow<'a, str>>

Implementations§

source§

impl<'a> DownloadReport<'a>

source

pub fn new<S: Into<Cow<'a, str>>>( url: S, file_name: S, origin_file_name: S, storage_path: S, file_path: S ) -> Self

source

pub fn set_file_size(&mut self, file_size: u64) -> &mut Self

source

pub fn set_range_from(&mut self, range_from: u64) -> &mut Self

source

pub fn set_download_start_at(&mut self) -> &mut Self

source

pub fn set_download_end_at(&mut self) -> &mut Self

source

pub fn set_download_status(&mut self, status: DownloadStatus) -> &mut Self

source

pub fn set_headers(&mut self, headers: HeaderMap) -> &mut Self

source

pub fn set_head_status(&mut self, head_status: u16) -> &mut Self

source

pub fn set_resp_status(&mut self, resp_status: u16) -> &mut Self

source

pub fn set_msg<S: Into<Cow<'a, str>>>(&mut self, msg: S) -> &mut Self

source

pub fn gen_time_used(&mut self) -> &mut Self

source

pub async fn report( &self, url: &str, headers: HeaderMap ) -> AnyResult<Cow<'a, str>>

Trait Implementations§

source§

impl<'a> Debug for DownloadReport<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for DownloadReport<'a>

§

impl<'a> Send for DownloadReport<'a>

§

impl<'a> Sync for DownloadReport<'a>

§

impl<'a> Unpin for DownloadReport<'a>

§

impl<'a> UnwindSafe for DownloadReport<'a>

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