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§
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
Mutably borrows from an owned value. Read more
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: 64 bytes
Size for each variant:
Empty
: 0 bytesDelimited
: 36 bytesEq
: 60 bytes