trait InvocationCollectorNode: HasAttrs + HasNodeId + Sized {
    type OutputTy = SmallVec<[Self; 1]>;
    type AttrsTy: Deref<Target = [Attribute]> = ThinVec<Attribute>;

    const KIND: AstFragmentKind;

    // Required methods
    fn to_annotatable(self) -> Annotatable;
    fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy;

    // Provided methods
    fn descr() -> &'static str { ... }
    fn noop_flat_map<V: MutVisitor>(self, _visitor: &mut V) -> Self::OutputTy { ... }
    fn noop_visit<V: MutVisitor>(&mut self, _visitor: &mut V) { ... }
    fn is_mac_call(&self) -> bool { ... }
    fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon) { ... }
    fn pre_flat_map_node_collect_attr(
        _cfg: &StripUnconfigured<'_>,
        _attr: &Attribute
    ) { ... }
    fn post_flat_map_node_collect_bang(
        _output: &mut Self::OutputTy,
        _add_semicolon: AddSemicolon
    ) { ... }
    fn wrap_flat_map_node_noop_flat_map(
        node: Self,
        collector: &mut InvocationCollector<'_, '_>,
        noop_flat_map: impl FnOnce(Self, &mut InvocationCollector<'_, '_>) -> Self::OutputTy
    ) -> Result<Self::OutputTy, Self> { ... }
    fn expand_cfg_false(
        &mut self,
        collector: &mut InvocationCollector<'_, '_>,
        _pos: usize,
        span: Span
    ) { ... }
    fn declared_names(&self) -> Vec<Ident> { ... }
}
Expand description

A trait implemented for all AstFragment nodes and providing all pieces of functionality used by InvocationCollector.

Provided Associated Types§

Required Associated Constants§

Required Methods§

Provided Methods§

source

fn descr() -> &'static str

source

fn noop_flat_map<V: MutVisitor>(self, _visitor: &mut V) -> Self::OutputTy

source

fn noop_visit<V: MutVisitor>(&mut self, _visitor: &mut V)

source

fn is_mac_call(&self) -> bool

source

fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon)

source

fn pre_flat_map_node_collect_attr( _cfg: &StripUnconfigured<'_>, _attr: &Attribute )

source

fn post_flat_map_node_collect_bang( _output: &mut Self::OutputTy, _add_semicolon: AddSemicolon )

source

fn wrap_flat_map_node_noop_flat_map( node: Self, collector: &mut InvocationCollector<'_, '_>, noop_flat_map: impl FnOnce(Self, &mut InvocationCollector<'_, '_>) -> Self::OutputTy ) -> Result<Self::OutputTy, Self>

source

fn expand_cfg_false( &mut self, collector: &mut InvocationCollector<'_, '_>, _pos: usize, span: Span )

source

fn declared_names(&self) -> Vec<Ident>

All of the names (items) declared by this node. This is an approximation and should only be used for diagnostics.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl InvocationCollectorNode for Arm

source§

const KIND: AstFragmentKind = AstFragmentKind::Arms

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

impl InvocationCollectorNode for Crate

§

type OutputTy = Crate

source§

const KIND: AstFragmentKind = AstFragmentKind::Crate

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_visit<V: MutVisitor>(&mut self, visitor: &mut V)

source§

fn expand_cfg_false( &mut self, collector: &mut InvocationCollector<'_, '_>, pos: usize, _span: Span )

source§

impl InvocationCollectorNode for ExprField

source§

const KIND: AstFragmentKind = AstFragmentKind::ExprFields

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

impl InvocationCollectorNode for FieldDef

source§

const KIND: AstFragmentKind = AstFragmentKind::FieldDefs

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

impl InvocationCollectorNode for GenericParam

source§

const KIND: AstFragmentKind = AstFragmentKind::GenericParams

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

impl InvocationCollectorNode for Param

source§

const KIND: AstFragmentKind = AstFragmentKind::Params

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

impl InvocationCollectorNode for PatField

source§

const KIND: AstFragmentKind = AstFragmentKind::PatFields

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

impl InvocationCollectorNode for Stmt

source§

impl InvocationCollectorNode for Variant

source§

const KIND: AstFragmentKind = AstFragmentKind::Variants

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

impl InvocationCollectorNode for AstNodeWrapper<P<Expr>, MethodReceiverTag>

source§

impl InvocationCollectorNode for AstNodeWrapper<P<Expr>, OptExprTag>

source§

impl InvocationCollectorNode for AstNodeWrapper<P<AssocItem>, ImplItemTag>

source§

impl InvocationCollectorNode for AstNodeWrapper<P<AssocItem>, TraitItemTag>

source§

impl InvocationCollectorNode for P<Expr>

§

type OutputTy = P<Expr>

§

type AttrsTy = ThinVec<Attribute>

source§

const KIND: AstFragmentKind = AstFragmentKind::Expr

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn descr() -> &'static str

source§

fn noop_visit<V: MutVisitor>(&mut self, visitor: &mut V)

source§

fn is_mac_call(&self) -> bool

source§

fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon)

source§

impl InvocationCollectorNode for P<Item>

source§

const KIND: AstFragmentKind = AstFragmentKind::Items

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

fn is_mac_call(&self) -> bool

source§

fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon)

source§

fn wrap_flat_map_node_noop_flat_map( node: Self, collector: &mut InvocationCollector<'_, '_>, noop_flat_map: impl FnOnce(Self, &mut InvocationCollector<'_, '_>) -> Self::OutputTy ) -> Result<Self::OutputTy, Self>

source§

fn declared_names(&self) -> Vec<Ident>

source§

impl InvocationCollectorNode for P<Pat>

§

type OutputTy = P<Pat>

source§

const KIND: AstFragmentKind = AstFragmentKind::Pat

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_visit<V: MutVisitor>(&mut self, visitor: &mut V)

source§

fn is_mac_call(&self) -> bool

source§

fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon)

source§

impl InvocationCollectorNode for P<Ty>

§

type OutputTy = P<Ty>

source§

const KIND: AstFragmentKind = AstFragmentKind::Ty

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_visit<V: MutVisitor>(&mut self, visitor: &mut V)

source§

fn is_mac_call(&self) -> bool

source§

fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon)

source§

impl InvocationCollectorNode for P<ForeignItem>

source§

const KIND: AstFragmentKind = AstFragmentKind::ForeignItems

source§

fn to_annotatable(self) -> Annotatable

source§

fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy

source§

fn noop_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

source§

fn is_mac_call(&self) -> bool

source§

fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon)

Implementors§