pub struct Render<'a, P> { /* private fields */ }Expand description
The result of calling Template::render.
The template can be converted to text either using the fmt::Display implementation of Render, or by calling Render::write with an instance of Write.
Implementations§
Source§impl<'a, P> Render<'a, P>
impl<'a, P> Render<'a, P>
Sourcepub fn with_props<U>(self, props: U) -> Render<'a, U>
pub fn with_props<U>(self, props: U) -> Render<'a, U>
Set the properties to interpolate.
Sourcepub fn with_escaping(self, escape: bool) -> Self
pub fn with_escaping(self, escape: bool) -> Self
Whether to escape { and } in text fragments as {{ and }}.
Rendering will not escape by default.
Sourcepub fn as_literal(&self) -> Option<&Str<'a>>
pub fn as_literal(&self) -> Option<&Str<'a>>
Try get the value of the template as a string literal.
Trait Implementations§
Source§impl<'k, P: Props> Value for Render<'k, P>
Available on crate feature sval only.
impl<'k, P: Props> Value for Render<'k, P>
Available on crate feature
sval only.Source§fn stream<'sval, S: Stream<'sval> + ?Sized>(
&'sval self,
stream: &mut S,
) -> Result
fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result
Stream this value through a
Stream.Source§fn to_f32(&self) -> Option<f32>
fn to_f32(&self) -> Option<f32>
Try convert this value into a 32bit binary floating point number.
Auto Trait Implementations§
impl<'a, P> Freeze for Render<'a, P>where
P: Freeze,
impl<'a, P> RefUnwindSafe for Render<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for Render<'a, P>where
P: Send,
impl<'a, P> Sync for Render<'a, P>where
P: Sync,
impl<'a, P> Unpin for Render<'a, P>where
P: Unpin,
impl<'a, P> UnsafeUnpin for Render<'a, P>where
P: UnsafeUnpin,
impl<'a, P> UnwindSafe for Render<'a, P>where
P: 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