Struct telescope::templates::page::Page [−][src]
pub struct Page {
pub title: String,
pub navbar: Navbar,
pub content: Template,
version: String,
pub ogp_tags: Tags,
}
Expand description
The template for a page shown to the user.
Fields
title: String
The page title. Displayed on the tab in browser. Not necessarily the same as the OGP title.
The value used to render the navbar.
content: Template
The content that will be rendered in the page.
version: String
The current telescope version.
Open Graph Protocol tags.
Implementations
The path to the page template from the templates directory.
pub async fn new(
request: &HttpRequest,
title: impl Into<String>,
content: Template
) -> Result<Self, TelescopeError>
pub async fn new(
request: &HttpRequest,
title: impl Into<String>,
content: Template
) -> Result<Self, TelescopeError>
Create a page. Use default OGP tags. Call API to determine navbar privileges.
Render the page content and turn the page object into a template object.
Render this page into a string using the handlebars template registry.
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 Page
impl UnwindSafe for Page
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