pub trait Decorated {
// Required methods
fn attributes(&self) -> &[AttributeNode] ⓘ;
fn attributes_mut(&mut self) -> &mut [AttributeNode] ⓘ;
fn retain_attributes_mut<F>(&mut self, f: F)
where F: FnMut(&mut Attribute) -> bool;
// Provided method
fn contains_attribute(&self, attribute: &Attribute) -> bool { ... }
}
Expand description
A trait implemented on all types that can be prefixed by attributes.
Required Methods§
Sourcefn attributes(&self) -> &[AttributeNode] ⓘ
fn attributes(&self) -> &[AttributeNode] ⓘ
List all attributes (@name
) of a syntax node.
Sourcefn attributes_mut(&mut self) -> &mut [AttributeNode] ⓘ
fn attributes_mut(&mut self) -> &mut [AttributeNode] ⓘ
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.
Provided Methods§
Sourcefn contains_attribute(&self, attribute: &Attribute) -> bool
fn contains_attribute(&self, attribute: &Attribute) -> bool
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.