Struct telescope::templates::Template [−][src]
Expand description
A template that can be rendered using the handlebars template registry.
Fields
handlebars_file: String
The file to use to render this template.
fields: Value
The fields to render.
Implementations
Create a new template object with the path to the handlebars file from the templates directory.
Render this template using the global handlebars registry.
pub async fn in_page(
self,
req: &HttpRequest,
title: impl Into<String>
) -> Result<Page, TelescopeError>
pub async fn in_page(
self,
req: &HttpRequest,
title: impl Into<String>
) -> Result<Page, TelescopeError>
Render this template as the content of a page.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
type Error = TelescopeError
type Error = TelescopeError
The associated error which can be returned.
type Future = Ready<Result<HttpResponse, Self::Error>>
type Future = Ready<Result<HttpResponse, Self::Error>>
The future response value.
Convert itself to AsyncResult
or Error
.
Override a status code for a Responder. Read more
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self> where
V: IntoHeaderValue,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self> where
V: IntoHeaderValue,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
Add header to the Responder’s response. Read more
Auto Trait Implementations
impl RefUnwindSafe for Template
impl UnwindSafe for Template
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more