pub struct ConditionalStatementBlock {
pub start_token: AttachedToken,
pub condition: Option<Expr>,
pub then_token: Option<AttachedToken>,
pub conditional_statements: ConditionalStatements,
}Expand description
A block within a Statement::Case or Statement::If or Statement::While-like statement
Example 1:
WHEN EXISTS(SELECT 1) THEN SELECT 1;Example 2:
IF TRUE THEN SELECT 1; SELECT 2;Example 3:
ELSE SELECT 1; SELECT 2;Example 4:
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM c1 INTO @var1, @var2;
ENDFields§
§start_token: AttachedTokenToken representing the start of the block (e.g., WHEN/IF/WHILE).
condition: Option<Expr>Optional condition expression for the block.
then_token: Option<AttachedToken>Optional token for the THEN keyword.
conditional_statements: ConditionalStatementsThe statements contained in this conditional block.
Implementations§
Source§impl ConditionalStatementBlock
impl ConditionalStatementBlock
Sourcepub fn statements(&self) -> &Vec<Statement>
pub fn statements(&self) -> &Vec<Statement>
Get the statements in this conditional block.
Trait Implementations§
Source§impl Clone for ConditionalStatementBlock
impl Clone for ConditionalStatementBlock
Source§fn clone(&self) -> ConditionalStatementBlock
fn clone(&self) -> ConditionalStatementBlock
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 ConditionalStatementBlock
impl Debug for ConditionalStatementBlock
Source§impl Display for ConditionalStatementBlock
impl Display for ConditionalStatementBlock
Source§impl Hash for ConditionalStatementBlock
impl Hash for ConditionalStatementBlock
Source§impl Ord for ConditionalStatementBlock
impl Ord for ConditionalStatementBlock
Source§fn cmp(&self, other: &ConditionalStatementBlock) -> Ordering
fn cmp(&self, other: &ConditionalStatementBlock) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for ConditionalStatementBlock
impl PartialOrd for ConditionalStatementBlock
Source§impl Spanned for ConditionalStatementBlock
impl Spanned for ConditionalStatementBlock
Source§impl Visit for ConditionalStatementBlock
impl Visit for ConditionalStatementBlock
Source§impl VisitMut for ConditionalStatementBlock
impl VisitMut for ConditionalStatementBlock
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
Mutably visit this node with the provided
VisitorMut. Read moreimpl Eq for ConditionalStatementBlock
impl StructuralPartialEq for ConditionalStatementBlock
Auto Trait Implementations§
impl Freeze for ConditionalStatementBlock
impl RefUnwindSafe for ConditionalStatementBlock
impl Send for ConditionalStatementBlock
impl Sync for ConditionalStatementBlock
impl Unpin for ConditionalStatementBlock
impl UnsafeUnpin for ConditionalStatementBlock
impl UnwindSafe for ConditionalStatementBlock
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