pub struct Document(/* private fields */);Expand description
A single YAML document
Implementations§
Source§impl Document
impl Document
Sourcepub fn root_node(&self) -> Option<SyntaxNode<Lang>>
pub fn root_node(&self) -> Option<SyntaxNode<Lang>>
Get the root node of this document (could be mapping, sequence, or scalar)
Sourcepub fn as_mapping(&self) -> Option<Mapping>
pub fn as_mapping(&self) -> Option<Mapping>
Get this document as a mapping, if it is one
Sourcepub fn as_sequence(&self) -> Option<Sequence>
pub fn as_sequence(&self) -> Option<Sequence>
Get this document as a sequence, if it is one
Trait Implementations§
Source§impl From<SyntaxNode<Lang>> for Document
impl From<SyntaxNode<Lang>> for Document
Source§fn from(node: SyntaxNode<Lang>) -> Self
fn from(node: SyntaxNode<Lang>) -> Self
Converts to this type from the input type.
impl Eq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl !RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl !UnwindSafe for Document
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