Trait rustc_expand::expand::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
.
Provided Associated Types§
type OutputTy = SmallVec<[Self; 1]>
type AttrsTy: Deref<Target = [Attribute]> = ThinVec<Attribute>
type ItemKind = ItemKind
Required Associated Constants§
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 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, )
sourcefn declared_names(&self) -> Vec<Ident>
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.