Enum rustpython_ast::Stmt

source ·
pub enum Stmt<R = TextRange> {
Show 28 variants FunctionDef(StmtFunctionDef<R>), AsyncFunctionDef(StmtAsyncFunctionDef<R>), ClassDef(StmtClassDef<R>), Return(StmtReturn<R>), Delete(StmtDelete<R>), Assign(StmtAssign<R>), TypeAlias(StmtTypeAlias<R>), AugAssign(StmtAugAssign<R>), AnnAssign(StmtAnnAssign<R>), For(StmtFor<R>), AsyncFor(StmtAsyncFor<R>), While(StmtWhile<R>), If(StmtIf<R>), With(StmtWith<R>), AsyncWith(StmtAsyncWith<R>), Match(StmtMatch<R>), Raise(StmtRaise<R>), Try(StmtTry<R>), TryStar(StmtTryStar<R>), Assert(StmtAssert<R>), Import(StmtImport<R>), ImportFrom(StmtImportFrom<R>), Global(StmtGlobal<R>), Nonlocal(StmtNonlocal<R>), Expr(StmtExpr<R>), Pass(StmtPass<R>), Break(StmtBreak<R>), Continue(StmtContinue<R>),
}
Expand description

See also stmt

Variants§

§

FunctionDef(StmtFunctionDef<R>)

§

AsyncFunctionDef(StmtAsyncFunctionDef<R>)

§

ClassDef(StmtClassDef<R>)

§

Return(StmtReturn<R>)

§

Delete(StmtDelete<R>)

§

Assign(StmtAssign<R>)

§

TypeAlias(StmtTypeAlias<R>)

§

AugAssign(StmtAugAssign<R>)

§

AnnAssign(StmtAnnAssign<R>)

§

For(StmtFor<R>)

§

AsyncFor(StmtAsyncFor<R>)

§

While(StmtWhile<R>)

§

If(StmtIf<R>)

§

With(StmtWith<R>)

§

AsyncWith(StmtAsyncWith<R>)

§

Match(StmtMatch<R>)

§

Raise(StmtRaise<R>)

§

Try(StmtTry<R>)

§

TryStar(StmtTryStar<R>)

§

Assert(StmtAssert<R>)

§

Import(StmtImport<R>)

§

ImportFrom(StmtImportFrom<R>)

§

Global(StmtGlobal<R>)

§

Nonlocal(StmtNonlocal<R>)

§

Expr(StmtExpr<R>)

§

Pass(StmtPass<R>)

§

Break(StmtBreak<R>)

§

Continue(StmtContinue<R>)

Implementations§

source§

impl<R> Stmt<R>

source

pub const fn is_function_def_stmt(&self) -> bool

Returns true if self is of variant FunctionDef.

source

pub fn as_function_def_stmt(&self) -> Option<&StmtFunctionDef<R>>

Returns Some if self is a reference of variant FunctionDef, and None otherwise.

source

pub fn as_mut_function_def_stmt(&mut self) -> Option<&mut StmtFunctionDef<R>>

Returns Some if self is a mutable reference of variant FunctionDef, and None otherwise.

source

pub fn expect_function_def_stmt(self) -> StmtFunctionDef<R>
where Self: Debug,

Unwraps the value, yielding the content of FunctionDef.

§Panics

Panics if the value is not FunctionDef, with a panic message including the content of self.

source

pub fn function_def_stmt(self) -> Option<StmtFunctionDef<R>>

Returns Some if self is of variant FunctionDef, and None otherwise.

source

pub const fn is_async_function_def_stmt(&self) -> bool

Returns true if self is of variant AsyncFunctionDef.

source

pub fn as_async_function_def_stmt(&self) -> Option<&StmtAsyncFunctionDef<R>>

Returns Some if self is a reference of variant AsyncFunctionDef, and None otherwise.

source

pub fn as_mut_async_function_def_stmt( &mut self ) -> Option<&mut StmtAsyncFunctionDef<R>>

Returns Some if self is a mutable reference of variant AsyncFunctionDef, and None otherwise.

source

pub fn expect_async_function_def_stmt(self) -> StmtAsyncFunctionDef<R>
where Self: Debug,

Unwraps the value, yielding the content of AsyncFunctionDef.

§Panics

