pub enum Stmt {
Show 25 variants
FunctionDef(StmtFunctionDef),
ClassDef(StmtClassDef),
Return(StmtReturn),
Delete(StmtDelete),
TypeAlias(StmtTypeAlias),
Assign(StmtAssign),
AugAssign(StmtAugAssign),
AnnAssign(StmtAnnAssign),
For(StmtFor),
While(StmtWhile),
If(StmtIf),
With(StmtWith),
Match(StmtMatch),
Raise(StmtRaise),
Try(StmtTry),
Assert(StmtAssert),
Import(StmtImport),
ImportFrom(StmtImportFrom),
Global(StmtGlobal),
Nonlocal(StmtNonlocal),
Expr(StmtExpr),
Pass(StmtPass),
Break(StmtBreak),
Continue(StmtContinue),
IpyEscapeCommand(StmtIpyEscapeCommand),
}Expand description
See also stmt
Variants§
FunctionDef(StmtFunctionDef)
ClassDef(StmtClassDef)
Return(StmtReturn)
Delete(StmtDelete)
TypeAlias(StmtTypeAlias)
Assign(StmtAssign)
AugAssign(StmtAugAssign)
AnnAssign(StmtAnnAssign)
For(StmtFor)
While(StmtWhile)
If(StmtIf)
With(StmtWith)
Match(StmtMatch)
Raise(StmtRaise)
Try(StmtTry)
Assert(StmtAssert)
Import(StmtImport)
ImportFrom(StmtImportFrom)
Global(StmtGlobal)
Nonlocal(StmtNonlocal)
Expr(StmtExpr)
Pass(StmtPass)
Break(StmtBreak)
Continue(StmtContinue)
IpyEscapeCommand(StmtIpyEscapeCommand)
Implementations§
Source§impl Stmt
impl Stmt
pub const fn is_function_def_stmt(&self) -> bool
pub fn function_def_stmt(self) -> Option<StmtFunctionDef>
pub fn expect_function_def_stmt(self) -> StmtFunctionDef
pub fn as_function_def_stmt_mut(&mut self) -> Option<&mut StmtFunctionDef>
pub fn as_function_def_stmt(&self) -> Option<&StmtFunctionDef>
pub const fn is_class_def_stmt(&self) -> bool
pub fn class_def_stmt(self) -> Option<StmtClassDef>
pub fn expect_class_def_stmt(self) -> StmtClassDef
pub fn as_class_def_stmt_mut(&mut self) -> Option<&mut StmtClassDef>
pub fn as_class_def_stmt(&self) -> Option<&StmtClassDef>
pub const fn is_return_stmt(&self) -> bool
pub fn return_stmt(self) -> Option<StmtReturn>
pub fn expect_return_stmt(self) -> StmtReturn
pub fn as_return_stmt_mut(&mut self) -> Option<&mut StmtReturn>
pub fn as_return_stmt(&self) -> Option<&StmtReturn>
pub const fn is_delete_stmt(&self) -> bool
pub fn delete_stmt(self) -> Option<StmtDelete>
pub fn expect_delete_stmt(self) -> StmtDelete
pub fn as_delete_stmt_mut(&mut self) -> Option<&mut StmtDelete>
pub fn as_delete_stmt(&self) -> Option<&StmtDelete>
pub const fn is_type_alias_stmt(&self) -> bool
pub fn type_alias_stmt(self) -> Option<StmtTypeAlias>
pub fn expect_type_alias_stmt(self) -> StmtTypeAlias
pub fn as_type_alias_stmt_mut(&mut self) -> Option<&mut StmtTypeAlias>
pub fn as_type_alias_stmt(&self) -> Option<&StmtTypeAlias>
pub const fn is_assign_stmt(&self) -> bool
pub fn assign_stmt(self) -> Option<StmtAssign>
pub fn expect_assign_stmt(self) -> StmtAssign
pub fn as_assign_stmt_mut(&mut self) -> Option<&mut StmtAssign>
pub fn as_assign_stmt(&self) -> Option<&StmtAssign>
pub const fn is_aug_assign_stmt(&self) -> bool
pub fn aug_assign_stmt(self) -> Option<StmtAugAssign>
pub fn expect_aug_assign_stmt(self) -> StmtAugAssign
pub fn as_aug_assign_stmt_mut(&mut self) -> Option<&mut StmtAugAssign>
pub fn as_aug_assign_stmt(&self) -> Option<&StmtAugAssign>
pub const fn is_ann_assign_stmt(&self) -> bool
pub fn ann_assign_stmt(self) -> Option<StmtAnnAssign>
pub fn expect_ann_assign_stmt(self) -> StmtAnnAssign
pub fn as_ann_assign_stmt_mut(&mut self) -> Option<&mut StmtAnnAssign>
pub fn as_ann_assign_stmt(&self) -> Option<&StmtAnnAssign>
pub const fn is_for_stmt(&self) -> bool
pub fn for_stmt(self) -> Option<StmtFor>
pub fn expect_for_stmt(self) -> StmtFor
pub fn as_for_stmt_mut(&mut self) -> Option<&mut StmtFor>
pub fn as_for_stmt(&self) -> Option<&StmtFor>
pub const fn is_while_stmt(&self) -> bool
pub fn while_stmt(self) -> Option<StmtWhile>
pub fn expect_while_stmt(self) -> StmtWhile
pub fn as_while_stmt_mut(&mut self) -> Option<&mut StmtWhile>
pub fn as_while_stmt(&self) -> Option<&StmtWhile>
pub const fn is_if_stmt(&self) -> bool
pub fn if_stmt(self) -> Option<StmtIf>
pub fn expect_if_stmt(self) -> StmtIf
pub fn as_if_stmt_mut(&mut self) -> Option<&mut StmtIf>
pub fn as_if_stmt(&self) -> Option<&StmtIf>
pub const fn is_with_stmt(&self) -> bool
pub fn with_stmt(self) -> Option<StmtWith>
pub fn expect_with_stmt(self) -> StmtWith
pub fn as_with_stmt_mut(&mut self) -> Option<&mut StmtWith>
pub fn as_with_stmt(&self) -> Option<&StmtWith>
pub const fn is_match_stmt(&self) -> bool
pub fn match_stmt(self) -> Option<StmtMatch>
pub fn expect_match_stmt(self) -> StmtMatch
pub fn as_match_stmt_mut(&mut self) -> Option<&mut StmtMatch>
pub fn as_match_stmt(&self) -> Option<&StmtMatch>
pub const fn is_raise_stmt(&self) -> bool
pub fn raise_stmt(self) -> Option<StmtRaise>
pub fn expect_raise_stmt(self) -> StmtRaise
pub fn as_raise_stmt_mut(&mut self) -> Option<&mut StmtRaise>
pub fn as_raise_stmt(&self) -> Option<&StmtRaise>
pub const fn is_try_stmt(&self) -> bool
pub fn try_stmt(self) -> Option<StmtTry>
pub fn expect_try_stmt(self) -> StmtTry
pub fn as_try_stmt_mut(&mut self) -> Option<&mut StmtTry>
pub fn as_try_stmt(&self) -> Option<&StmtTry>
pub const fn is_assert_stmt(&self) -> bool
pub fn assert_stmt(self) -> Option<StmtAssert>
pub fn expect_assert_stmt(self) -> StmtAssert
pub fn as_assert_stmt_mut(&mut self) -> Option<&mut StmtAssert>
pub fn as_assert_stmt(&self) -> Option<&StmtAssert>
pub const fn is_import_stmt(&self) -> bool
pub fn import_stmt(self) -> Option<StmtImport>
pub fn expect_import_stmt(self) -> StmtImport
pub fn as_import_stmt_mut(&mut self) -> Option<&mut StmtImport>
pub fn as_import_stmt(&self) -> Option<&StmtImport>
pub const fn is_import_from_stmt(&self) -> bool
pub fn import_from_stmt(self) -> Option<StmtImportFrom>
pub fn expect_import_from_stmt(self) -> StmtImportFrom
pub fn as_import_from_stmt_mut(&mut self) -> Option<&mut StmtImportFrom>
pub fn as_import_from_stmt(&self) -> Option<&StmtImportFrom>
pub const fn is_global_stmt(&self) -> bool
pub fn global_stmt(self) -> Option<StmtGlobal>
pub fn expect_global_stmt(self) -> StmtGlobal
pub fn as_global_stmt_mut(&mut self) -> Option<&mut StmtGlobal>
pub fn as_global_stmt(&self) -> Option<&StmtGlobal>
pub const fn is_nonlocal_stmt(&self) -> bool
pub fn nonlocal_stmt(self) -> Option<StmtNonlocal>
pub fn expect_nonlocal_stmt(self) -> StmtNonlocal
pub fn as_nonlocal_stmt_mut(&mut self) -> Option<&mut StmtNonlocal>
pub fn as_nonlocal_stmt(&self) -> Option<&StmtNonlocal>
pub const fn is_expr_stmt(&self) -> bool
pub fn expr_stmt(self) -> Option<StmtExpr>
pub fn expect_expr_stmt(self) -> StmtExpr
pub fn as_expr_stmt_mut(&mut self) -> Option<&mut StmtExpr>
pub fn as_expr_stmt(&self) -> Option<&StmtExpr>
pub const fn is_pass_stmt(&self) -> bool
pub fn pass_stmt(self) -> Option<StmtPass>
pub fn expect_pass_stmt(self) -> StmtPass
pub fn as_pass_stmt_mut(&mut self) -> Option<&mut StmtPass>
pub fn as_pass_stmt(&self) -> Option<&StmtPass>
pub const fn is_break_stmt(&self) -> bool
pub fn break_stmt(self) -> Option<StmtBreak>
pub fn expect_break_stmt(self) -> StmtBreak
pub fn as_break_stmt_mut(&mut self) -> Option<&mut StmtBreak>
pub fn as_break_stmt(&self) -> Option<&StmtBreak>
pub const fn is_continue_stmt(&self) -> bool
pub fn continue_stmt(self) -> Option<StmtContinue>
pub fn expect_continue_stmt(self) -> StmtContinue
pub fn as_continue_stmt_mut(&mut self) -> Option<&mut StmtContinue>
pub fn as_continue_stmt(&self) -> Option<&StmtContinue>
pub const fn is_ipy_escape_command_stmt(&self) -> bool
pub fn ipy_escape_command_stmt(self) -> Option<StmtIpyEscapeCommand>
pub fn expect_ipy_escape_command_stmt(self) -> StmtIpyEscapeCommand
pub fn as_ipy_escape_command_stmt_mut( &mut self, ) -> Option<&mut StmtIpyEscapeCommand>
pub fn as_ipy_escape_command_stmt(&self) -> Option<&StmtIpyEscapeCommand>
Trait Implementations§
Source§impl<'a> From<&'a Stmt> for AnyNodeRef<'a>
impl<'a> From<&'a Stmt> for AnyNodeRef<'a>
Source§fn from(node: &'a Stmt) -> AnyNodeRef<'a>
fn from(node: &'a Stmt) -> AnyNodeRef<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a Stmt> for AnyRootNodeRef<'a>
impl<'a> From<&'a Stmt> for AnyRootNodeRef<'a>
Source§fn from(node: &'a Stmt) -> AnyRootNodeRef<'a>
fn from(node: &'a Stmt) -> AnyRootNodeRef<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a Stmt> for ComparableStmt<'a>
impl<'a> From<&'a Stmt> for ComparableStmt<'a>
Source§impl From<StmtAnnAssign> for Stmt
impl From<StmtAnnAssign> for Stmt
Source§fn from(node: StmtAnnAssign) -> Self
fn from(node: StmtAnnAssign) -> Self
Converts to this type from the input type.
Source§impl From<StmtAssert> for Stmt
impl From<StmtAssert> for Stmt
Source§fn from(node: StmtAssert) -> Self
fn from(node: StmtAssert) -> Self
Converts to this type from the input type.
Source§impl From<StmtAssign> for Stmt
impl From<StmtAssign> for Stmt
Source§fn from(node: StmtAssign) -> Self
fn from(node: StmtAssign) -> Self
Converts to this type from the input type.
Source§impl From<StmtAugAssign> for Stmt
impl From<StmtAugAssign> for Stmt
Source§fn from(node: StmtAugAssign) -> Self
fn from(node: StmtAugAssign) -> Self
Converts to this type from the input type.
Source§impl From<StmtClassDef> for Stmt
impl From<StmtClassDef> for Stmt
Source§fn from(node: StmtClassDef) -> Self
fn from(node: StmtClassDef) -> Self
Converts to this type from the input type.
Source§impl From<StmtContinue> for Stmt
impl From<StmtContinue> for Stmt
Source§fn from(node: StmtContinue) -> Self
fn from(node: StmtContinue) -> Self
Converts to this type from the input type.
Source§impl From<StmtDelete> for Stmt
impl From<StmtDelete> for Stmt
Source§fn from(node: StmtDelete) -> Self
fn from(node: StmtDelete) -> Self
Converts to this type from the input type.
Source§impl From<StmtFunctionDef> for Stmt
impl From<StmtFunctionDef> for Stmt
Source§fn from(node: StmtFunctionDef) -> Self
fn from(node: StmtFunctionDef) -> Self
Converts to this type from the input type.
Source§impl From<StmtGlobal> for Stmt
impl From<StmtGlobal> for Stmt
Source§fn from(node: StmtGlobal) -> Self
fn from(node: StmtGlobal) -> Self
Converts to this type from the input type.
Source§impl From<StmtImport> for Stmt
impl From<StmtImport> for Stmt
Source§fn from(node: StmtImport) -> Self
fn from(node: StmtImport) -> Self
Converts to this type from the input type.
Source§impl From<StmtImportFrom> for Stmt
impl From<StmtImportFrom> for Stmt
Source§fn from(node: StmtImportFrom) -> Self
fn from(node: StmtImportFrom) -> Self
Converts to this type from the input type.
Source§impl From<StmtIpyEscapeCommand> for Stmt
impl From<StmtIpyEscapeCommand> for Stmt
Source§fn from(node: StmtIpyEscapeCommand) -> Self
fn from(node: StmtIpyEscapeCommand) -> Self
Converts to this type from the input type.
Source§impl From<StmtNonlocal> for Stmt
impl From<StmtNonlocal> for Stmt
Source§fn from(node: StmtNonlocal) -> Self
fn from(node: StmtNonlocal) -> Self
Converts to this type from the input type.
Source§impl From<StmtReturn> for Stmt
impl From<StmtReturn> for Stmt
Source§fn from(node: StmtReturn) -> Self
fn from(node: StmtReturn) -> Self
Converts to this type from the input type.
Source§impl From<StmtTypeAlias> for Stmt
impl From<StmtTypeAlias> for Stmt
Source§fn from(node: StmtTypeAlias) -> Self
fn from(node: StmtTypeAlias) -> Self
Converts to this type from the input type.
Source§impl HasNodeIndex for Stmt
impl HasNodeIndex for Stmt
Source§fn node_index(&self) -> &AtomicNodeIndex
fn node_index(&self) -> &AtomicNodeIndex
Returns the
AtomicNodeIndex for this node.Source§impl Identifier for Stmt
impl Identifier for Stmt
Source§fn identifier(&self) -> TextRange
fn identifier(&self) -> TextRange
Return the TextRange of the identifier in the given statement.
For example, return the range of f in:
def f():
...Source§impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Stmt
impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Stmt
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl !Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnsafeUnpin for Stmt
impl UnwindSafe for Stmt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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