Struct impl_tools_lib::SingletonScope
source · pub struct SingletonScope(_, _);
Expand description
A Scope
plus field values
This supports dereference to a Scope
, allowing macro expansion via
Scope::apply_attrs
and other manipulation.
Tokens may be generated by Self::expand
.
Implementations§
source§impl SingletonScope
impl SingletonScope
sourcepub fn expand(self) -> TokenStream
pub fn expand(self) -> TokenStream
Generate the TokenStream
This is a convenience function. It is valid to, instead, (1) call
Scope::expand_impl_self
on self, then (2) use the ToTokens
impl on Scope
.
Methods from Deref<Target = Scope>§
sourcepub fn apply_attrs(
&mut self,
find_rule: impl Fn(&Path) -> Option<&'static dyn ScopeAttr>
)
pub fn apply_attrs(
&mut self,
find_rule: impl Fn(&Path) -> Option<&'static dyn ScopeAttr>
)
Apply attribute rules
The supplied rules
are applied in the order of definition, and their
attributes removed from the item.
sourcepub fn expand_impl_self(&mut self)
pub fn expand_impl_self(&mut self)
Expand impl Self
This is done automatically by Self::expand
. It may be called earlier
by a ScopeAttr
if required. Calling multiple times is harmless.