Skip to main content

from_element

Function from_element 

Source
pub fn from_element<T: DeserializeOwned>(
    attributes: &[Attribute],
    text: Option<&str>,
) -> Result<T>
Expand description

Deserialize a single element’s attributes (and optional text content) into T, honoring #[serde(rename = "...")], Option<T> for absent attributes, and numeric/bytes coercions. This convenience entry point has no child elements to offer — it’s meant for callers who already have an Event::StartTag’s attributes in hand. Nested-child mapping is only available through crate::AbxParser::deserialize_next and crate::AbxStreamParser::deserialize_next, which build the child tree by walking the event stream.