pub struct Conditional {
pub condition: Expression,
pub true_value: Expression,
pub false_value: Expression,
}Expand description
An expression representing an inline if statement, e.g. (x < y) ? a : b
§Note
The parser currently does not handle nested conditionals, e.g. (x < y) ? ( (a < b) ? c : d ) : e
I hope noone has written a PDSC file which does this, if so this can be implemented.
Fields§
§condition: ExpressionThe conditional part, (x < y) ? a : b -> x < y
true_value: ExpressionThe value when the conditional evaluates to true, (x < y) ? a : b -> a
false_value: ExpressionThe value when the conditional evaluates to false, (x < y) ? a : b -> b
Trait Implementations§
Source§impl Clone for Conditional
impl Clone for Conditional
Source§fn clone(&self) -> Conditional
fn clone(&self) -> Conditional
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Conditional
impl Debug for Conditional
Source§impl Default for Conditional
impl Default for Conditional
Source§fn default() -> Conditional
fn default() -> Conditional
Source§impl<'de> Deserialize<'de> for Conditional
impl<'de> Deserialize<'de> for Conditional
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for Conditional
impl Display for Conditional
impl Eq for Conditional
Source§impl PartialEq for Conditional
impl PartialEq for Conditional
Source§impl Serialize for Conditional
impl Serialize for Conditional
impl StructuralPartialEq for Conditional
Source§impl TryFrom<&str> for Conditional
impl TryFrom<&str> for Conditional
Source§fn try_from(value: &str) -> Result<Self, Self::Error>
fn try_from(value: &str) -> Result<Self, Self::Error>
Performs the conversion between &str and Conditional
§Note
The parser currently does not handle nested conditionals, e.g. (x < y) ? ( (a < b) ? c : d ) : e
I hope noone has written a PDSC file which does this, if so this can be implemented.
This will return a valid type with a garbage value.
Source§type Error = DebugAccessParseError
type Error = DebugAccessParseError
Source§impl TryFrom<String> for Conditional
impl TryFrom<String> for Conditional
Source§fn try_from(value: String) -> Result<Self, Self::Error>
fn try_from(value: String) -> Result<Self, Self::Error>
Performs the conversion between String and Conditional
§Note
The parser currently does not handle nested conditionals, e.g. (x < y) ? ( (a < b) ? c : d ) : e
I hope noone has written a PDSC file which does this, if so this can be implemented.
This will return a valid type with a garbage value.