pub enum FieldKey<'a> {
Flat(Cow<'a, str>),
Dom(FieldCategory, Cow<'a, str>),
}Expand description
A key for field lookup in schemas and solvers.
For flat formats (JSON, TOML), keys are just field names. For DOM formats (XML, HTML), keys include a category (attribute, element, text).
Variants§
Flat(Cow<'a, str>)
Flat format key - just a name (for JSON, TOML, YAML, etc.)
Dom(FieldCategory, Cow<'a, str>)
DOM format key - category + name (for XML, HTML)
Implementations§
Source§impl<'a> FieldKey<'a>
impl<'a> FieldKey<'a>
Sourcepub fn category(&self) -> Option<FieldCategory>
pub fn category(&self) -> Option<FieldCategory>
Get the category if this is a DOM key.
Sourcepub fn into_owned(self) -> FieldKey<'static>
pub fn into_owned(self) -> FieldKey<'static>
Convert to an owned version with ’static lifetime.
Trait Implementations§
Source§impl<'a> Ord for FieldKey<'a>
impl<'a> Ord for FieldKey<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialOrd for FieldKey<'a>
impl<'a> PartialOrd for FieldKey<'a>
impl<'a> Eq for FieldKey<'a>
impl<'a> StructuralPartialEq for FieldKey<'a>
Auto Trait Implementations§
impl<'a> Freeze for FieldKey<'a>
impl<'a> RefUnwindSafe for FieldKey<'a>
impl<'a> Send for FieldKey<'a>
impl<'a> Sync for FieldKey<'a>
impl<'a> Unpin for FieldKey<'a>
impl<'a> UnwindSafe for FieldKey<'a>
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
Mutably borrows from an owned value. Read more