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
sourceimpl 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.
Trait Implementations
sourceimpl Debug for SingletonScope
impl Debug for SingletonScope
sourceimpl Deref for SingletonScope
impl Deref for SingletonScope
sourceimpl DerefMut for SingletonScope
impl DerefMut for SingletonScope
sourceimpl ToTokens for SingletonScope
impl ToTokens for SingletonScope
sourcefn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
sourcefn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
sourcefn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations
impl RefUnwindSafe for SingletonScope
impl !Send for SingletonScope
impl !Sync for SingletonScope
impl Unpin for SingletonScope
impl UnwindSafe for SingletonScope
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
sourcefn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty. Read more