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§
Sourcefn attributes(&self) -> &[String]
fn attributes(&self) -> &[String]
Gets the attributes.
Sourcefn add_attribute<S>(&mut self, attribute: S)
fn add_attribute<S>(&mut self, attribute: S)
Adds the attribute.
Provided Methods§
Sourcefn with_attribute<S>(self, attribute: S) -> Self
fn with_attribute<S>(self, attribute: S) -> Self
Adds the attribute.
Sourcefn write_attributes(&self, b: &mut CodeBuffer, level: usize)
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.