pub enum YamlNode {
Scalar(YamlScalar),
Sequence(YamlSequence),
Mapping(YamlMapping),
}Expand description
A YAML node accepted by the closed schema-document grammar.
Variants§
Scalar(YamlScalar)
Scalar node.
Sequence(YamlSequence)
Sequence node.
Mapping(YamlMapping)
Mapping node.
Implementations§
Source§impl YamlNode
impl YamlNode
Sourcepub const fn span(&self) -> &SourceSpan
pub const fn span(&self) -> &SourceSpan
Returns the node source span.
Sourcepub const fn as_mapping(&self) -> Option<&YamlMapping>
pub const fn as_mapping(&self) -> Option<&YamlMapping>
Returns this node as a mapping, if it is one.
Sourcepub const fn as_sequence(&self) -> Option<&YamlSequence>
pub const fn as_sequence(&self) -> Option<&YamlSequence>
Returns this node as a sequence, if it is one.
Sourcepub const fn as_scalar(&self) -> Option<&YamlScalar>
pub const fn as_scalar(&self) -> Option<&YamlScalar>
Returns this node as a scalar, if it is one.
Trait Implementations§
impl Eq for YamlNode
impl StructuralPartialEq for YamlNode
Auto Trait Implementations§
impl Freeze for YamlNode
impl RefUnwindSafe for YamlNode
impl Send for YamlNode
impl Sync for YamlNode
impl Unpin for YamlNode
impl UnsafeUnpin for YamlNode
impl UnwindSafe for YamlNode
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