rustc_expand::expand

Trait InvocationCollectorNode

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

    const KIND: AstFragmentKind;
Show 16 methods // Required methods fn to_annotatable(self) -> Annotatable; fn fragment_to_output(fragment: AstFragment) -> Self::OutputTy; // Provided methods fn descr() -> &'static str { ... } fn walk_flat_map<V: MutVisitor>(self, _visitor: &mut V) -> Self::OutputTy { ... } fn walk<V: MutVisitor>(&mut self, _visitor: &mut V) { ... } fn is_mac_call(&self) -> bool { ... } fn take_mac_call(self) -> (P<MacCall>, Self::AttrsTy, AddSemicolon) { ... } fn delegation(&self) -> Option<(&DelegationMac, &Item<Self::ItemKind>)> { ... } fn delegation_item_kind(_deleg: Box<Delegation>) -> Self::ItemKind { ... } fn from_item(_item: Item<Self::ItemKind>) -> Self { ... } fn flatten_outputs( _outputs: impl Iterator<Item = Self::OutputTy>, ) -> Self::OutputTy { ... } 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_walk_flat_map( node: Self, collector: &mut InvocationCollector<'_, '_>, walk_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.

Required Associated Constants§

Provided Associated Types§

Required Methods§

Provided Methods§

Source

fn descr() -> &'static str

Source

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

Source

fn walk<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 delegation(&self) -> Option<(&DelegationMac, &Item<Self::ItemKind>)>

Source

fn delegation_item_kind(_deleg: Box<Delegation>) -> Self::ItemKind

Source

fn from_item(_item: Item<Self::ItemKind>) -> Self

Source

fn flatten_outputs( _outputs: impl Iterator<Item = Self::OutputTy>, ) -> Self::OutputTy

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_walk_flat_map( node: Self, collector: &mut InvocationCollector<'_, '_>, walk_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.

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 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 walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

Source§

impl InvocationCollectorNode for Crate

Source§

const KIND: AstFragmentKind = AstFragmentKind::Crate

Source§

type OutputTy = Crate

Source§

fn to_annotatable(self) -> Annotatable

Source§

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

Source§

fn walk<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 walk_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 walk_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 walk_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 walk_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 walk_flat_map<V: MutVisitor>(self, visitor: &mut V) -> Self::OutputTy

Source§

impl InvocationCollectorNode for Stmt

Source§

const KIND: AstFragmentKind = AstFragmentKind::Stmts

Source§

type AttrsTy = ThinVec<Attribute>

Source§

fn to_annotatable(self) -> Annotatable

Source§

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

Source§

fn walk_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 delegation(&self) -> Option<(&DelegationMac, &Item<Self::ItemKind>)>

Source§

fn delegation_item_kind(deleg: Box<Delegation>) -> Self::ItemKind

Source§

fn from_item(item: Item<Self::ItemKind>) -> Self

Source§

fn flatten_outputs( items: impl Iterator<Item = Self::OutputTy>, ) -> Self::OutputTy

Source§

fn post_flat_map_node_collect_bang( stmts: &mut Self::OutputTy, add_semicolon: AddSemicolon, )

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 walk_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>

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 walk_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 delegation(&self) -> Option<(&DelegationMac, &Item<Self::ItemKind>)>

Source§

fn delegation_item_kind(deleg: Box<Delegation>) -> Self::ItemKind

Source§

fn from_item(item: Item<Self::ItemKind>) -> Self

Source§

fn flatten_outputs( items: impl Iterator<Item = Self::OutputTy>, ) -> Self::OutputTy

Source§

fn wrap_flat_map_node_walk_flat_map( node: Self, collector: &mut InvocationCollector<'_, '_>, walk_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>

Source§

const KIND: AstFragmentKind = AstFragmentKind::Pat

Source§

type OutputTy = P<Pat>

Source§

fn to_annotatable(self) -> Annotatable

Source§

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

Source§

fn walk<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>

Source§

const KIND: AstFragmentKind = AstFragmentKind::Ty

Source§

type OutputTy = P<Ty>

Source§

fn to_annotatable(self) -> Annotatable

Source§

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

Source§

fn walk<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 walk_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§