Trait lang_util::node::display::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

Object Safety§

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§