Panics if the value is not AsyncFunctionDef, with a panic message including the content of self.

source

pub fn async_function_def_stmt(self) -> Option<StmtAsyncFunctionDef<R>>

Returns Some if self is of variant AsyncFunctionDef, and None otherwise.

source

pub const fn is_class_def_stmt(&self) -> bool

Returns true if self is of variant ClassDef.

source

pub fn as_class_def_stmt(&self) -> Option<&StmtClassDef<R>>

Returns Some if self is a reference of variant ClassDef, and None otherwise.

source

pub fn as_mut_class_def_stmt(&mut self) -> Option<&mut StmtClassDef<R>>

Returns Some if self is a mutable reference of variant ClassDef, and None otherwise.

source

pub fn expect_class_def_stmt(self) -> StmtClassDef<R>
where Self: Debug,

Unwraps the value, yielding the content of ClassDef.

§Panics

Panics if the value is not ClassDef, with a panic message including the content of self.

source

pub fn class_def_stmt(self) -> Option<StmtClassDef<R>>

Returns Some if self is of variant ClassDef, and None otherwise.

source

pub const fn is_return_stmt(&self) -> bool

Returns true if self is of variant Return.

source

pub fn as_return_stmt(&self) -> Option<&StmtReturn<R>>

Returns Some if self is a reference of variant Return, and None otherwise.

source

pub fn as_mut_return_stmt(&mut self) -> Option<&mut StmtReturn<R>>

Returns Some if self is a mutable reference of variant Return, and None otherwise.

source

pub fn expect_return_stmt(self) -> StmtReturn<R>
where Self: Debug,

Unwraps the value, yielding the content of Return.

§Panics

Panics if the value is not Return, with a panic message including the content of self.

source

pub fn return_stmt(self) -> Option<StmtReturn<R>>

Returns Some if self is of variant Return, and None otherwise.

source

pub const fn is_delete_stmt(&self) -> bool

Returns true if self is of variant Delete.

source

pub fn as_delete_stmt(&self) -> Option<&StmtDelete<R>>

Returns Some if self is a reference of variant Delete, and None otherwise.

source

pub fn as_mut_delete_stmt(&mut self) -> Option<&mut StmtDelete<R>>

Returns Some if self is a mutable reference of variant Delete, and None otherwise.

source

pub fn expect_delete_stmt(self) -> StmtDelete<R>
where Self: Debug,

Unwraps the value, yielding the content of Delete.

§Panics

Panics if the value is not Delete, with a panic message including the content of self.

source

pub fn delete_stmt(self) -> Option<StmtDelete<R>>

Returns Some if self is of variant Delete, and None otherwise.

source

pub const fn is_assign_stmt(&self) -> bool

Returns true if self is of variant Assign.

source

pub fn as_assign_stmt(&self) -> Option<&StmtAssign<R>>

Returns Some if self is a reference of variant Assign, and None otherwise.

source

pub fn as_mut_assign_stmt(&mut self) -> Option<&mut StmtAssign<R>>

Returns Some if self is a mutable reference of variant Assign, and None otherwise.

source

pub fn expect_assign_stmt(self) -> StmtAssign<R>
where Self: Debug,

Unwraps the value, yielding the content of Assign.

§Panics

Panics if the value is not Assign, with a panic message including the content of self.

source

pub fn assign_stmt(self) -> Option<StmtAssign<R>>

Returns Some if self is of variant Assign, and None otherwise.

source

pub const fn is_type_alias_stmt(&self) -> bool

Returns true if self is of variant TypeAlias.

source

pub fn as_type_alias_stmt(&self) -> Option<&StmtTypeAlias<R>>

Returns Some if self is a reference of variant TypeAlias, and None otherwise.

source

pub fn as_mut_type_alias_stmt(&mut self) -> Option<&mut StmtTypeAlias<R>>

Returns Some if self is a mutable reference of variant TypeAlias, and None otherwise.

source

pub fn expect_type_alias_stmt(self) -> StmtTypeAlias<R>
where Self: Debug,

Unwraps the value, yielding the content of TypeAlias.

§Panics

Panics if the value is not TypeAlias, with a panic message including the content of self.

source

pub fn type_alias_stmt(self) -> Option<StmtTypeAlias<R>>

