Struct ramhorns::Section

source ·
pub struct Section<'section, Contents: ContentSequence> { /* private fields */ }
Expand description

A section of a Template that can be rendered individually, usually delimited by {{#section}} ... {{/section}} tags.

Implementations§

source§

impl<'section, C> Section<'section, C>
where C: ContentSequence,

source

pub fn with<X>( self, content: &X ) -> Section<'section, (<C as Combine>::I, <C as Combine>::J, <C as Combine>::K, &X)>
where X: Content + ?Sized,

Attach a Content to this section. This will keep track of a stack up to 4 Contents deep, cycling on overflow.

source

pub fn without_last(self) -> Section<'section, C::Previous>

The section without the last Content in the stack

source

pub fn without_first(self) -> Self

The section without the first Block in the stack.

source

pub fn render<E>(&self, encoder: &mut E) -> Result<(), E::Error>
where E: Encoder,

Render this section once to the provided Encoder.

Trait Implementations§

source§

impl<'section, Contents: Clone + ContentSequence> Clone for Section<'section, Contents>

source§

fn clone(&self) -> Section<'section, Contents>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'section, Contents: Copy + ContentSequence> Copy for Section<'section, Contents>

Auto Trait Implementations§

§

impl<'section, Contents> Freeze for Section<'section, Contents>
where Contents: Freeze,

§

impl<'section, Contents> RefUnwindSafe for Section<'section, Contents>
where Contents: RefUnwindSafe,

§

impl<'section, Contents> Send for Section<'section, Contents>
where Contents: Send,

§

impl<'section, Contents> Sync for Section<'section, Contents>
where Contents: Sync,

§

impl<'section, Contents> Unpin for Section<'section, Contents>
where Contents: Unpin,

§

impl<'section, Contents> UnwindSafe for Section<'section, Contents>
where Contents: UnwindSafe,

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> 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,

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.