WithAttributes

Trait WithAttributes 

Source
pub trait WithAttributes: Sized {
    // Required methods
    fn attributes(&self) -> &[String];
    fn add_attribute<S>(&mut self, attribute: S)
       where S: Into<String>;

    // Provided methods
    fn with_attribute<S>(self, attribute: S) -> Self
       where S: Into<String> { ... }
    fn write_attributes(&self, b: &mut CodeBuffer, level: usize) { ... }
}
Expand description

An element with attributes.

Required Methods§

Source

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

Gets the attributes.

Source

fn add_attribute<S>(&mut self, attribute: S)
where S: Into<String>,

Adds the attribute.

Provided Methods§

Source

fn with_attribute<S>(self, attribute: S) -> Self
where S: Into<String>,

Adds the attribute.

Source

fn write_attributes(&self, b: &mut CodeBuffer, level: usize)

Writes the attributes.

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§