pub struct TemplateData<'a, A>where
A: Serialize,{Show 37 fields
pub project: &'a str,
pub author: &'a str,
pub base_url: &'a str,
pub twitter_username: &'a str,
pub language_code: &'a str,
pub country_code: &'a str,
pub see_also: &'a [String],
pub copyright_start: &'a str,
pub description: &'a str,
pub social_image: &'a str,
pub social_image_alt: &'a str,
pub style_sheets: Vec<&'a str>,
pub scripts: Vec<&'a str>,
pub page_name: &'a str,
pub page_url: &'a str,
pub robots: &'a str,
pub og_type: &'static str,
pub article: Option<&'a Article>,
pub jsonld: Option<String>,
pub display_name: String,
pub canonical_url: String,
pub locale: String,
pub social_image_url: String,
pub social_image_width: Option<u32>,
pub social_image_height: Option<u32>,
pub social_image_type: Option<&'static str>,
pub has_svg_icon: bool,
pub preconnect: Vec<String>,
pub copyright_end: i32,
pub color_scheme: &'static str,
pub theme_colors: Vec<ThemeColorTag>,
pub theme_script: &'a str,
pub analytics: Option<&'a AnalyticsPaths>,
pub sentry_browser: Option<&'a SentryBrowser>,
pub environment: Environment,
pub cache_buster: &'a BTreeMap<String, String>,
pub app: A,
}Expand description
What Handlebars sees: base data, page data, what the server computed, and the caller’s own.
Borrowed throughout — nothing is copied that was not computed. A is the
caller’s data, reachable in templates as {{app.…}}; pass () for none.
Fields§
§project: &'a str§base_url: &'a str§twitter_username: &'a str§language_code: &'a str§country_code: &'a str§see_also: &'a [String]§copyright_start: &'a str§description: &'a strThe path as declared, for a page that wants the asset itself — a CSS
background, say. Use social_image_url for anything a crawler reads.
style_sheets: Vec<&'a str>§scripts: Vec<&'a str>§page_name: &'a str§page_url: &'a str§robots: &'a str§og_type: &'static strwebsite, or article when the page carries article metadata.
article: Option<&'a Article>§jsonld: Option<String>Escaped for direct embedding in a <script> block.
display_name: String"{page_name} | {project}" — the <title>, always.
canonical_url: String"{base_url}{page_url}".
locale: String"{language_code}_{country_code}", for og:locale.
Absolute and content-hashed. Open Graph requires an absolute URL: a
crawler fetching the page in isolation cannot resolve a relative one, so
a relative og:image silently yields no share card at all.
has_svg_icon: boolWhether to link favicon.svg.
preconnect: Vec<String>Distinct cross-origin hosts referenced by the stylesheets and scripts below, so the connection is warm before the request that needs it.
copyright_end: i32Computed per render, never cached — a long-running server would otherwise keep claiming last year after New Year’s.
color_scheme: &'static str§theme_colors: Vec<ThemeColorTag>§theme_script: &'a str§analytics: Option<&'a AnalyticsPaths>§sentry_browser: Option<&'a SentryBrowser>§environment: Environment§cache_buster: &'a BTreeMap<String, String>Original asset path to content-hashed path.
app: AImplementations§
Source§impl<'a, A> TemplateData<'a, A>where
A: Serialize,
impl<'a, A> TemplateData<'a, A>where
A: Serialize,
Sourcepub fn assemble(
base: &'a BaseTemplateData,
page: &'a PageTemplateData,
frontend: Option<&'a FrontendRuntime>,
environment: Environment,
cache_buster: &'a BTreeMap<String, String>,
app: A,
) -> Result<Self, TemplateError>
pub fn assemble( base: &'a BaseTemplateData, page: &'a PageTemplateData, frontend: Option<&'a FrontendRuntime>, environment: Environment, cache_buster: &'a BTreeMap<String, String>, app: A, ) -> Result<Self, TemplateError>
§Errors
TemplateError::JsonLd if the page’s JSON-LD document cannot be
serialized.
Trait Implementations§
Source§impl<'a, A> Debug for TemplateData<'a, A>
impl<'a, A> Debug for TemplateData<'a, A>
Auto Trait Implementations§
impl<'a, A> Freeze for TemplateData<'a, A>where
A: Freeze,
impl<'a, A> RefUnwindSafe for TemplateData<'a, A>where
A: RefUnwindSafe,
impl<'a, A> Send for TemplateData<'a, A>where
A: Send,
impl<'a, A> Sync for TemplateData<'a, A>where
A: Sync,
impl<'a, A> Unpin for TemplateData<'a, A>where
A: Unpin,
impl<'a, A> UnsafeUnpin for TemplateData<'a, A>where
A: UnsafeUnpin,
impl<'a, A> UnwindSafe for TemplateData<'a, A>where
A: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
Source§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
Source§fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Source§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
Source§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
Source§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
Source§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
x-request-id as the header name. Read moreSource§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
500 Internal Server responses. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
413 Payload Too Large responses. Read more