Skip to main content

MetadataConfigUpdate

Struct MetadataConfigUpdate 

Source
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 extraction
  • extract_headers: Optional override for heading element extraction
  • extract_links: Optional override for link element extraction
  • extract_images: Optional override for image element extraction
  • extract_structured_data: Optional override for structured data extraction
  • max_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

Source§

fn clone(&self) -> MetadataConfigUpdate

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MetadataConfigUpdate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MetadataConfigUpdate

Source§

fn default() -> MetadataConfigUpdate

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MetadataConfigUpdate

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<MetadataConfigUpdate> for MetadataConfig

Source§

fn from(update: MetadataConfigUpdate) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,