pub struct ConditionalTemplate<P, T, U> {
pub condition: P,
pub true_template: T,
pub false_template: Option<U>,
}Expand description
Template which selects an output based on a boolean condition.
When None is specified for the false template and the condition is false,
this writes nothing.
Fields§
§condition: P§true_template: T§false_template: Option<U>Implementations§
Source§impl<P, T, U> ConditionalTemplate<P, T, U>
impl<P, T, U> ConditionalTemplate<P, T, U>
Trait Implementations§
Source§impl<P, T, U> Template for ConditionalTemplate<P, T, U>
impl<P, T, U> Template for ConditionalTemplate<P, T, U>
Auto Trait Implementations§
impl<P, T, U> Freeze for ConditionalTemplate<P, T, U>
impl<P, T, U> RefUnwindSafe for ConditionalTemplate<P, T, U>
impl<P, T, U> Send for ConditionalTemplate<P, T, U>
impl<P, T, U> Sync for ConditionalTemplate<P, T, U>
impl<P, T, U> Unpin for ConditionalTemplate<P, T, U>
impl<P, T, U> UnwindSafe for ConditionalTemplate<P, T, U>
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more