pub struct MetadataConfig {
pub extract_document: bool,
pub extract_headers: bool,
pub extract_links: bool,
pub extract_images: bool,
pub extract_structured_data: bool,
pub max_structured_data_size: usize,
}Expand description
Configuration for metadata extraction granularity.
Controls which metadata types are extracted and size limits for safety.
§Examples
let config = MetadataConfig {
extract_document: true,
extract_headers: true,
extract_links: true,
extract_images: true,
extract_structured_data: true,
max_structured_data_size: 1_000_000,
};
assert!(config.extract_headers);Fields§
§extract_document: boolExtract document-level metadata (title, description, author, etc.)
extract_headers: boolExtract h1-h6 header elements and their hierarchy
extract_links: boolExtract anchor (a) elements as links with type classification
extract_images: boolExtract image elements and data URIs
extract_structured_data: boolExtract structured data (JSON-LD, Microdata, RDFa)
max_structured_data_size: usizeMaximum total size of structured data to collect (bytes) Prevents memory exhaustion on malformed or adversarial documents
Trait Implementations§
Source§impl Clone for MetadataConfig
impl Clone for MetadataConfig
Source§fn clone(&self) -> MetadataConfig
fn clone(&self) -> MetadataConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetadataConfig
impl Debug for MetadataConfig
Source§impl Default for MetadataConfig
impl Default for MetadataConfig
Source§impl<'de> Deserialize<'de> for MetadataConfig
impl<'de> Deserialize<'de> for MetadataConfig
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 MetadataConfig
impl RefUnwindSafe for MetadataConfig
impl Send for MetadataConfig
impl Sync for MetadataConfig
impl Unpin for MetadataConfig
impl UnwindSafe for MetadataConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)