Trait lang_util::node::NodeDisplay[][src]

pub trait NodeDisplay: Sized {
    fn name() -> Option<&'static str>;
fn start(&self) -> Option<usize>;
fn end(&self) -> Option<usize>;
fn source_id(&self) -> Option<usize>;
fn display(&self) -> NodeDisplayWrapper<'_, Self>;
fn display_extra(&self, f: &mut Formatter<'_>) -> Result;
fn display_children(&self, level: usize, f: &mut Formatter<'_>) -> Result; }

Trait for displaying a syntax node

Required methods

fn name() -> Option<&'static str>[src]

Name of the syntax node’s type

fn start(&self) -> Option<usize>[src]

Starting position of the node

fn end(&self) -> Option<usize>[src]

Ending position of the node

fn source_id(&self) -> Option<usize>[src]

Source id of the node

fn display(&self) -> NodeDisplayWrapper<'_, Self>[src]

Obtain a display wrapper for the current node

fn display_extra(&self, f: &mut Formatter<'_>) -> Result[src]

Display extra information for the node

Parameters

  • f: formatter to output to

fn display_children(&self, level: usize, f: &mut Formatter<'_>) -> Result[src]

Display the node’s children

Parameters

  • level: current indentation level
  • f: formatter to output to
Loading content...

Implementors

impl<T: NodeContentDisplay + NodeContent> NodeDisplay for Node<T>[src]

impl<T: NodeContentDisplay> NodeDisplay for T[src]

Loading content...