pub struct MetadataConfigUpdate {
pub extract_document: Option<bool>,
pub extract_headers: Option<bool>,
pub extract_links: Option<bool>,
pub extract_images: Option<bool>,
pub extract_structured_data: Option<bool>,
pub max_structured_data_size: Option<usize>,
}Expand description
Partial update for MetadataConfig.
This struct uses Option<T> to represent optional fields that can be selectively updated.
Only specified fields (Some values) will override existing config; None values leave the
corresponding fields unchanged when applied via MetadataConfig::apply_update.
§Fields
extract_document: Optional override for document-level metadata extractionextract_headers: Optional override for heading element extractionextract_links: Optional override for link element extractionextract_images: Optional override for image element extractionextract_structured_data: Optional override for structured data extractionmax_structured_data_size: Optional override for structured data size limit
§Examples
let update = MetadataConfigUpdate {
extract_document: Some(false),
extract_headers: Some(true),
extract_links: None, // No change
extract_images: None, // No change
extract_structured_data: None, // No change
max_structured_data_size: None, // No change
};
let mut config = MetadataConfig::default();
config.apply_update(update);
assert!(!config.extract_document);
assert!(config.extract_headers);Fields§
§extract_document: Option<bool>Optional override for extracting document-level metadata.
When Some(true), enables document metadata extraction; Some(false) disables it. None leaves the current setting unchanged.
extract_headers: Option<bool>Optional override for extracting heading elements (h1-h6).
When Some(true), enables header extraction; Some(false) disables it. None leaves the current setting unchanged.
extract_links: Option<bool>Optional override for extracting anchor (link) elements.
When Some(true), enables link extraction; Some(false) disables it. None leaves the current setting unchanged.
extract_images: Option<bool>Optional override for extracting image elements.
When Some(true), enables image extraction; Some(false) disables it. None leaves the current setting unchanged.
extract_structured_data: Option<bool>Optional override for extracting structured data (JSON-LD, Microdata, RDFa).
When Some(true), enables structured data extraction; Some(false) disables it. None leaves the current setting unchanged.
max_structured_data_size: Option<usize>Optional override for maximum structured data collection size in bytes.
When Some(size), sets the new size limit. None leaves the current limit unchanged. Use this to adjust safety thresholds for different documents.
Trait Implementations§
Source§impl Clone for MetadataConfigUpdate
impl Clone for MetadataConfigUpdate
Source§fn clone(&self) -> MetadataConfigUpdate
fn clone(&self) -> MetadataConfigUpdate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more