Trait Decorated

Source
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§

Source

fn attributes(&self) -> &[AttributeNode]

List all attributes (@name) of a syntax node.

Source

fn attributes_mut(&mut self) -> &mut [AttributeNode]

List all attributes (@name) of a syntax node.

Source

fn retain_attributes_mut<F>(&mut self, f: F)
where F: FnMut(&mut Attribute) -> bool,

Remove attributes with predicate.

Provided Methods§

Source

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.

Implementors§