pub fn from_str<'de, T: Facet<'de>>(
s: &'de str,
) -> Result<T, DeserializeError<HtmlError>>Expand description
Deserialize an HTML document from a string.
ยงExample
use facet::Facet;
use facet_html as html;
#[derive(Debug, Facet)]
struct Div {
#[facet(html::text, default)]
text: String,
}
let doc: Div = facet_html::from_str("<div>hello</div>").unwrap();
assert_eq!(doc.text, "hello");