pub struct Document { /* private fields */ }Expand description
Represents a queryable YAML document.
Implementations§
source§impl Document
impl Document
sourcepub fn new(source: impl Into<String>) -> Result<Self, QueryError>
pub fn new(source: impl Into<String>) -> Result<Self, QueryError>
Construct a new Document from the given YAML.
sourcepub fn root(&self) -> Feature<'_>
pub fn root(&self) -> Feature<'_>
Returns a Feature for this document’s root node.
This is typically useful as a “fallback” feature, e.g. for capturing a span of the entire document.
sourcepub fn query(&self, query: &Query) -> Result<Feature<'_>, QueryError>
pub fn query(&self, query: &Query) -> Result<Feature<'_>, QueryError>
Perform a query on the current document, returning a Feature
if the query succeeds.
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