pub trait Render {
// Required method
fn render(&self) -> String;
}Expand description
The trait that composable HTML elements should implement.
Implementers of this trait can also implement core::fmt::Display to use directly a Render in a format macro call.
An example of an HTML paragraph element:
struct PlainParagraph {
content: String,
}
impl Render for PlainParagraph {
fn render(&self) -> String {
format!("<p>{}</p>", self.content)
}
}