cercis_html/render.rs
1use html_escape::encode_safe;
2use std::fmt::Display;
3
4/// Trait for rendering something to a string
5pub trait Render {
6 /// Rendering a structure into a string
7 fn render(&self) -> String;
8}
9
10impl<T: Display> Render for T {
11 fn render(&self) -> String {
12 encode_safe(&self.to_string()).to_string()
13 }
14}