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 moreSource§impl Debug for FieldCategory
impl Debug for FieldCategory
Source§impl Default for FieldCategory
impl Default for FieldCategory
Source§fn default() -> FieldCategory
fn default() -> FieldCategory
Source§impl Hash for FieldCategory
impl Hash for FieldCategory
Source§impl Ord for FieldCategory
impl Ord for FieldCategory
Source§fn cmp(&self, other: &FieldCategory) -> Ordering
fn cmp(&self, other: &FieldCategory) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for FieldCategory
impl PartialEq for FieldCategory
Source§impl PartialOrd for FieldCategory
impl PartialOrd for FieldCategory
impl Copy for FieldCategory
impl Eq for FieldCategory
impl StructuralPartialEq for FieldCategory
Auto Trait Implementations§
impl Freeze for FieldCategory
impl RefUnwindSafe for FieldCategory
impl Send for FieldCategory
impl Sync for FieldCategory
impl Unpin for FieldCategory
impl UnsafeUnpin for FieldCategory
impl UnwindSafe for FieldCategory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.