Returns Some if self is of variant TypeAlias, and None otherwise.

source

pub const fn is_aug_assign_stmt(&self) -> bool

Returns true if self is of variant AugAssign.

source

pub fn as_aug_assign_stmt(&self) -> Option<&StmtAugAssign<R>>

Returns Some if self is a reference of variant AugAssign, and None otherwise.

source

pub fn as_mut_aug_assign_stmt(&mut self) -> Option<&mut StmtAugAssign<R>>

Returns Some if self is a mutable reference of variant AugAssign, and None otherwise.

source

pub fn expect_aug_assign_stmt(self) -> StmtAugAssign<R>
where Self: Debug,

Unwraps the value, yielding the content of AugAssign.

§Panics

Panics if the value is not AugAssign, with a panic message including the content of self.

source

pub fn aug_assign_stmt(self) -> Option<StmtAugAssign<R>>

Returns Some if self is of variant AugAssign, and None otherwise.

source

pub const fn is_ann_assign_stmt(&self) -> bool

Returns true if self is of variant AnnAssign.

source

pub fn as_ann_assign_stmt(&self) -> Option<&StmtAnnAssign<R>>

Returns Some if self is a reference of variant AnnAssign, and None otherwise.

source

pub fn as_mut_ann_assign_stmt(&mut self) -> Option<&mut StmtAnnAssign<R>>

Returns Some if self is a mutable reference of variant AnnAssign, and None otherwise.

source

pub fn expect_ann_assign_stmt(self) -> StmtAnnAssign<R>
where Self: Debug,

Unwraps the value, yielding the content of AnnAssign.

§Panics

Panics if the value is not AnnAssign, with a panic message including the content of self.

source

pub fn ann_assign_stmt(self) -> Option<StmtAnnAssign<R>>

Returns Some if self is of variant AnnAssign, and None otherwise.

source

pub const fn is_for_stmt(&self) -> bool

Returns true if self is of variant For.

source

pub fn as_for_stmt(&self) -> Option<&StmtFor<R>>

Returns Some if self is a reference of variant For, and None otherwise.

source

pub fn as_mut_for_stmt(&mut self) -> Option<&mut StmtFor<R>>

Returns Some if self is a mutable reference of variant For, and None otherwise.

source

pub fn expect_for_stmt(self) -> StmtFor<R>
where Self: Debug,

Unwraps the value, yielding the content of For.

§Panics

Panics if the value is not For, with a panic message including the content of self.

source

pub fn for_stmt(self) -> Option<StmtFor<R>>

Returns Some if self is of variant For, and None otherwise.

source

pub const fn is_async_for_stmt(&self) -> bool

Returns true if self is of variant AsyncFor.

source

pub fn as_async_for_stmt(&self) -> Option<&StmtAsyncFor<R>>

Returns Some if self is a reference of variant AsyncFor, and None otherwise.

source

pub fn as_mut_async_for_stmt(&mut self) -> Option<&mut StmtAsyncFor<R>>

Returns Some if self is a mutable reference of variant AsyncFor, and None otherwise.

source

pub fn expect_async_for_stmt(self) -> StmtAsyncFor<R>
where Self: Debug,

Unwraps the value, yielding the content of AsyncFor.

§Panics

Panics if the value is not AsyncFor, with a panic message including the content of self.

source

pub fn async_for_stmt(self) -> Option<StmtAsyncFor<R>>

Returns Some if self is of variant AsyncFor, and None otherwise.

source

pub const fn is_while_stmt(&self) -> bool

Returns true if self is of variant While.

source

pub fn as_while_stmt(&self) -> Option<&StmtWhile<R>>

Returns Some if self is a reference of variant While, and None otherwise.

source

pub fn as_mut_while_stmt(&mut self) -> Option<&mut StmtWhile<R>>

Returns Some if self is a mutable reference of variant While, and None otherwise.

source

pub fn expect_while_stmt(self) -> StmtWhile<R>
where Self: Debug,

Unwraps the value, yielding the content of While.

§Panics

Panics if the value is not While, with a panic message including the content of self.

source

pub fn while_stmt(self) -> Option<StmtWhile<R>>

Returns Some if self is of variant While, and None otherwise.

source

pub const fn is_if_stmt(&self) -> bool

