pub trait Decorated {
// Required methods
fn attributes(&self) -> &[Attribute];
fn attributes_mut(&mut self) -> &mut [Attribute];
fn retain_attributes_mut<F>(&mut self, f: F)
where F: FnMut(&mut Attribute) -> bool;
}Expand description
A trait implemented on all types that can be prefixed by attributes.
Required Methods§
Sourcefn attributes(&self) -> &[Attribute]
fn attributes(&self) -> &[Attribute]
List all attributes (@name) of a syntax node.
Sourcefn attributes_mut(&mut self) -> &mut [Attribute]
fn attributes_mut(&mut self) -> &mut [Attribute]
List all attributes (@name) of a syntax node.
Sourcefn retain_attributes_mut<F>(&mut self, f: F)
fn retain_attributes_mut<F>(&mut self, f: F)
Remove attributes with predicate.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.