pub struct Apply { /* private fields */ }
Expand description
Creates the TokenStream for the Command using the given arguments.
Can be interpolated directly in a quote! macro.
Implementations§
Source§impl Apply
impl Apply
Sourcepub fn with_fallback(self, fallback: impl ToTokens) -> Self
pub fn with_fallback(self, fallback: impl ToTokens) -> Self
If macro_path
does not contain a macro, instead expand to the fallback
tokens.
By default, the command or fallback
will be expanded inside an anonymous block,
so any items cannot not be referenced from outside. Use Apply::with_macro_forwarding
to expand the output directly in this scope.
Sourcepub fn with_telety_path(self, telety_path: Path) -> Self
pub fn with_telety_path(self, telety_path: Path) -> Self
Specify the location of the telety crate.
This is only required if telety is not located at the default path ::telety
and Apply::with_fallback is used.
Sourcepub fn with_macro_forwarding(self, unique_macro_ident: Ident) -> Self
pub fn with_macro_forwarding(self, unique_macro_ident: Ident) -> Self
If a fallback is set, forward the final haystack/fallback tokens through a macro
so that they are evaluated without additional block scopes.
This is usually required if you a creating a named item (such as a struct
or enum
), but
not for impls
.
unique_macro_ident
must be unique within the crate.
This has no effect if Apply::with_fallback is not used.
Trait Implementations§
Source§impl ToTokens for Apply
impl ToTokens for Apply
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for Apply
impl RefUnwindSafe for Apply
impl !Send for Apply
impl !Sync for Apply
impl Unpin for Apply
impl UnwindSafe for Apply
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.