Trait Tree

Source
pub trait Tree<'input>: RuleContext<'input> {
    // Provided methods
    fn get_parent(
        &self,
    ) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>> { ... }
    fn has_parent(&self) -> bool { ... }
    fn get_payload(&self) -> Box<dyn Any> { ... }
    fn get_child(
        &self,
        _i: usize,
    ) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>> { ... }
    fn get_child_count(&self) -> usize { ... }
    fn get_children<'a>(
        &'a self,
    ) -> Box<dyn Iterator<Item = Rc<<Self::Ctx as ParserNodeType<'input>>::Type>> + 'a>
       where 'input: 'a { ... }
}

Provided Methods§

Source

fn get_parent(&self) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>

Source

fn has_parent(&self) -> bool

Source

fn get_payload(&self) -> Box<dyn Any>

Source

fn get_child( &self, _i: usize, ) -> Option<Rc<<Self::Ctx as ParserNodeType<'input>>::Type>>

Source

fn get_child_count(&self) -> usize

Source

fn get_children<'a>( &'a self, ) -> Box<dyn Iterator<Item = Rc<<Self::Ctx as ParserNodeType<'input>>::Type>> + 'a>
where 'input: 'a,

Implementors§

Source§

impl<'input, Ctx: CustomRuleContext<'input>> Tree<'input> for BaseParserRuleContext<'input, Ctx>

Source§

impl<'input, ExtCtx: CustomRuleContext<'input>> Tree<'input> for BaseRuleContext<'input, ExtCtx>

Source§

impl<'input, Node: ParserNodeType<'input>, T: 'static> Tree<'input> for LeafNode<'input, Node, T>

Source§

impl<'input, T, I> Tree<'input> for T
where T: DerefSeal<Target = I> + 'input + Debug + Tid<'input>, I: ParserRuleContext<'input> + 'input + ?Sized,