Skip to main content

Stmt

Enum 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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 duplicate of the value. Read more
1.0.0 (const: unstable) · 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>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
§

impl Ranged for Stmt

§

fn range(&self) -> TextRange

Source§

fn start(&self) -> TextSize

Source§

fn end(&self) -> TextSize

Source§

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

Auto Trait Implementations§

§

impl<R> Freeze for Stmt<R>

§

impl<R> RefUnwindSafe for Stmt<R>

§

impl<R> Send for Stmt<R>

§

impl<R> Sync for Stmt<R>

§

impl<R> Unpin for Stmt<R>

§

impl<R> UnsafeUnpin for Stmt<R>

§

impl<R> UnwindSafe for Stmt<R>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

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

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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,

Source§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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