pub enum AttrArgs {
Empty,
Delimited(DelimArgs),
Eq(Span, AttrArgsEq),
}
Expand description
Arguments passed to an attribute macro.
Variants§
Empty
No arguments: #[attr]
.
Delimited(DelimArgs)
Delimited arguments: #[attr()/[]/{}]
.
Eq(Span, AttrArgsEq)
Arguments of a key-value attribute: #[attr = "value"]
.
Implementations§
source§impl AttrArgs
impl AttrArgs
pub fn span(&self) -> Option<Span>
sourcepub fn inner_tokens(&self) -> TokenStream
pub fn inner_tokens(&self) -> TokenStream
Tokens inside the delimiters or after =
.
Proc macros see these tokens, for example.
Trait Implementations§
source§impl<CTX> HashStable<CTX> for AttrArgswhere
CTX: HashStableContext,
impl<CTX> HashStable<CTX> for AttrArgswhere
CTX: HashStableContext,
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher)
Auto Trait Implementations§
impl !RefUnwindSafe for AttrArgs
impl !Send for AttrArgs
impl !Sync for AttrArgs
impl Unpin for AttrArgs
impl !UnwindSafe for AttrArgs
Blanket Implementations§
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes
Size for each variant:
Empty
: 0 bytesDelimited
: 32 bytesEq
: 48 bytes