Returns true if self is of variant If.

source

pub fn as_if_stmt(&self) -> Option<&StmtIf<R>>

Returns Some if self is a reference of variant If, and None otherwise.

source

pub fn as_mut_if_stmt(&mut self) -> Option<&mut StmtIf<R>>

Returns Some if self is a mutable reference of variant If, and None otherwise.

source

pub fn expect_if_stmt(self) -> StmtIf<R>
where Self: Debug,

Unwraps the value, yielding the content of If.

§Panics

Panics if the value is not If, with a panic message including the content of self.

source

pub fn if_stmt(self) -> Option<StmtIf<R>>

Returns Some if self is of variant If, and None otherwise.

source

pub const fn is_with_stmt(&self) -> bool

Returns true if self is of variant With.

source

pub fn as_with_stmt(&self) -> Option<&StmtWith<R>>

Returns Some if self is a reference of variant With, and None otherwise.

source

pub fn as_mut_with_stmt(&mut self) -> Option<&mut StmtWith<R>>

Returns Some if self is a mutable reference of variant With, and None otherwise.

source

pub fn expect_with_stmt(self) -> StmtWith<R>
where Self: Debug,

Unwraps the value, yielding the content of With.

§Panics

Panics if the value is not With, with a panic message including the content of self.

source

pub fn with_stmt(self) -> Option<StmtWith<R>>

Returns Some if self is of variant With, and None otherwise.

source

pub const fn is_async_with_stmt(&self) -> bool

Returns true if self is of variant AsyncWith.

source

pub fn as_async_with_stmt(&self) -> Option<&StmtAsyncWith<R>>

Returns Some if self is a reference of variant AsyncWith, and None otherwise.

source

pub fn as_mut_async_with_stmt(&mut self) -> Option<&mut StmtAsyncWith<R>>

Returns Some if self is a mutable reference of variant AsyncWith, and None otherwise.

source

pub fn expect_async_with_stmt(self) -> StmtAsyncWith<R>
where Self: Debug,

Unwraps the value, yielding the content of AsyncWith.

§Panics

Panics if the value is not AsyncWith, with a panic message including the content of self.

source

pub fn async_with_stmt(self) -> Option<StmtAsyncWith<R>>

Returns Some if self is of variant AsyncWith, and None otherwise.

source

pub const fn is_match_stmt(&self) -> bool

Returns true if self is of variant Match.

source

pub fn as_match_stmt(&self) -> Option<&StmtMatch<R>>

Returns Some if self is a reference of variant Match, and None otherwise.

source

pub fn as_mut_match_stmt(&mut self) -> Option<&mut StmtMatch<R>>

Returns Some if self is a mutable reference of variant Match, and None otherwise.

source

pub fn expect_match_stmt(self) -> StmtMatch<R>
where Self: Debug,

Unwraps the value, yielding the content of Match.

§Panics

Panics if the value is not Match, with a panic message including the content of self.

source

pub fn match_stmt(self) -> Option<StmtMatch<R>>

Returns Some if self is of variant Match, and None otherwise.

source

pub const fn is_raise_stmt(&self) -> bool

Returns true if self is of variant Raise.

source

pub fn as_raise_stmt(&self) -> Option<&StmtRaise<R>>

Returns Some if self is a reference of variant Raise, and None otherwise.

source

pub fn as_mut_raise_stmt(&mut self) -> Option<&mut StmtRaise<R>>

Returns Some if self is a mutable reference of variant Raise, and None otherwise.

source

pub fn expect_raise_stmt(self) -> StmtRaise<R>
where Self: Debug,

Unwraps the value, yielding the content of Raise.

§Panics

Panics if the value is not Raise, with a panic message including the content of self.

source

pub fn raise_stmt(self) -> Option<StmtRaise<R>>

Returns Some if self is of variant Raise, and None otherwise.

source

pub const fn is_try_stmt(&self) -> bool

Returns true if self is of variant Try.

source

pub fn as_try_stmt(&self) -> Option<&StmtTry<R>>

Returns Some if self is a reference of variant Try, and None otherwise.

source

pub fn as_mut_try_stmt(&mut self) -> Option<&mut StmtTry<R>>

Returns Some if self is a mutable reference of variant Try, and None otherwise.

