pub struct DownloadMeta {
pub content_type: Option<String>,
pub etag: Option<String>,
pub last_modified: Option<String>,
pub expected_size: Option<u64>,
pub suggested_filename: Option<String>,
pub download_start: Option<DateTime<Utc>>,
pub checksum: Option<FileChecksum>,
}Fields§
§content_type: Option<String>从Content-Type头获取的MIME类型
etag: Option<String>服务器返回的ETag(用于缓存验证)
last_modified: Option<String>最后修改时间(Last-Modified头)
expected_size: Option<u64>通过Content-Length获取的预期大小
suggested_filename: Option<String>从Content-Disposition解析的文件名
download_start: Option<DateTime<Utc>>下载开始时间戳
checksum: Option<FileChecksum>文件校验信息(可后续填充)
Implementations§
Source§impl DownloadMeta
impl DownloadMeta
Sourcepub fn from_headers(headers: &HeaderMap) -> Self
pub fn from_headers(headers: &HeaderMap) -> Self
从HTTP响应头生成元数据
Trait Implementations§
Source§impl Clone for DownloadMeta
impl Clone for DownloadMeta
Source§fn clone(&self) -> DownloadMeta
fn clone(&self) -> DownloadMeta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DownloadMeta
impl Debug for DownloadMeta
Source§impl<'de> Deserialize<'de> for DownloadMeta
impl<'de> Deserialize<'de> for DownloadMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DownloadMeta
impl RefUnwindSafe for DownloadMeta
impl Send for DownloadMeta
impl Sync for DownloadMeta
impl Unpin for DownloadMeta
impl UnsafeUnpin for DownloadMeta
impl UnwindSafe for DownloadMeta
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