Struct siwi_download::download::DownloadReport
source · 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>
impl<'a> DownloadReport<'a>
pub fn new<S: Into<Cow<'a, str>>>( url: S, file_name: S, origin_file_name: S, storage_path: S, file_path: S ) -> Self
pub fn set_file_size(&mut self, file_size: u64) -> &mut Self
pub fn set_range_from(&mut self, range_from: u64) -> &mut Self
pub fn set_download_start_at(&mut self) -> &mut Self
pub fn set_download_end_at(&mut self) -> &mut Self
pub fn set_download_status(&mut self, status: DownloadStatus) -> &mut Self
pub fn set_headers(&mut self, headers: HeaderMap) -> &mut Self
pub fn set_head_status(&mut self, head_status: u16) -> &mut Self
pub fn set_resp_status(&mut self, resp_status: u16) -> &mut Self
pub fn set_msg<S: Into<Cow<'a, str>>>(&mut self, msg: S) -> &mut Self
pub fn gen_time_used(&mut self) -> &mut Self
pub async fn report( &self, url: &str, headers: HeaderMap ) -> AnyResult<Cow<'a, str>>
Trait Implementations§
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> 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