source

pub fn expect_try_stmt(self) -> StmtTry<R>
where Self: Debug,

Unwraps the value, yielding the content of Try.

§Panics

Panics if the value is not Try, with a panic message including the content of self.

source

pub fn try_stmt(self) -> Option<StmtTry<R>>

Returns Some if self is of variant Try, and None otherwise.

source

pub const fn is_try_star_stmt(&self) -> bool

Returns true if self is of variant TryStar.

source

pub fn as_try_star_stmt(&self) -> Option<&StmtTryStar<R>>

Returns Some if self is a reference of variant TryStar, and None otherwise.

source

pub fn as_mut_try_star_stmt(&mut self) -> Option<&mut StmtTryStar<R>>

Returns Some if self is a mutable reference of variant TryStar, and None otherwise.

source

pub fn expect_try_star_stmt(self) -> StmtTryStar<R>
where Self: Debug,

Unwraps the value, yielding the content of TryStar.

§Panics

Panics if the value is not TryStar, with a panic message including the content of self.

source

pub fn try_star_stmt(self) -> Option<StmtTryStar<R>>

Returns Some if self is of variant TryStar, and None otherwise.

source

pub const fn is_assert_stmt(&self) -> bool

Returns true if self is of variant Assert.

source

pub fn as_assert_stmt(&self) -> Option<&StmtAssert<R>>

Returns Some if self is a reference of variant Assert, and None otherwise.

source

pub fn as_mut_assert_stmt(&mut self) -> Option<&mut StmtAssert<R>>

Returns Some if self is a mutable reference of variant Assert, and None otherwise.

source

pub fn expect_assert_stmt(self) -> StmtAssert<R>
where Self: Debug,

Unwraps the value, yielding the content of Assert.

§Panics

Panics if the value is not Assert, with a panic message including the content of self.

source

pub fn assert_stmt(self) -> Option<StmtAssert<R>>

Returns Some if self is of variant Assert, and None otherwise.

source

pub const fn is_import_stmt(&self) -> bool

Returns true if self is of variant Import.

source

pub fn as_import_stmt(&self) -> Option<&StmtImport<R>>

Returns Some if self is a reference of variant Import, and None otherwise.

source

pub fn as_mut_import_stmt(&mut self) -> Option<&mut StmtImport<R>>

Returns Some if self is a mutable reference of variant Import, and None otherwise.

source

pub fn expect_import_stmt(self) -> StmtImport<R>
where Self: Debug,

Unwraps the value, yielding the content of Import.

§Panics

Panics if the value is not Import, with a panic message including the content of self.

source

pub fn import_stmt(self) -> Option<StmtImport<R>>

Returns Some if self is of variant Import, and None otherwise.

source

pub const fn is_import_from_stmt(&self) -> bool

Returns true if self is of variant ImportFrom.

source

pub fn as_import_from_stmt(&self) -> Option<&StmtImportFrom<R>>

Returns Some if self is a reference of variant ImportFrom, and None otherwise.

source

pub fn as_mut_import_from_stmt(&mut self) -> Option<&mut StmtImportFrom<R>>

Returns Some if self is a mutable reference of variant ImportFrom, and None otherwise.

source

pub fn expect_import_from_stmt(self) -> StmtImportFrom<R>
where Self: Debug,

Unwraps the value, yielding the content of ImportFrom.

§Panics

Panics if the value is not ImportFrom, with a panic message including the content of self.

source

pub fn import_from_stmt(self) -> Option<StmtImportFrom<R>>

Returns Some if self is of variant ImportFrom, and None otherwise.

source

pub const fn is_global_stmt(&self) -> bool

Returns true if self is of variant Global.

source

pub fn as_global_stmt(&self) -> Option<&StmtGlobal<R>>

Returns Some if self is a reference of variant Global, and None otherwise.

source

pub fn as_mut_global_stmt(&mut self) -> Option<&mut StmtGlobal<R>>

Returns Some if self is a mutable reference of variant Global, and None otherwise.

source

pub fn expect_global_stmt(self) -> StmtGlobal<R>
where Self: Debug,

Unwraps the value, yielding the content of Global.

§Panics

Panics if the value is not Global, with a panic message including the content of self.

source

