Struct axum_template::RenderHtml
source · pub struct RenderHtml<K, E, S>(pub K, pub E, pub S);Expand description
Rendered Html response
Responds to the request with the rendered template and
text/html content-type
Usage
use serde::Serialize;
#[derive(Serialize)]
struct Person { /* */ }
async fn handler(
engine: impl TemplateEngine,
) -> impl IntoResponse {
let key = "Template key";
let data = Person{ /* */ };
RenderHtml(key, engine, data)
}Tuple Fields§
§0: K§1: E§2: STrait Implementations§
source§impl<K: Clone, E: Clone, S: Clone> Clone for RenderHtml<K, E, S>
impl<K: Clone, E: Clone, S: Clone> Clone for RenderHtml<K, E, S>
source§fn clone(&self) -> RenderHtml<K, E, S>
fn clone(&self) -> RenderHtml<K, E, S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<K, E, S> From<(K, E, S)> for RenderHtml<K, E, S>
impl<K, E, S> From<(K, E, S)> for RenderHtml<K, E, S>
source§impl<K, E, S> From<Render<K, E, S>> for RenderHtml<K, E, S>
impl<K, E, S> From<Render<K, E, S>> for RenderHtml<K, E, S>
source§impl<K, E, S> From<RenderHtml<K, E, S>> for Render<K, E, S>
impl<K, E, S> From<RenderHtml<K, E, S>> for Render<K, E, S>
source§fn from(r: RenderHtml<K, E, S>) -> Self
fn from(r: RenderHtml<K, E, S>) -> Self
Converts to this type from the input type.
source§impl<K, E, S> IntoResponse for RenderHtml<K, E, S>where
E: TemplateEngine,
S: Serialize,
K: AsRef<str>,
impl<K, E, S> IntoResponse for RenderHtml<K, E, S>where E: TemplateEngine, S: Serialize, K: AsRef<str>,
source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
source§impl<K: PartialEq, E: PartialEq, S: PartialEq> PartialEq<RenderHtml<K, E, S>> for RenderHtml<K, E, S>
impl<K: PartialEq, E: PartialEq, S: PartialEq> PartialEq<RenderHtml<K, E, S>> for RenderHtml<K, E, S>
source§fn eq(&self, other: &RenderHtml<K, E, S>) -> bool
fn eq(&self, other: &RenderHtml<K, E, S>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<K: Eq, E: Eq, S: Eq> Eq for RenderHtml<K, E, S>
impl<K, E, S> StructuralEq for RenderHtml<K, E, S>
impl<K, E, S> StructuralPartialEq for RenderHtml<K, E, S>
Auto Trait Implementations§
impl<K, E, S> RefUnwindSafe for RenderHtml<K, E, S>where E: RefUnwindSafe, K: RefUnwindSafe, S: RefUnwindSafe,
impl<K, E, S> Send for RenderHtml<K, E, S>where E: Send, K: Send, S: Send,
impl<K, E, S> Sync for RenderHtml<K, E, S>where E: Sync, K: Sync, S: Sync,
impl<K, E, S> Unpin for RenderHtml<K, E, S>where E: Unpin, K: Unpin, S: Unpin,
impl<K, E, S> UnwindSafe for RenderHtml<K, E, S>where E: UnwindSafe, K: UnwindSafe, S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more