pub struct Attribute {
pub key: String,
pub value: AttrValue,
}Expand description
A #[key=value] annotation. Attributes live on structural
elements (functions, conditionals, …) and carry metadata that is
either:
- Informational: hints for the reader / downstream tooling
(
#[compiler="msvc15"],#[abi="stdcall"]) — they don’t change the lower-path output. - Load-bearing: bytes / decisions that the lower path
consumes (
#[head_bytes=[…]]on a separated cmp/jccif, so the cmp bytes land at the right offset relative to the intervening statements).
Round-trip rule: attributes round-trip verbatim. The @module
header’s optional defaults: { … } block can shadow any attribute
here; the emitter omits an attribute when it equals the module
default, the parser supplies the default when an attribute is
missing.
Fields§
§key: String§value: AttrValueTrait Implementations§
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 UnsafeUnpin 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