pub fn global_stmt(self) -> Option<StmtGlobal<R>>

Returns Some if self is of variant Global, and None otherwise.

source

pub const fn is_nonlocal_stmt(&self) -> bool

Returns true if self is of variant Nonlocal.

source

pub fn as_nonlocal_stmt(&self) -> Option<&StmtNonlocal<R>>

Returns Some if self is a reference of variant Nonlocal, and None otherwise.

source

pub fn as_mut_nonlocal_stmt(&mut self) -> Option<&mut StmtNonlocal<R>>

Returns Some if self is a mutable reference of variant Nonlocal, and None otherwise.

source

pub fn expect_nonlocal_stmt(self) -> StmtNonlocal<R>
where Self: Debug,

Unwraps the value, yielding the content of Nonlocal.

§Panics

Panics if the value is not Nonlocal, with a panic message including the content of self.

source

pub fn nonlocal_stmt(self) -> Option<StmtNonlocal<R>>

Returns Some if self is of variant Nonlocal, and None otherwise.

source

pub const fn is_expr_stmt(&self) -> bool

Returns true if self is of variant Expr.

source

pub fn as_expr_stmt(&self) -> Option<&StmtExpr<R>>

Returns Some if self is a reference of variant Expr, and None otherwise.

source

pub fn as_mut_expr_stmt(&mut self) -> Option<&mut StmtExpr<R>>

Returns Some if self is a mutable reference of variant Expr, and None otherwise.

source

pub fn expect_expr_stmt(self) -> StmtExpr<R>
where Self: Debug,

Unwraps the value, yielding the content of Expr.

§Panics

Panics if the value is not Expr, with a panic message including the content of self.

source

pub fn expr_stmt(self) -> Option<StmtExpr<R>>

Returns Some if self is of variant Expr, and None otherwise.

source

pub const fn is_pass_stmt(&self) -> bool

Returns true if self is of variant Pass.

source

pub fn as_pass_stmt(&self) -> Option<&StmtPass<R>>

Returns Some if self is a reference of variant Pass, and None otherwise.

source

pub fn as_mut_pass_stmt(&mut self) -> Option<&mut StmtPass<R>>

Returns Some if self is a mutable reference of variant Pass, and None otherwise.

source

pub fn expect_pass_stmt(self) -> StmtPass<R>
where Self: Debug,

Unwraps the value, yielding the content of Pass.

§Panics

Panics if the value is not Pass, with a panic message including the content of self.

source

pub fn pass_stmt(self) -> Option<StmtPass<R>>

Returns Some if self is of variant Pass, and None otherwise.

source

pub const fn is_break_stmt(&self) -> bool

Returns true if self is of variant Break.

source

pub fn as_break_stmt(&self) -> Option<&StmtBreak<R>>

Returns Some if self is a reference of variant Break, and None otherwise.

source

pub fn as_mut_break_stmt(&mut self) -> Option<&mut StmtBreak<R>>

Returns Some if self is a mutable reference of variant Break, and None otherwise.

source

pub fn expect_break_stmt(self) -> StmtBreak<R>
where Self: Debug,

Unwraps the value, yielding the content of Break.

§Panics

Panics if the value is not Break, with a panic message including the content of self.

source

pub fn break_stmt(self) -> Option<StmtBreak<R>>

Returns Some if self is of variant Break, and None otherwise.

source

pub const fn is_continue_stmt(&self) -> bool

Returns true if self is of variant Continue.

source

pub fn as_continue_stmt(&self) -> Option<&StmtContinue<R>>

Returns Some if self is a reference of variant Continue, and None otherwise.

source

pub fn as_mut_continue_stmt(&mut self) -> Option<&mut StmtContinue<R>>

Returns Some if self is a mutable reference of variant Continue, and None otherwise.

source

pub fn expect_continue_stmt(self) -> StmtContinue<R>
where Self: Debug,

Unwraps the value, yielding the content of Continue.

§Panics

Panics if the value is not Continue, with a panic message including the content of self.

source

pub fn continue_stmt(self) -> Option<StmtContinue<R>>

Returns Some if self is of variant Continue, and None otherwise.

Trait Implementations§

source§

impl<R: Clone> Clone for Stmt<R>

source§

