Skip to main content

ViewEngine

Trait ViewEngine 

Source
pub trait ViewEngine:
    Send
    + Sync
    + 'static {
    // Required method
    fn render(
        &self,
        view: String,
        context: Value,
    ) -> BoxFuture<'static, Result<String>>;
}
Expand description

Rendering backend for Nest-style MVC view responses.

Required Methods§

Source

fn render( &self, view: String, context: Value, ) -> BoxFuture<'static, Result<String>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl ViewEngine for StringTemplateViewEngine

Source§

impl<F, Fut> ViewEngine for F
where F: Fn(String, Value) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<String>> + Send + 'static,