pub struct DownloadedDocument {
pub url: String,
pub mime_type: Cow<'static, str>,
pub content: Vec<u8>,
pub size: usize,
pub filename: Option<Box<str>>,
pub content_hash: Box<str>,
pub headers: HashMap<Box<str>, Box<str>>,
}Expand description
A downloaded non-HTML document (PDF, DOCX, image, code file, etc.).
When the crawler encounters non-HTML content and download_documents is
enabled, it downloads the raw bytes and populates this struct instead of
skipping the resource.
Fields§
§url: StringThe URL the document was fetched from.
mime_type: Cow<'static, str>The MIME type from the Content-Type header.
content: Vec<u8>Raw document bytes. Skipped during JSON serialization.
size: usizeSize of the document in bytes.
filename: Option<Box<str>>Filename extracted from Content-Disposition or URL path.
content_hash: Box<str>SHA-256 hex digest of the content.
headers: HashMap<Box<str>, Box<str>>Selected response headers.
Trait Implementations§
Source§impl Clone for DownloadedDocument
impl Clone for DownloadedDocument
Source§fn clone(&self) -> DownloadedDocument
fn clone(&self) -> DownloadedDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DownloadedDocument
impl Debug for DownloadedDocument
Source§impl Default for DownloadedDocument
impl Default for DownloadedDocument
Source§fn default() -> DownloadedDocument
fn default() -> DownloadedDocument
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DownloadedDocument
impl<'de> Deserialize<'de> for DownloadedDocument
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 DownloadedDocument
impl RefUnwindSafe for DownloadedDocument
impl Send for DownloadedDocument
impl Sync for DownloadedDocument
impl Unpin for DownloadedDocument
impl UnsafeUnpin for DownloadedDocument
impl UnwindSafe for DownloadedDocument
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