pub struct Conditional {
    pub cond_expr: Expression,
    pub true_expr: Expression,
    pub false_expr: Expression,
    /* private fields */
}Expand description
The conditional operator allows selecting from one of two expressions based on the outcome of a boolean expression.
Fields§
§cond_expr: ExpressionA condition expression that evaluates to a boolean value.
true_expr: ExpressionThe expression returned by the conditional if the condition evaluates to true.
false_expr: ExpressionThe expression returned by the conditional if the condition evaluates to false.
Implementations§
source§impl Conditional
 
impl Conditional
sourcepub fn new(
    cond_expr: impl Into<Expression>,
    true_expr: impl Into<Expression>,
    false_expr: impl Into<Expression>,
) -> Conditional
 
pub fn new( cond_expr: impl Into<Expression>, true_expr: impl Into<Expression>, false_expr: impl Into<Expression>, ) -> Conditional
Creates a new Conditional from a condition and two expressions for the branches of the
conditional.
Trait Implementations§
source§impl Clone for Conditional
 
impl Clone for Conditional
source§fn clone(&self) -> Conditional
 
fn clone(&self) -> Conditional
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresource§impl Debug for Conditional
 
impl Debug for Conditional
source§impl Decorate for Conditional
 
impl Decorate for Conditional
source§impl From<Conditional> for Expression
 
impl From<Conditional> for Expression
source§fn from(value: Conditional) -> Self
 
fn from(value: Conditional) -> Self
Converts to this type from the input type.
source§impl PartialEq for Conditional
 
impl PartialEq for Conditional
source§impl Span for Conditional
 
impl Span for Conditional
impl Eq for Conditional
Auto Trait Implementations§
impl Freeze for Conditional
impl RefUnwindSafe for Conditional
impl Send for Conditional
impl Sync for Conditional
impl Unpin for Conditional
impl UnwindSafe for Conditional
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> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)