fn clone(&self) -> Stmt<R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<R: Debug> Debug for Stmt<R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, U> Foldable<T, U> for Stmt<T>

§

type Mapped = Stmt<U>

source§

fn fold<F: Fold<T, TargetU = U> + ?Sized>( self, folder: &mut F ) -> Result<Self::Mapped, F::Error>

source§

impl<R> From<Stmt<R>> for Ast<R>

source§

fn from(node: Stmt<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtAnnAssign<R>> for Stmt<R>

source§

fn from(payload: StmtAnnAssign<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtAssert<R>> for Stmt<R>

source§

fn from(payload: StmtAssert<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtAssign<R>> for Stmt<R>

source§

fn from(payload: StmtAssign<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtAsyncFor<R>> for Stmt<R>

source§

fn from(payload: StmtAsyncFor<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtAsyncFunctionDef<R>> for Stmt<R>

source§

fn from(payload: StmtAsyncFunctionDef<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtAsyncWith<R>> for Stmt<R>

source§

fn from(payload: StmtAsyncWith<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtAugAssign<R>> for Stmt<R>

source§

fn from(payload: StmtAugAssign<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtBreak<R>> for Stmt<R>

source§

fn from(payload: StmtBreak<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtClassDef<R>> for Stmt<R>

source§

fn from(payload: StmtClassDef<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtContinue<R>> for Stmt<R>

source§

fn from(payload: StmtContinue<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtDelete<R>> for Stmt<R>

source§

fn from(payload: StmtDelete<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtExpr<R>> for Stmt<R>

source§

fn from(payload: StmtExpr<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtFor<R>> for Stmt<R>

source§

fn from(payload: StmtFor<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtFunctionDef<R>> for Stmt<R>

source§

fn from(payload: StmtFunctionDef<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtGlobal<R>> for Stmt<R>

source§

fn from(payload: StmtGlobal<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtIf<R>> for Stmt<R>

source§

fn from(payload: StmtIf<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtImport<R>> for Stmt<R>

source§

fn from(payload: StmtImport<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtImportFrom<R>> for Stmt<R>

source§

fn from(payload: StmtImportFrom<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtMatch<R>> for Stmt<R>

source§

fn from(payload: StmtMatch<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtNonlocal<R>> for Stmt<R>

source§

fn from(payload: StmtNonlocal<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtPass<R>> for Stmt<R>

source§

fn from(payload: StmtPass<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtRaise<R>> for Stmt<R>

source§

fn from(payload: StmtRaise<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtReturn<R>> for Stmt<R>

source§

fn from(payload: StmtReturn<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtTry<R>> for Stmt<R>

source§

fn from(payload: StmtTry<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtTryStar<R>> for Stmt<R>

source§

fn from(payload: StmtTryStar<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtTypeAlias<R>> for Stmt<R>

source§

fn from(payload: StmtTypeAlias<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtWhile<R>> for Stmt<R>

source§

fn from(payload: StmtWhile<R>) -> Self

Converts to this type from the input type.
source§

impl<R> From<StmtWith<R>> for Stmt<R>

source§

fn from(payload: StmtWith<R>) -> Self

Converts to this type from the input type.
source§

impl<R> Node for Stmt<R>

source§

const NAME: &'static str = "stmt"

source§

const FIELD_NAMES: &'static [&'static str] = _

source§

impl<R: PartialEq> PartialEq for Stmt<R>

source§

fn eq(&self, other: &Stmt<R>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Ranged for Stmt

§

fn range(&self) -> TextRange

source§

fn start(&self) -> TextSize

source§

fn end(&self) -> TextSize

source§

impl<R> StructuralPartialEq for Stmt<R>

Auto Trait Implementations§

§

impl<R> Freeze for Stmt<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for Stmt<R>
where R: RefUnwindSafe,

§

impl<R> Send for Stmt<R>
where R: Send,

§

impl<R> Sync for Stmt<R>
where R: Sync,

§

impl<R> Unpin for Stmt<R>
where R: Unpin,

§

impl<R> UnwindSafe for Stmt<R>
where R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

source§

fn exact_from(value: T) -> U

source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

source§

fn exact_into(self) -> U

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

source§

impl<T> ToDebugString for T
where T: Debug,

source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

source§

fn wrapping_into(self) -> U