pub enum StmtRef<'a> {
Show 25 variants
FunctionDef(&'a StmtFunctionDef),
ClassDef(&'a StmtClassDef),
Return(&'a StmtReturn),
Delete(&'a StmtDelete),
TypeAlias(&'a StmtTypeAlias),
Assign(&'a StmtAssign),
AugAssign(&'a StmtAugAssign),
AnnAssign(&'a StmtAnnAssign),
For(&'a StmtFor),
While(&'a StmtWhile),
If(&'a StmtIf),
With(&'a StmtWith),
Match(&'a StmtMatch),
Raise(&'a StmtRaise),
Try(&'a StmtTry),
Assert(&'a StmtAssert),
Import(&'a StmtImport),
ImportFrom(&'a StmtImportFrom),
Global(&'a StmtGlobal),
Nonlocal(&'a StmtNonlocal),
Expr(&'a StmtExpr),
Pass(&'a StmtPass),
Break(&'a StmtBreak),
Continue(&'a StmtContinue),
IpyEscapeCommand(&'a StmtIpyEscapeCommand),
}Expand description
See also stmt
Variants§
FunctionDef(&'a StmtFunctionDef)
ClassDef(&'a StmtClassDef)
Return(&'a StmtReturn)
Delete(&'a StmtDelete)
TypeAlias(&'a StmtTypeAlias)
Assign(&'a StmtAssign)
AugAssign(&'a StmtAugAssign)
AnnAssign(&'a StmtAnnAssign)
For(&'a StmtFor)
While(&'a StmtWhile)
If(&'a StmtIf)
With(&'a StmtWith)
Match(&'a StmtMatch)
Raise(&'a StmtRaise)
Try(&'a StmtTry)
Assert(&'a StmtAssert)
Import(&'a StmtImport)
ImportFrom(&'a StmtImportFrom)
Global(&'a StmtGlobal)
Nonlocal(&'a StmtNonlocal)
Expr(&'a StmtExpr)
Pass(&'a StmtPass)
Break(&'a StmtBreak)
Continue(&'a StmtContinue)
IpyEscapeCommand(&'a StmtIpyEscapeCommand)
Implementations§
Source§impl<'a> StmtRef<'a>
impl<'a> StmtRef<'a>
Sourcepub const fn is_function_def_stmt(&self) -> bool
pub const fn is_function_def_stmt(&self) -> bool
Returns true if self is of variant FunctionDef.
Sourcepub fn as_function_def_stmt(&self) -> Option<&&'a StmtFunctionDef>
pub fn as_function_def_stmt(&self) -> Option<&&'a StmtFunctionDef>
Returns Some if self is a reference of variant FunctionDef, and None otherwise.
Sourcepub fn as_mut_function_def_stmt(&mut self) -> Option<&mut &'a StmtFunctionDef>
pub fn as_mut_function_def_stmt(&mut self) -> Option<&mut &'a StmtFunctionDef>
Returns Some if self is a mutable reference of variant FunctionDef, and None otherwise.
Sourcepub fn expect_function_def_stmt(self) -> &'a StmtFunctionDef
pub fn expect_function_def_stmt(self) -> &'a StmtFunctionDef
Unwraps the value, yielding the content of FunctionDef.
§Panics
Panics if the value is not FunctionDef. In debug builds the panic message includes the content of self.
Sourcepub fn function_def_stmt(self) -> Option<&'a StmtFunctionDef>
pub fn function_def_stmt(self) -> Option<&'a StmtFunctionDef>
Returns Some if self is of variant FunctionDef, and None otherwise.
Sourcepub const fn is_class_def_stmt(&self) -> bool
pub const fn is_class_def_stmt(&self) -> bool
Returns true if self is of variant ClassDef.
Sourcepub fn as_class_def_stmt(&self) -> Option<&&'a StmtClassDef>
pub fn as_class_def_stmt(&self) -> Option<&&'a StmtClassDef>
Returns Some if self is a reference of variant ClassDef, and None otherwise.
Sourcepub fn as_mut_class_def_stmt(&mut self) -> Option<&mut &'a StmtClassDef>
pub fn as_mut_class_def_stmt(&mut self) -> Option<&mut &'a StmtClassDef>
Returns Some if self is a mutable reference of variant ClassDef, and None otherwise.
Sourcepub fn expect_class_def_stmt(self) -> &'a StmtClassDef
pub fn expect_class_def_stmt(self) -> &'a StmtClassDef
Sourcepub fn class_def_stmt(self) -> Option<&'a StmtClassDef>
pub fn class_def_stmt(self) -> Option<&'a StmtClassDef>
Returns Some if self is of variant ClassDef, and None otherwise.
Sourcepub const fn is_return_stmt(&self) -> bool
pub const fn is_return_stmt(&self) -> bool
Returns true if self is of variant Return.
Sourcepub fn as_return_stmt(&self) -> Option<&&'a StmtReturn>
pub fn as_return_stmt(&self) -> Option<&&'a StmtReturn>
Returns Some if self is a reference of variant Return, and None otherwise.
Sourcepub fn as_mut_return_stmt(&mut self) -> Option<&mut &'a StmtReturn>
pub fn as_mut_return_stmt(&mut self) -> Option<&mut &'a StmtReturn>
Returns Some if self is a mutable reference of variant Return, and None otherwise.
Sourcepub fn expect_return_stmt(self) -> &'a StmtReturn
pub fn expect_return_stmt(self) -> &'a StmtReturn
Sourcepub fn return_stmt(self) -> Option<&'a StmtReturn>
pub fn return_stmt(self) -> Option<&'a StmtReturn>
Returns Some if self is of variant Return, and None otherwise.
Sourcepub const fn is_delete_stmt(&self) -> bool
pub const fn is_delete_stmt(&self) -> bool
Returns true if self is of variant Delete.
Sourcepub fn as_delete_stmt(&self) -> Option<&&'a StmtDelete>
pub fn as_delete_stmt(&self) -> Option<&&'a StmtDelete>
Returns Some if self is a reference of variant Delete, and None otherwise.
Sourcepub fn as_mut_delete_stmt(&mut self) -> Option<&mut &'a StmtDelete>
pub fn as_mut_delete_stmt(&mut self) -> Option<&mut &'a StmtDelete>
Returns Some if self is a mutable reference of variant Delete, and None otherwise.
Sourcepub fn expect_delete_stmt(self) -> &'a StmtDelete
pub fn expect_delete_stmt(self) -> &'a StmtDelete
Sourcepub fn delete_stmt(self) -> Option<&'a StmtDelete>
pub fn delete_stmt(self) -> Option<&'a StmtDelete>
Returns Some if self is of variant Delete, and None otherwise.
Sourcepub const fn is_type_alias_stmt(&self) -> bool
pub const fn is_type_alias_stmt(&self) -> bool
Returns true if self is of variant TypeAlias.
Sourcepub fn as_type_alias_stmt(&self) -> Option<&&'a StmtTypeAlias>
pub fn as_type_alias_stmt(&self) -> Option<&&'a StmtTypeAlias>
Returns Some if self is a reference of variant TypeAlias, and None otherwise.
Sourcepub fn as_mut_type_alias_stmt(&mut self) -> Option<&mut &'a StmtTypeAlias>
pub fn as_mut_type_alias_stmt(&mut self) -> Option<&mut &'a StmtTypeAlias>
Returns Some if self is a mutable reference of variant TypeAlias, and None otherwise.
Sourcepub fn expect_type_alias_stmt(self) -> &'a StmtTypeAlias
pub fn expect_type_alias_stmt(self) -> &'a StmtTypeAlias
Sourcepub fn type_alias_stmt(self) -> Option<&'a StmtTypeAlias>
pub fn type_alias_stmt(self) -> Option<&'a StmtTypeAlias>
Returns Some if self is of variant TypeAlias, and None otherwise.
Sourcepub const fn is_assign_stmt(&self) -> bool
pub const fn is_assign_stmt(&self) -> bool
Returns true if self is of variant Assign.
Sourcepub fn as_assign_stmt(&self) -> Option<&&'a StmtAssign>
pub fn as_assign_stmt(&self) -> Option<&&'a StmtAssign>
Returns Some if self is a reference of variant Assign, and None otherwise.
Sourcepub fn as_mut_assign_stmt(&mut self) -> Option<&mut &'a StmtAssign>
pub fn as_mut_assign_stmt(&mut self) -> Option<&mut &'a StmtAssign>
Returns Some if self is a mutable reference of variant Assign, and None otherwise.
Sourcepub fn expect_assign_stmt(self) -> &'a StmtAssign
pub fn expect_assign_stmt(self) -> &'a StmtAssign
Sourcepub fn assign_stmt(self) -> Option<&'a StmtAssign>
pub fn assign_stmt(self) -> Option<&'a StmtAssign>
Returns Some if self is of variant Assign, and None otherwise.
Sourcepub const fn is_aug_assign_stmt(&self) -> bool
pub const fn is_aug_assign_stmt(&self) -> bool
Returns true if self is of variant AugAssign.
Sourcepub fn as_aug_assign_stmt(&self) -> Option<&&'a StmtAugAssign>
pub fn as_aug_assign_stmt(&self) -> Option<&&'a StmtAugAssign>
Returns Some if self is a reference of variant AugAssign, and None otherwise.
Sourcepub fn as_mut_aug_assign_stmt(&mut self) -> Option<&mut &'a StmtAugAssign>
pub fn as_mut_aug_assign_stmt(&mut self) -> Option<&mut &'a StmtAugAssign>
Returns Some if self is a mutable reference of variant AugAssign, and None otherwise.
Sourcepub fn expect_aug_assign_stmt(self) -> &'a StmtAugAssign
pub fn expect_aug_assign_stmt(self) -> &'a StmtAugAssign
Sourcepub fn aug_assign_stmt(self) -> Option<&'a StmtAugAssign>
pub fn aug_assign_stmt(self) -> Option<&'a StmtAugAssign>
Returns Some if self is of variant AugAssign, and None otherwise.
Sourcepub const fn is_ann_assign_stmt(&self) -> bool
pub const fn is_ann_assign_stmt(&self) -> bool
Returns true if self is of variant AnnAssign.
Sourcepub fn as_ann_assign_stmt(&self) -> Option<&&'a StmtAnnAssign>
pub fn as_ann_assign_stmt(&self) -> Option<&&'a StmtAnnAssign>
Returns Some if self is a reference of variant AnnAssign, and None otherwise.
Sourcepub fn as_mut_ann_assign_stmt(&mut self) -> Option<&mut &'a StmtAnnAssign>
pub fn as_mut_ann_assign_stmt(&mut self) -> Option<&mut &'a StmtAnnAssign>
Returns Some if self is a mutable reference of variant AnnAssign, and None otherwise.
Sourcepub fn expect_ann_assign_stmt(self) -> &'a StmtAnnAssign
pub fn expect_ann_assign_stmt(self) -> &'a StmtAnnAssign
Sourcepub fn ann_assign_stmt(self) -> Option<&'a StmtAnnAssign>
pub fn ann_assign_stmt(self) -> Option<&'a StmtAnnAssign>
Returns Some if self is of variant AnnAssign, and None otherwise.
Sourcepub const fn is_for_stmt(&self) -> bool
pub const fn is_for_stmt(&self) -> bool
Returns true if self is of variant For.
Sourcepub fn as_for_stmt(&self) -> Option<&&'a StmtFor>
pub fn as_for_stmt(&self) -> Option<&&'a StmtFor>
Returns Some if self is a reference of variant For, and None otherwise.
Sourcepub fn as_mut_for_stmt(&mut self) -> Option<&mut &'a StmtFor>
pub fn as_mut_for_stmt(&mut self) -> Option<&mut &'a StmtFor>
Returns Some if self is a mutable reference of variant For, and None otherwise.
Sourcepub fn expect_for_stmt(self) -> &'a StmtFor
pub fn expect_for_stmt(self) -> &'a StmtFor
Sourcepub fn for_stmt(self) -> Option<&'a StmtFor>
pub fn for_stmt(self) -> Option<&'a StmtFor>
Returns Some if self is of variant For, and None otherwise.
Sourcepub const fn is_while_stmt(&self) -> bool
pub const fn is_while_stmt(&self) -> bool
Returns true if self is of variant While.
Sourcepub fn as_while_stmt(&self) -> Option<&&'a StmtWhile>
pub fn as_while_stmt(&self) -> Option<&&'a StmtWhile>
Returns Some if self is a reference of variant While, and None otherwise.
Sourcepub fn as_mut_while_stmt(&mut self) -> Option<&mut &'a StmtWhile>
pub fn as_mut_while_stmt(&mut self) -> Option<&mut &'a StmtWhile>
Returns Some if self is a mutable reference of variant While, and None otherwise.
Sourcepub fn expect_while_stmt(self) -> &'a StmtWhile
pub fn expect_while_stmt(self) -> &'a StmtWhile
Sourcepub fn while_stmt(self) -> Option<&'a StmtWhile>
pub fn while_stmt(self) -> Option<&'a StmtWhile>
Returns Some if self is of variant While, and None otherwise.
Sourcepub const fn is_if_stmt(&self) -> bool
pub const fn is_if_stmt(&self) -> bool
Returns true if self is of variant If.
Sourcepub fn as_if_stmt(&self) -> Option<&&'a StmtIf>
pub fn as_if_stmt(&self) -> Option<&&'a StmtIf>
Returns Some if self is a reference of variant If, and None otherwise.
Sourcepub fn as_mut_if_stmt(&mut self) -> Option<&mut &'a StmtIf>
pub fn as_mut_if_stmt(&mut self) -> Option<&mut &'a StmtIf>
Returns Some if self is a mutable reference of variant If, and None otherwise.
Sourcepub fn expect_if_stmt(self) -> &'a StmtIf
pub fn expect_if_stmt(self) -> &'a StmtIf
Sourcepub fn if_stmt(self) -> Option<&'a StmtIf>
pub fn if_stmt(self) -> Option<&'a StmtIf>
Returns Some if self is of variant If, and None otherwise.
Sourcepub const fn is_with_stmt(&self) -> bool
pub const fn is_with_stmt(&self) -> bool
Returns true if self is of variant With.
Sourcepub fn as_with_stmt(&self) -> Option<&&'a StmtWith>
pub fn as_with_stmt(&self) -> Option<&&'a StmtWith>
Returns Some if self is a reference of variant With, and None otherwise.
Sourcepub fn as_mut_with_stmt(&mut self) -> Option<&mut &'a StmtWith>
pub fn as_mut_with_stmt(&mut self) -> Option<&mut &'a StmtWith>
Returns Some if self is a mutable reference of variant With, and None otherwise.
Sourcepub fn expect_with_stmt(self) -> &'a StmtWith
pub fn expect_with_stmt(self) -> &'a StmtWith
Sourcepub fn with_stmt(self) -> Option<&'a StmtWith>
pub fn with_stmt(self) -> Option<&'a StmtWith>
Returns Some if self is of variant With, and None otherwise.
Sourcepub const fn is_match_stmt(&self) -> bool
pub const fn is_match_stmt(&self) -> bool
Returns true if self is of variant Match.
Sourcepub fn as_match_stmt(&self) -> Option<&&'a StmtMatch>
pub fn as_match_stmt(&self) -> Option<&&'a StmtMatch>
Returns Some if self is a reference of variant Match, and None otherwise.
Sourcepub fn as_mut_match_stmt(&mut self) -> Option<&mut &'a StmtMatch>
pub fn as_mut_match_stmt(&mut self) -> Option<&mut &'a StmtMatch>
Returns Some if self is a mutable reference of variant Match, and None otherwise.
Sourcepub fn expect_match_stmt(self) -> &'a StmtMatch
pub fn expect_match_stmt(self) -> &'a StmtMatch
Sourcepub fn match_stmt(self) -> Option<&'a StmtMatch>
pub fn match_stmt(self) -> Option<&'a StmtMatch>
Returns Some if self is of variant Match, and None otherwise.
Sourcepub const fn is_raise_stmt(&self) -> bool
pub const fn is_raise_stmt(&self) -> bool
Returns true if self is of variant Raise.
Sourcepub fn as_raise_stmt(&self) -> Option<&&'a StmtRaise>
pub fn as_raise_stmt(&self) -> Option<&&'a StmtRaise>
Returns Some if self is a reference of variant Raise, and None otherwise.
Sourcepub fn as_mut_raise_stmt(&mut self) -> Option<&mut &'a StmtRaise>
pub fn as_mut_raise_stmt(&mut self) -> Option<&mut &'a StmtRaise>
Returns Some if self is a mutable reference of variant Raise, and None otherwise.
Sourcepub fn expect_raise_stmt(self) -> &'a StmtRaise
pub fn expect_raise_stmt(self) -> &'a StmtRaise
Sourcepub fn raise_stmt(self) -> Option<&'a StmtRaise>
pub fn raise_stmt(self) -> Option<&'a StmtRaise>
Returns Some if self is of variant Raise, and None otherwise.
Sourcepub const fn is_try_stmt(&self) -> bool
pub const fn is_try_stmt(&self) -> bool
Returns true if self is of variant Try.
Sourcepub fn as_try_stmt(&self) -> Option<&&'a StmtTry>
pub fn as_try_stmt(&self) -> Option<&&'a StmtTry>
Returns Some if self is a reference of variant Try, and None otherwise.
Sourcepub fn as_mut_try_stmt(&mut self) -> Option<&mut &'a StmtTry>
pub fn as_mut_try_stmt(&mut self) -> Option<&mut &'a StmtTry>
Returns Some if self is a mutable reference of variant Try, and None otherwise.
Sourcepub fn expect_try_stmt(self) -> &'a StmtTry
pub fn expect_try_stmt(self) -> &'a StmtTry
Sourcepub fn try_stmt(self) -> Option<&'a StmtTry>
pub fn try_stmt(self) -> Option<&'a StmtTry>
Returns Some if self is of variant Try, and None otherwise.
Sourcepub const fn is_assert_stmt(&self) -> bool
pub const fn is_assert_stmt(&self) -> bool
Returns true if self is of variant Assert.
Sourcepub fn as_assert_stmt(&self) -> Option<&&'a StmtAssert>
pub fn as_assert_stmt(&self) -> Option<&&'a StmtAssert>
Returns Some if self is a reference of variant Assert, and None otherwise.
Sourcepub fn as_mut_assert_stmt(&mut self) -> Option<&mut &'a StmtAssert>
pub fn as_mut_assert_stmt(&mut self) -> Option<&mut &'a StmtAssert>
Returns Some if self is a mutable reference of variant Assert, and None otherwise.
Sourcepub fn expect_assert_stmt(self) -> &'a StmtAssert
pub fn expect_assert_stmt(self) -> &'a StmtAssert
Sourcepub fn assert_stmt(self) -> Option<&'a StmtAssert>
pub fn assert_stmt(self) -> Option<&'a StmtAssert>
Returns Some if self is of variant Assert, and None otherwise.
Sourcepub const fn is_import_stmt(&self) -> bool
pub const fn is_import_stmt(&self) -> bool
Returns true if self is of variant Import.
Sourcepub fn as_import_stmt(&self) -> Option<&&'a StmtImport>
pub fn as_import_stmt(&self) -> Option<&&'a StmtImport>
Returns Some if self is a reference of variant Import, and None otherwise.
Sourcepub fn as_mut_import_stmt(&mut self) -> Option<&mut &'a StmtImport>
pub fn as_mut_import_stmt(&mut self) -> Option<&mut &'a StmtImport>
Returns Some if self is a mutable reference of variant Import, and None otherwise.
Sourcepub fn expect_import_stmt(self) -> &'a StmtImport
pub fn expect_import_stmt(self) -> &'a StmtImport
Sourcepub fn import_stmt(self) -> Option<&'a StmtImport>
pub fn import_stmt(self) -> Option<&'a StmtImport>
Returns Some if self is of variant Import, and None otherwise.
Sourcepub const fn is_import_from_stmt(&self) -> bool
pub const fn is_import_from_stmt(&self) -> bool
Returns true if self is of variant ImportFrom.
Sourcepub fn as_import_from_stmt(&self) -> Option<&&'a StmtImportFrom>
pub fn as_import_from_stmt(&self) -> Option<&&'a StmtImportFrom>
Returns Some if self is a reference of variant ImportFrom, and None otherwise.
Sourcepub fn as_mut_import_from_stmt(&mut self) -> Option<&mut &'a StmtImportFrom>
pub fn as_mut_import_from_stmt(&mut self) -> Option<&mut &'a StmtImportFrom>
Returns Some if self is a mutable reference of variant ImportFrom, and None otherwise.
Sourcepub fn expect_import_from_stmt(self) -> &'a StmtImportFrom
pub fn expect_import_from_stmt(self) -> &'a StmtImportFrom
Unwraps the value, yielding the content of ImportFrom.
§Panics
Panics if the value is not ImportFrom. In debug builds the panic message includes the content of self.
Sourcepub fn import_from_stmt(self) -> Option<&'a StmtImportFrom>
pub fn import_from_stmt(self) -> Option<&'a StmtImportFrom>
Returns Some if self is of variant ImportFrom, and None otherwise.
Sourcepub const fn is_global_stmt(&self) -> bool
pub const fn is_global_stmt(&self) -> bool
Returns true if self is of variant Global.
Sourcepub fn as_global_stmt(&self) -> Option<&&'a StmtGlobal>
pub fn as_global_stmt(&self) -> Option<&&'a StmtGlobal>
Returns Some if self is a reference of variant Global, and None otherwise.
Sourcepub fn as_mut_global_stmt(&mut self) -> Option<&mut &'a StmtGlobal>
pub fn as_mut_global_stmt(&mut self) -> Option<&mut &'a StmtGlobal>
Returns Some if self is a mutable reference of variant Global, and None otherwise.
Sourcepub fn expect_global_stmt(self) -> &'a StmtGlobal
pub fn expect_global_stmt(self) -> &'a StmtGlobal
Sourcepub fn global_stmt(self) -> Option<&'a StmtGlobal>
pub fn global_stmt(self) -> Option<&'a StmtGlobal>
Returns Some if self is of variant Global, and None otherwise.
Sourcepub const fn is_nonlocal_stmt(&self) -> bool
pub const fn is_nonlocal_stmt(&self) -> bool
Returns true if self is of variant Nonlocal.
Sourcepub fn as_nonlocal_stmt(&self) -> Option<&&'a StmtNonlocal>
pub fn as_nonlocal_stmt(&self) -> Option<&&'a StmtNonlocal>
Returns Some if self is a reference of variant Nonlocal, and None otherwise.
Sourcepub fn as_mut_nonlocal_stmt(&mut self) -> Option<&mut &'a StmtNonlocal>
pub fn as_mut_nonlocal_stmt(&mut self) -> Option<&mut &'a StmtNonlocal>
Returns Some if self is a mutable reference of variant Nonlocal, and None otherwise.
Sourcepub fn expect_nonlocal_stmt(self) -> &'a StmtNonlocal
pub fn expect_nonlocal_stmt(self) -> &'a StmtNonlocal
Sourcepub fn nonlocal_stmt(self) -> Option<&'a StmtNonlocal>
pub fn nonlocal_stmt(self) -> Option<&'a StmtNonlocal>
Returns Some if self is of variant Nonlocal, and None otherwise.
Sourcepub const fn is_expr_stmt(&self) -> bool
pub const fn is_expr_stmt(&self) -> bool
Returns true if self is of variant Expr.
Sourcepub fn as_expr_stmt(&self) -> Option<&&'a StmtExpr>
pub fn as_expr_stmt(&self) -> Option<&&'a StmtExpr>
Returns Some if self is a reference of variant Expr, and None otherwise.
Sourcepub fn as_mut_expr_stmt(&mut self) -> Option<&mut &'a StmtExpr>
pub fn as_mut_expr_stmt(&mut self) -> Option<&mut &'a StmtExpr>
Returns Some if self is a mutable reference of variant Expr, and None otherwise.
Sourcepub fn expect_expr_stmt(self) -> &'a StmtExpr
pub fn expect_expr_stmt(self) -> &'a StmtExpr
Sourcepub fn expr_stmt(self) -> Option<&'a StmtExpr>
pub fn expr_stmt(self) -> Option<&'a StmtExpr>
Returns Some if self is of variant Expr, and None otherwise.
Sourcepub const fn is_pass_stmt(&self) -> bool
pub const fn is_pass_stmt(&self) -> bool
Returns true if self is of variant Pass.
Sourcepub fn as_pass_stmt(&self) -> Option<&&'a StmtPass>
pub fn as_pass_stmt(&self) -> Option<&&'a StmtPass>
Returns Some if self is a reference of variant Pass, and None otherwise.
Sourcepub fn as_mut_pass_stmt(&mut self) -> Option<&mut &'a StmtPass>
pub fn as_mut_pass_stmt(&mut self) -> Option<&mut &'a StmtPass>
Returns Some if self is a mutable reference of variant Pass, and None otherwise.
Sourcepub fn expect_pass_stmt(self) -> &'a StmtPass
pub fn expect_pass_stmt(self) -> &'a StmtPass
Sourcepub fn pass_stmt(self) -> Option<&'a StmtPass>
pub fn pass_stmt(self) -> Option<&'a StmtPass>
Returns Some if self is of variant Pass, and None otherwise.
Sourcepub const fn is_break_stmt(&self) -> bool
pub const fn is_break_stmt(&self) -> bool
Returns true if self is of variant Break.
Sourcepub fn as_break_stmt(&self) -> Option<&&'a StmtBreak>
pub fn as_break_stmt(&self) -> Option<&&'a StmtBreak>
Returns Some if self is a reference of variant Break, and None otherwise.
Sourcepub fn as_mut_break_stmt(&mut self) -> Option<&mut &'a StmtBreak>
pub fn as_mut_break_stmt(&mut self) -> Option<&mut &'a StmtBreak>
Returns Some if self is a mutable reference of variant Break, and None otherwise.
Sourcepub fn expect_break_stmt(self) -> &'a StmtBreak
pub fn expect_break_stmt(self) -> &'a StmtBreak
Sourcepub fn break_stmt(self) -> Option<&'a StmtBreak>
pub fn break_stmt(self) -> Option<&'a StmtBreak>
Returns Some if self is of variant Break, and None otherwise.
Sourcepub const fn is_continue_stmt(&self) -> bool
pub const fn is_continue_stmt(&self) -> bool
Returns true if self is of variant Continue.
Sourcepub fn as_continue_stmt(&self) -> Option<&&'a StmtContinue>
pub fn as_continue_stmt(&self) -> Option<&&'a StmtContinue>
Returns Some if self is a reference of variant Continue, and None otherwise.
Sourcepub fn as_mut_continue_stmt(&mut self) -> Option<&mut &'a StmtContinue>
pub fn as_mut_continue_stmt(&mut self) -> Option<&mut &'a StmtContinue>
Returns Some if self is a mutable reference of variant Continue, and None otherwise.
Sourcepub fn expect_continue_stmt(self) -> &'a StmtContinue
pub fn expect_continue_stmt(self) -> &'a StmtContinue
Sourcepub fn continue_stmt(self) -> Option<&'a StmtContinue>
pub fn continue_stmt(self) -> Option<&'a StmtContinue>
Returns Some if self is of variant Continue, and None otherwise.
Sourcepub const fn is_ipy_escape_command_stmt(&self) -> bool
pub const fn is_ipy_escape_command_stmt(&self) -> bool
Returns true if self is of variant IpyEscapeCommand.
Sourcepub fn as_ipy_escape_command_stmt(&self) -> Option<&&'a StmtIpyEscapeCommand>
pub fn as_ipy_escape_command_stmt(&self) -> Option<&&'a StmtIpyEscapeCommand>
Returns Some if self is a reference of variant IpyEscapeCommand, and None otherwise.
Sourcepub fn as_mut_ipy_escape_command_stmt(
&mut self,
) -> Option<&mut &'a StmtIpyEscapeCommand>
pub fn as_mut_ipy_escape_command_stmt( &mut self, ) -> Option<&mut &'a StmtIpyEscapeCommand>
Returns Some if self is a mutable reference of variant IpyEscapeCommand, and None otherwise.
Sourcepub fn expect_ipy_escape_command_stmt(self) -> &'a StmtIpyEscapeCommand
pub fn expect_ipy_escape_command_stmt(self) -> &'a StmtIpyEscapeCommand
Unwraps the value, yielding the content of IpyEscapeCommand.
§Panics
Panics if the value is not IpyEscapeCommand. In debug builds the panic message includes the content of self.
Sourcepub fn ipy_escape_command_stmt(self) -> Option<&'a StmtIpyEscapeCommand>
pub fn ipy_escape_command_stmt(self) -> Option<&'a StmtIpyEscapeCommand>
Returns Some if self is of variant IpyEscapeCommand, and None otherwise.
Trait Implementations§
impl<'a> Copy for StmtRef<'a>
Source§impl<'a> From<&'a StmtAnnAssign> for StmtRef<'a>
impl<'a> From<&'a StmtAnnAssign> for StmtRef<'a>
Source§fn from(node: &'a StmtAnnAssign) -> StmtRef<'a>
fn from(node: &'a StmtAnnAssign) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtAssert> for StmtRef<'a>
impl<'a> From<&'a StmtAssert> for StmtRef<'a>
Source§fn from(node: &'a StmtAssert) -> StmtRef<'a>
fn from(node: &'a StmtAssert) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtAssign> for StmtRef<'a>
impl<'a> From<&'a StmtAssign> for StmtRef<'a>
Source§fn from(node: &'a StmtAssign) -> StmtRef<'a>
fn from(node: &'a StmtAssign) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtAugAssign> for StmtRef<'a>
impl<'a> From<&'a StmtAugAssign> for StmtRef<'a>
Source§fn from(node: &'a StmtAugAssign) -> StmtRef<'a>
fn from(node: &'a StmtAugAssign) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtClassDef> for StmtRef<'a>
impl<'a> From<&'a StmtClassDef> for StmtRef<'a>
Source§fn from(node: &'a StmtClassDef) -> StmtRef<'a>
fn from(node: &'a StmtClassDef) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtContinue> for StmtRef<'a>
impl<'a> From<&'a StmtContinue> for StmtRef<'a>
Source§fn from(node: &'a StmtContinue) -> StmtRef<'a>
fn from(node: &'a StmtContinue) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtDelete> for StmtRef<'a>
impl<'a> From<&'a StmtDelete> for StmtRef<'a>
Source§fn from(node: &'a StmtDelete) -> StmtRef<'a>
fn from(node: &'a StmtDelete) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtFunctionDef> for StmtRef<'a>
impl<'a> From<&'a StmtFunctionDef> for StmtRef<'a>
Source§fn from(node: &'a StmtFunctionDef) -> StmtRef<'a>
fn from(node: &'a StmtFunctionDef) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtGlobal> for StmtRef<'a>
impl<'a> From<&'a StmtGlobal> for StmtRef<'a>
Source§fn from(node: &'a StmtGlobal) -> StmtRef<'a>
fn from(node: &'a StmtGlobal) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtImport> for StmtRef<'a>
impl<'a> From<&'a StmtImport> for StmtRef<'a>
Source§fn from(node: &'a StmtImport) -> StmtRef<'a>
fn from(node: &'a StmtImport) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtImportFrom> for StmtRef<'a>
impl<'a> From<&'a StmtImportFrom> for StmtRef<'a>
Source§fn from(node: &'a StmtImportFrom) -> StmtRef<'a>
fn from(node: &'a StmtImportFrom) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtIpyEscapeCommand> for StmtRef<'a>
impl<'a> From<&'a StmtIpyEscapeCommand> for StmtRef<'a>
Source§fn from(node: &'a StmtIpyEscapeCommand) -> StmtRef<'a>
fn from(node: &'a StmtIpyEscapeCommand) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtNonlocal> for StmtRef<'a>
impl<'a> From<&'a StmtNonlocal> for StmtRef<'a>
Source§fn from(node: &'a StmtNonlocal) -> StmtRef<'a>
fn from(node: &'a StmtNonlocal) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtReturn> for StmtRef<'a>
impl<'a> From<&'a StmtReturn> for StmtRef<'a>
Source§fn from(node: &'a StmtReturn) -> StmtRef<'a>
fn from(node: &'a StmtReturn) -> StmtRef<'a>
Source§impl<'a> From<&'a StmtTypeAlias> for StmtRef<'a>
impl<'a> From<&'a StmtTypeAlias> for StmtRef<'a>
Source§fn from(node: &'a StmtTypeAlias) -> StmtRef<'a>
fn from(node: &'a StmtTypeAlias) -> StmtRef<'a>
Source§impl<'a> From<StmtRef<'a>> for AnyNodeRef<'a>
impl<'a> From<StmtRef<'a>> for AnyNodeRef<'a>
Source§fn from(node: StmtRef<'a>) -> AnyNodeRef<'a>
fn from(node: StmtRef<'a>) -> AnyNodeRef<'a>
Source§impl<'a> GetSize for StmtRef<'a>
impl<'a> GetSize for StmtRef<'a>
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
tracker. Read moreSource§impl HasNodeIndex for StmtRef<'_>
impl HasNodeIndex for StmtRef<'_>
Source§fn node_index(&self) -> &AtomicNodeIndex
fn node_index(&self) -> &AtomicNodeIndex
AtomicNodeIndex for this node.impl<'a> StructuralPartialEq for StmtRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for StmtRef<'a>
impl<'a> RefUnwindSafe for StmtRef<'a>
impl<'a> Send for StmtRef<'a>
impl<'a> Sync for StmtRef<'a>
impl<'a> Unpin for StmtRef<'a>
impl<'a> UnsafeUnpin for StmtRef<'a>
impl<'a> UnwindSafe for StmtRef<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more