Skip to main content

Rendering

Struct Rendering 

Source
pub struct Rendering<'t> { /* private fields */ }
Expand description

Template’s own renders are for no request: plain language, nothing gated shown.

Implementations§

Source§

impl<'t> Rendering<'t>

Source

pub fn new(template: &'t Template) -> Self

Source

pub fn keyed_forms(self) -> Self

Each form carries a fresh idempotency key, so one posted without JavaScript reaches an .idempotent() route as engine.js’s header would.

Source

pub fn language(self, language: Language<'t>) -> Self

Source

pub fn gates(self, gates: &'t dyn Gates) -> Self

Source

pub fn withheld(&self) -> Withheld<'t>

The data paths bound only inside parts this viewer may not see, which JSON and a client area’s envelope leave out as the page does.

Source

pub fn client_view(&self) -> ClientView

What a client area’s screen is given beside its data, in this rendering’s language and for its viewer.

Source

pub fn translate_listing_errors(&self, data: &mut Value)

A listing’s refused filters in a client area’s data, written in this rendering’s language.

Source

pub fn render( &self, data: &(impl Show + ?Sized), ) -> Result<String, TemplateError>

Source

pub fn render_submitted( &self, data: &(impl Show + ?Sized), submitted: &Submitted<'_>, ) -> Result<String, TemplateError>

Source

pub fn render_fragment( &self, data: &(impl Show + ?Sized), id: &str, ) -> Result<String, RenderError>

Source

pub fn render_out_of_band( &self, data: &(impl Show + ?Sized), id: &str, ) -> Result<String, RenderError>

Trait Implementations§

Source§

impl<'t> Clone for Rendering<'t>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'t> Copy for Rendering<'t>

Auto Trait Implementations§

§

impl<'t> !RefUnwindSafe for Rendering<'t>

§

impl<'t> !Send for Rendering<'t>

§

impl<'t> !Sync for Rendering<'t>

§

impl<'t> !UnwindSafe for Rendering<'t>

§

impl<'t> Forget for Rendering<'t>

§

impl<'t> Freeze for Rendering<'t>

§

impl<'t> Unpin for Rendering<'t>

§

impl<'t> UnsafeUnpin for Rendering<'t>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.