pub struct RdfaLiteExtractor;Expand description
Extracts Schema.org structured data from RDFa Lite 1.1 attributes.
§Examples
use schemaorg_rs::extraction::{Extractor, RdfaLiteExtractor};
let html = r#"<html><body>
<div vocab="https://schema.org/" typeof="Product">
<span property="name">Widget</span>
</div>
</body></html>"#;
let output = RdfaLiteExtractor.extract(html).unwrap();
assert_eq!(output.nodes[0].types, vec!["Product"]);Implementations§
Source§impl RdfaLiteExtractor
impl RdfaLiteExtractor
Sourcepub fn extract_from_document(
&self,
document: &Html,
) -> Result<ExtractionOutput, ExtractionError>
pub fn extract_from_document( &self, document: &Html, ) -> Result<ExtractionOutput, ExtractionError>
Extracts from an already-parsed document.
§Errors
Returns ExtractionError if a fatal error prevents extraction.
Most issues are captured as warnings in the returned output.
Trait Implementations§
Source§impl Extractor for RdfaLiteExtractor
impl Extractor for RdfaLiteExtractor
Source§fn extract(&self, html: &str) -> Result<ExtractionOutput, ExtractionError>
fn extract(&self, html: &str) -> Result<ExtractionOutput, ExtractionError>
Extracts structured data nodes from an HTML document. Read more
Auto Trait Implementations§
impl Freeze for RdfaLiteExtractor
impl RefUnwindSafe for RdfaLiteExtractor
impl Send for RdfaLiteExtractor
impl Sync for RdfaLiteExtractor
impl Unpin for RdfaLiteExtractor
impl UnsafeUnpin for RdfaLiteExtractor
impl UnwindSafe for RdfaLiteExtractor
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