Skip to main content

detect

Function detect 

Source
pub fn detect(root: &Value) -> Detection
Expand description

Report the dialect and version of a parsed element tree.

This is the entry point for a caller working with FeedFormat::Raw output. Anything that is not an element, and any root element that is not feed, rss or RDF, reports FeedDialect::Unknown.

let parser = tabnas_feed::make_with(&tabnas_feed::FeedOptions {
    format: tabnas_feed::FeedFormat::Raw,
    ..Default::default()
});
let root = parser.parse("<rss version=\"2.0\"><channel/></rss>")?;
assert_eq!(tabnas_feed::detect(&root).version, tabnas_feed::FeedVersion::Rss20);