pub struct Tag {
pub handle: String,
pub suffix: String,
}Expand description
A YAML tag.
Fields§
§handle: StringResolved tag handle or prefix.
Examples include tag:yaml.org,2002: for core-schema tags and ! for local tags.
suffix: StringTag suffix following the resolved handle or prefix.
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn is_yaml_core_schema(&self) -> bool
pub fn is_yaml_core_schema(&self) -> bool
Returns whether the tag is a YAML tag from the core schema (!!str, !!int, …).
The YAML specification specifies a list of tags for the Core Schema. This function checks whether the handle (but not the suffix) is the handle for the YAML Core Schema.
§Return
Returns true if the handle is tag:yaml.org,2002:, false otherwise.
Sourcepub fn is_yaml_core_schema_tag(&self, suffix: &str) -> bool
pub fn is_yaml_core_schema_tag(&self, suffix: &str) -> bool
Return true for a YAML core-schema tag with the given suffix.
For example, this matches core-schema tags such as !!str, !!int, !!float, !!bool,
!!null, !!map, or !!seq after tag resolution.
Trait Implementations§
Source§impl Ord for Tag
impl Ord for Tag
1.21.0 (const: unstable) · 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 PartialOrd for Tag
impl PartialOrd for Tag
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnsafeUnpin for Tag
impl UnwindSafe for Tag
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