pub struct Node {
pub tag: Option<Tag>,
pub anchor: Option<String>,
pub data: NodeData,
pub span: Option<Span>,
}Expand description
A node in the document tree.
Fields§
§tag: Option<Tag>The node’s explicit tag, if it carried one.
anchor: Option<String>The anchor name this node was defined under, if any.
data: NodeDataThe node’s payload.
span: Option<Span>Byte range in the source document, when the node was parsed rather than constructed.
Implementations§
Source§impl Node
impl Node
Sourcepub fn scalar_styled(value: impl Into<String>, style: ScalarStyle) -> Self
pub fn scalar_styled(value: impl Into<String>, style: ScalarStyle) -> Self
A scalar node with an explicit style.
Sourcepub fn is_sequence(&self) -> bool
pub fn is_sequence(&self) -> bool
Whether this node is a sequence.
Sourcepub fn is_mapping(&self) -> bool
pub fn is_mapping(&self) -> bool
Whether this node is a mapping.
Sourcepub fn scalar_style(&self) -> Option<ScalarStyle>
pub fn scalar_style(&self) -> Option<ScalarStyle>
The scalar style, if this is a scalar.
Trait Implementations§
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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