pub struct CaseStatement {
pub when_clauses: Vec<(SimpleExpr, SimpleExpr)>,
pub else_clause: Option<SimpleExpr>,
}Expand description
A CASE WHEN statement.
Represents SQL CASE expressions:
CASE
WHEN condition1 THEN result1
WHEN condition2 THEN result2
ELSE default_result
ENDFields§
§when_clauses: Vec<(SimpleExpr, SimpleExpr)>The WHEN conditions and their THEN results
else_clause: Option<SimpleExpr>The ELSE result (optional)
Implementations§
Source§impl CaseStatement
impl CaseStatement
Sourcepub fn else_result<E>(self, result: E) -> Selfwhere
E: Into<SimpleExpr>,
pub fn else_result<E>(self, result: E) -> Selfwhere
E: Into<SimpleExpr>,
Set the ELSE clause.
Trait Implementations§
Source§impl Clone for CaseStatement
impl Clone for CaseStatement
Source§fn clone(&self) -> CaseStatement
fn clone(&self) -> CaseStatement
Returns a duplicate 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 CaseStatement
impl Debug for CaseStatement
Source§impl Default for CaseStatement
impl Default for CaseStatement
Source§fn default() -> CaseStatement
fn default() -> CaseStatement
Returns the “default value” for a type. Read more
Source§impl From<CaseStatement> for SimpleExpr
impl From<CaseStatement> for SimpleExpr
Source§fn from(case: CaseStatement) -> Self
fn from(case: CaseStatement) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CaseStatement
impl !RefUnwindSafe for CaseStatement
impl !Send for CaseStatement
impl !Sync for CaseStatement
impl Unpin for CaseStatement
impl UnsafeUnpin for CaseStatement
impl !UnwindSafe for CaseStatement
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