pub enum FieldCategory {
Flat,
Attribute,
Element,
Text,
Tag,
Elements,
}Expand description
Category of a field for format-aware field lookup.
For flat formats (JSON, TOML, YAML), all fields are Flat.
For DOM formats (XML, HTML), fields are categorized by their role
in the tree structure.
Variants§
Flat
Regular field in flat formats (JSON, TOML, YAML, etc.) All fields are treated as simple key-value pairs.
Attribute
Field is an attribute (#[facet(attribute)], xml::attribute, html::attribute)
Element
Field is a child element (default for DOM structs, or explicit xml::element)
Text
Field captures text content (xml::text, html::text)
Tag
Field captures the tag name (xml::tag, html::tag)
Elements
Field captures all unmatched children (xml::elements)
Implementations§
Source§impl FieldCategory
impl FieldCategory
Sourcepub fn from_field_dom(field: &Field) -> Option<Self>
pub fn from_field_dom(field: &Field) -> Option<Self>
Determine the DOM category of a field based on its attributes.
Returns None for flattened fields (they don’t have a single category).
For non-DOM contexts, use FieldCategory::Flat directly.
Trait Implementations§
Source§impl Clone for FieldCategory
impl Clone for FieldCategory
Source§fn clone(&self) -> FieldCategory
fn clone(&self) -> FieldCategory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more