pub struct ConditionalProperty<'a, P> {
pub condition: P,
pub on_true: BoxedAnyProperty<'a>,
pub on_false: Option<BoxedAnyProperty<'a>>,
}Expand description
AnyTemplateProperty which selects an output based on a boolean condition.
Fields§
§condition: P§on_true: BoxedAnyProperty<'a>§on_false: Option<BoxedAnyProperty<'a>>Implementations§
Source§impl<'a, P> ConditionalProperty<'a, P>
impl<'a, P> ConditionalProperty<'a, P>
pub fn new(
condition: P,
on_true: BoxedAnyProperty<'a>,
on_false: Option<BoxedAnyProperty<'a>>,
) -> Selfwhere
P: TemplateProperty<Output = bool> + 'a,
Trait Implementations§
Source§impl<'a, P> AnyTemplateProperty<'a> for ConditionalProperty<'a, P>where
P: TemplateProperty<Output = bool> + 'a,
impl<'a, P> AnyTemplateProperty<'a> for ConditionalProperty<'a, P>where
P: TemplateProperty<Output = bool> + 'a,
fn try_into_serialize(self: Box<Self>) -> Option<BoxedSerializeProperty<'a>>
fn try_into_template(self: Box<Self>) -> Option<Box<dyn Template + 'a>>
Auto Trait Implementations§
impl<'a, P> Freeze for ConditionalProperty<'a, P>where
P: Freeze,
impl<'a, P> !RefUnwindSafe for ConditionalProperty<'a, P>
impl<'a, P> !Send for ConditionalProperty<'a, P>
impl<'a, P> !Sync for ConditionalProperty<'a, P>
impl<'a, P> Unpin for ConditionalProperty<'a, P>where
P: Unpin,
impl<'a, P> UnsafeUnpin for ConditionalProperty<'a, P>where
P: UnsafeUnpin,
impl<'a, P> !UnwindSafe for ConditionalProperty<'a, P>
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