parent
7233cda35e
commit
0d1bc320d3
1 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
||||||
# The `Render` trait
|
# The `Render` trait
|
||||||
|
|
||||||
Maud uses the [`Render`][Render] trait to convert [`(spliced)`](splices-toggles.md) values to HTML.
|
For most types, Maud will use the [`std::fmt::Display`][Display] trait to convert [`(spliced)`](splices-toggles.md) values to HTML.
|
||||||
This is implemented for many Rust primitive types (`&str`, `i32`) by default, but you can implement it for your own types as well.
|
(The result will be escaped automatically.)
|
||||||
|
If you'd like to override this behavior for your own type, then you can implement the [`Render`][Render] trait instead.
|
||||||
|
|
||||||
Below are some examples of implementing `Render`.
|
Below are some examples of implementing `Render`.
|
||||||
Feel free to use these snippets in your own project!
|
Feel free to use these snippets in your own project!
|
||||||
|
|
Loading…
Add table
Reference in a new issue