#[non_exhaustive]pub struct Node { /* private fields */ }Available on crate features
json or toml or yaml only.Expand description
One node of a text: its bytes, the alias that replayed it, its tag and what it holds.
Implementations§
Source§impl Node
impl Node
Sourcepub fn sequence(span: Range<usize>, items: Vec<Self>) -> Self
pub fn sequence(span: Range<usize>, items: Vec<Self>) -> Self
A sequence node written at span, with its items in the order
written.
Sourcepub fn mapping(span: Range<usize>, entries: Vec<(Self, Self)>) -> Self
pub fn mapping(span: Range<usize>, entries: Vec<(Self, Self)>) -> Self
A mapping node written at span, with its key and value nodes in the
order written.
Sourcepub fn with_used_at(self, used_at: Range<usize>) -> Self
pub fn with_used_at(self, used_at: Range<usize>) -> Self
This node as replayed by the alias written at used_at.
Sourcepub fn span(&self) -> Range<usize> ⓘ
pub fn span(&self) -> Range<usize> ⓘ
The bytes of the node in the text, quotes and block indicators
included, so text[node.span()] is its source. A node an alias
replayed has the span of the node it copies.
Two nodes have a span that is not their own source. A TOML table opened
by a [header] or by a dotted key spans that header or key, and a YAML
empty value, as in b:, has an empty span and the value ~.
Trait Implementations§
impl Eq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Forget for Node
impl Freeze for Node
impl Move 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