pub struct PrettyNode { /* private fields */ }Expand description
One owned node in a syntax presentation tree.
The structure is independent of terminal layout. External renderers can
recursively inspect Self::children, use Self::role and
PrettyDetail::role for styling, and apply their own width and glyph
policies.
Implementations§
Source§impl PrettyNode
impl PrettyNode
Sourcepub fn detail(&self) -> Option<&PrettyDetail>
pub fn detail(&self) -> Option<&PrettyDetail>
Returns the optional token spelling or virtual-element glyph.
Sourcepub fn span(&self) -> Option<&Span>
pub fn span(&self) -> Option<&Span>
Returns the source span represented by this node, when available.
Sourcepub fn role(&self) -> PrettyNodeRole
pub fn role(&self) -> PrettyNodeRole
Returns the semantic presentation role of this node.
Sourcepub fn children(&self) -> &[PrettyEdge]
pub fn children(&self) -> &[PrettyEdge]
Returns the labeled children in source-tree order.
Trait Implementations§
Source§impl Clone for PrettyNode
impl Clone for PrettyNode
Source§fn clone(&self) -> PrettyNode
fn clone(&self) -> PrettyNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrettyNode
impl Debug for PrettyNode
impl Eq for PrettyNode
Source§impl PartialEq for PrettyNode
impl PartialEq for PrettyNode
impl StructuralPartialEq for PrettyNode
Auto Trait Implementations§
impl Freeze for PrettyNode
impl RefUnwindSafe for PrettyNode
impl Send for PrettyNode
impl Sync for PrettyNode
impl Unpin for PrettyNode
impl UnsafeUnpin for PrettyNode
impl UnwindSafe for PrettyNode
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