pub enum Attribute {
NonExhaustive,
MustUse {
reason: Option<String>,
},
ExportName(String),
LinkSection(String),
AutomaticallyDerived,
Repr(AttributeRepr),
NoMangle,
TargetFeature {
enable: Vec<String>,
},
Other(String),
}
Expand description
An attribute, e.g. #[repr(C)]
This doesn’t include:
#[doc = "Doc Comment"]
or/// Doc comment
. These are inItem::docs
instead.#[deprecated]
. These are inItem::deprecation
instead.
Variants§
NonExhaustive
#[non_exhaustive]
MustUse
#[must_use]
ExportName(String)
#[export_name = "name"]
LinkSection(String)
#[link_section = "name"]
AutomaticallyDerived
#[automatically_derived]
Repr(AttributeRepr)
#[repr]
NoMangle
#[no_mangle]
TargetFeature
#[target_feature(enable = “feature1”, enable = “feature2”)]
Other(String)
Something else.
Things here are explicitly not covered by the FORMAT_VERSION
constant, and may change without bumping the format version.
As an implementation detail, this is currently either:
- A HIR debug printing, like
"#[attr = Optimize(Speed)]"
- The attribute as it appears in source form, like
"#[optimize(speed)]"
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Attribute
impl<'de> Deserialize<'de> for Attribute
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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