pub struct CondAttributeToken {
pub name: TokenTree,
pub value: AttributeToken,
}
Expand description
An attribute is a general, free-form metadatum that is interpreted according to name, convention, language, and compiler version. Attributes are modeled on Attributes in ECMA-335, with the syntax coming from ECMA-334 (C#).
A list of possible attribute syntax is:
#![allow(unused)]
fn main() {
// General metadata applied to the enclosing module or crate.
#![crate_type = "lib"]
// A function marked as a unit test
#[test]
fn test_foo() {
/* ... */
}
// A conditionally-compiled module
#[cfg(target_os = "linux")]
mod bar {
/* ... */
}
// A lint attribute used to suppress a warning/error
#[allow(non_camel_case_types)]
type int8_t = i8;
// Inner attribute applies to the entire function.
fn some_unused_variables() {
#![allow(unused_variables)]
let x = ();
let y = ();
let z = ();
}
}
Fields§
§name: TokenTree
name of the attribute
value: AttributeToken
value of the attribut contained inside the ()
Trait Implementations§
Source§impl Clone for CondAttributeToken
impl Clone for CondAttributeToken
Source§fn clone(&self) -> CondAttributeToken
fn clone(&self) -> CondAttributeToken
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for CondAttributeToken
impl RefUnwindSafe for CondAttributeToken
impl !Send for CondAttributeToken
impl !Sync for CondAttributeToken
impl Unpin for CondAttributeToken
impl UnwindSafe for CondAttributeToken
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