pub struct Case {
pub operand: Option<Expression>,
pub whens: Vec<(Expression, Expression)>,
pub else_: Option<Expression>,
}Expand description
Represent a CASE expression (both simple and searched forms).
When operand is Some, this is a simple CASE (CASE x WHEN 1 THEN ...).
When operand is None, this is a searched CASE (CASE WHEN x > 0 THEN ...).
Each entry in whens is a (condition, result) pair.
Fields§
§operand: Option<Expression>The operand for simple CASE, or None for searched CASE.
whens: Vec<(Expression, Expression)>Pairs of (WHEN condition, THEN result).
else_: Option<Expression>Optional ELSE result.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Case
impl<'de> Deserialize<'de> for Case
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Case
Auto Trait Implementations§
impl Freeze for Case
impl RefUnwindSafe for Case
impl Send for Case
impl Sync for Case
impl Unpin for Case
impl UnwindSafe for Case
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