Trait NodeContentDisplay

Source
pub trait NodeContentDisplay {
    // Required methods
    fn name() -> Option<&'static str>;
    fn display_extra(&self, f: &mut Formatter<'_>) -> Result;
    fn display_children(&self, level: usize, f: &mut Formatter<'_>) -> Result;
}
Expand description

Trait for displaying an AST node’s content

Required Methods§

Source

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

Name of the node

§Returns

None if this node is just a transparent wrapper (and should not be displayed), otherwise the name of the node type.

Source

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

Display extra information for the node

§Parameters
  • f: formatter to output to
Source

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

Display the node’s children

§Parameters
  • level: current indentation level
  • f: formatter to output to

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl NodeContentDisplay for bool

Source§

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

Source§

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

Source§

fn display_children(&self, _level: usize, _f: &mut Formatter<'_>) -> Result

Source§

impl NodeContentDisplay for f32

Source§

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

Source§

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

Source§

fn display_children(&self, _level: usize, _f: &mut Formatter<'_>) -> Result

Source§

impl NodeContentDisplay for f64

Source§

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

Source§

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

Source§

fn display_children(&self, _level: usize, _f: &mut Formatter<'_>) -> Result

Source§

impl NodeContentDisplay for i32

Source§

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

Source§

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

Source§

fn display_children(&self, _level: usize, _f: &mut Formatter<'_>) -> Result

Source§

impl NodeContentDisplay for u16

Source§

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

Source§

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

Source§

fn display_children(&self, _level: usize, _f: &mut Formatter<'_>) -> Result

Source§

impl NodeContentDisplay for u32

Source§

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

Source§

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

Source§

fn display_children(&self, _level: usize, _f: &mut Formatter<'_>) -> Result

Source§

impl NodeContentDisplay for String

Source§

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

Source§

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

Source§

fn display_children(&self, _level: usize, _f: &mut Formatter<'_>) -> Result

Source§

impl<T: NodeDisplay> NodeContentDisplay for Option<T>

Source§

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

Source§

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

Source§

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

Source§

impl<T: NodeDisplay> NodeContentDisplay for Box<T>

Source§

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

Source§

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

Source§

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

Source§

impl<T: NodeDisplay> NodeContentDisplay for Vec<T>

Source§

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

Source§

fn display_extra(&self, _f: &mut Formatter<'_>) -> Result

Source§

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

Implementors§