Skip to main content

RenderExt

Trait RenderExt 

Source
pub trait RenderExt<K>: Render<K> {
    // Provided methods
    fn shown(&self) -> Shown<'_, Self, K> { ... }
    fn escaped(&self) -> Escaped<'_, Self, K> { ... }
}
Expand description

Turns a value into something write! can take, escaped or not.

Generated code calls these as methods — value.escaped() rather than escaped(value) — because method lookup steps through references for us. A loop hands its body an &Item while a field is a plain value, and both have to reach the same Render impl.

Provided Methods§

Source

fn shown(&self) -> Shown<'_, Self, K>

Wraps this value for {{{ }}}: written exactly as given.

Source

fn escaped(&self) -> Escaped<'_, Self, K>

Wraps this value for {{ }}: written HTML-escaped.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Render<K> + ?Sized, K> RenderExt<K> for T