pub trait Render: Sized {
// Required method
fn template() -> Bytes;
// Provided methods
fn tasks(self) -> Option<Vec<Task>> { ... }
fn response(id: &str, html: &str) -> Bytes { ... }
fn final_chunk() -> Option<Bytes> { ... }
fn render(self) -> impl Stream<Item = Bytes> { ... }
}Expand description
Required Methods§
Provided Methods§
Sourcefn tasks(self) -> Option<Vec<Task>>
fn tasks(self) -> Option<Vec<Task>>
Return the list of tasks associated with this renderer.
Defaults to None.
Sourcefn response(id: &str, html: &str) -> Bytes
fn response(id: &str, html: &str) -> Bytes
Build a <htms-chunk> wrapper from an ID and HTML fragment.
Sourcefn final_chunk() -> Option<Bytes>
fn final_chunk() -> Option<Bytes>
Optionally, return a final chunk to yield after all tasks complete. Mainly used for cleaning htms dirty tags and close the body/html tags.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.