Enum rustpython_ast::Ast

source ·
pub enum Ast<R = TextRange> {
Show 19 variants Mod(Mod<R>), Stmt(Stmt<R>), Expr(Expr<R>), ExprContext(ExprContext), BoolOp(BoolOp), Operator(Operator), UnaryOp(UnaryOp), CmpOp(CmpOp), Comprehension(Comprehension<R>), ExceptHandler(ExceptHandler<R>), Arguments(Arguments<R>), Arg(Arg<R>), Keyword(Keyword<R>), Alias(Alias<R>), WithItem(WithItem<R>), MatchCase(MatchCase<R>), Pattern(Pattern<R>), TypeIgnore(TypeIgnore<R>), TypeParam(TypeParam<R>),
}

Variants§

§

Mod(Mod<R>)

§

Stmt(Stmt<R>)

§

Expr(Expr<R>)

§

ExprContext(ExprContext)

§

BoolOp(BoolOp)

§

Operator(Operator)

§

UnaryOp(UnaryOp)

§

CmpOp(CmpOp)

§

Comprehension(Comprehension<R>)

§

ExceptHandler(ExceptHandler<R>)

§

Arguments(Arguments<R>)

§

Arg(Arg<R>)

§

Keyword(Keyword<R>)

§

Alias(Alias<R>)

§

WithItem(WithItem<R>)

§

MatchCase(MatchCase<R>)

§

Pattern(Pattern<R>)

§

TypeIgnore(TypeIgnore<R>)

§

TypeParam(TypeParam<R>)

Implementations§

source§

impl<R> Ast<R>

source

pub const fn is_module(&self) -> bool

Returns true if self is of variant Mod.

source

pub fn as_module(&self) -> Option<&Mod<R>>

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

source

pub fn as_mut_module(&mut self) -> Option<&mut Mod<R>>

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

source

pub fn expect_module(self) -> Mod<R>
where Self: Debug,

Unwraps the value, yielding the content of Mod.

§Panics

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

source

pub fn module(self) -> Option<Mod<R>>

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

source

pub const fn is_stmt(&self) -> bool

Returns true if self is of variant Stmt.

source

pub fn as_stmt(&self) -> Option<&Stmt<R>>

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

source

pub fn as_mut_stmt(&mut self) -> Option<&mut Stmt<R>>

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

source

pub fn expect_stmt(self) -> Stmt<R>
where Self: Debug,

Unwraps the value, yielding the content of Stmt.

§Panics

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

source

pub fn stmt(self) -> Option<Stmt<R>>

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

source

pub const fn is_expr(&self) -> bool

Returns true if self is of variant Expr.

source

pub fn as_expr(&self) -> Option<&Expr<R>>

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

source

pub fn as_mut_expr(&mut self) -> Option<&mut Expr<R>>

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

source

pub fn expect_expr(self) -> Expr<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(self) -> Option<Expr<R>>

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

source

pub const fn is_expr_context(&self) -> bool

Returns true if self is of variant ExprContext.

source

pub fn as_expr_context(&self) -> Option<&ExprContext>

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

source

pub fn as_mut_expr_context(&mut self) -> Option<&mut ExprContext>

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

source

pub fn expect_expr_context(self) -> ExprContext
where Self: Debug,

Unwraps the value, yielding the content of ExprContext.

§Panics

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

source

pub fn expr_context(self) -> Option<ExprContext>

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

source

pub const fn is_bool_op(&self) -> bool

Returns true if self is of variant BoolOp.

source

pub fn as_bool_op(&self) -> Option<&BoolOp>

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

source

pub fn as_mut_bool_op(&mut self) -> Option<&mut BoolOp>

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

source

pub fn expect_bool_op(self) -> BoolOp
where Self: Debug,

Unwraps the value, yielding the content of BoolOp.

§Panics

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

source

pub fn bool_op(self) -> Option<BoolOp>

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

source

pub const fn is_operator(&self) -> bool

Returns true if self is of variant Operator.

source

pub fn as_operator(&self) -> Option<&Operator>

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

source

pub fn as_mut_operator(&mut self) -> Option<&mut Operator>

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

source

pub fn expect_operator(self) -> Operator
where Self: Debug,

Unwraps the value, yielding the content of Operator.

§Panics

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

source

pub fn operator(self) -> Option<Operator>

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

source

pub const fn is_unary_op(&self) -> bool

Returns true if self is of variant UnaryOp.

source

pub fn as_unary_op(&self) -> Option<&UnaryOp>

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

source

pub fn as_mut_unary_op(&mut self) -> Option<&mut UnaryOp>

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

source

pub fn expect_unary_op(self) -> UnaryOp
where Self: Debug,

Unwraps the value, yielding the content of UnaryOp.

§Panics

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

source

pub fn unary_op(self) -> Option<UnaryOp>

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

source

pub const fn is_cmp_op(&self) -> bool

Returns true if self is of variant CmpOp.

source

pub fn as_cmp_op(&self) -> Option<&CmpOp>

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

source

pub fn as_mut_cmp_op(&mut self) -> Option<&mut CmpOp>

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

source

pub fn expect_cmp_op(self) -> CmpOp
where Self: Debug,

Unwraps the value, yielding the content of CmpOp.

§Panics

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

source

pub fn cmp_op(self) -> Option<CmpOp>

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

source

pub const fn is_comprehension(&self) -> bool

Returns true if self is of variant Comprehension.

source

pub fn as_comprehension(&self) -> Option<&Comprehension<R>>

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

source

pub fn as_mut_comprehension(&mut self) -> Option<&mut Comprehension<R>>

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

source

pub fn expect_comprehension(self) -> Comprehension<R>
where Self: Debug,

Unwraps the value, yielding the content of Comprehension.

§Panics

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

source

pub fn comprehension(self) -> Option<Comprehension<R>>

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

source

pub const fn is_except_handler(&self) -> bool

Returns true if self is of variant ExceptHandler.

source

pub fn as_except_handler(&self) -> Option<&ExceptHandler<R>>

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

source

pub fn as_mut_except_handler(&mut self) -> Option<&mut ExceptHandler<R>>

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

source

pub fn expect_except_handler(self) -> ExceptHandler<R>
where Self: Debug,

Unwraps the value, yielding the content of ExceptHandler.

§Panics

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

source

pub fn except_handler(self) -> Option<ExceptHandler<R>>

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

source

pub const fn is_arguments(&self) -> bool

Returns true if self is of variant Arguments.

source

pub fn as_arguments(&self) -> Option<&Arguments<R>>

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

source

pub fn as_mut_arguments(&mut self) -> Option<&mut Arguments<R>>

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

source

pub fn expect_arguments(self) -> Arguments<R>
where Self: Debug,

Unwraps the value, yielding the content of Arguments.

§Panics

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

source

pub fn arguments(self) -> Option<Arguments<R>>

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

source

pub const fn is_arg(&self) -> bool

Returns true if self is of variant Arg.

source

pub fn as_arg(&self) -> Option<&Arg<R>>

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

source

pub fn as_mut_arg(&mut self) -> Option<&mut Arg<R>>

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

source

pub fn expect_arg(self) -> Arg<R>
where Self: Debug,

Unwraps the value, yielding the content of Arg.

§Panics

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

source

pub fn arg(self) -> Option<Arg<R>>

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

source

pub const fn is_keyword(&self) -> bool

Returns true if self is of variant Keyword.

source

pub fn as_keyword(&self) -> Option<&Keyword<R>>

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

source

pub fn as_mut_keyword(&mut self) -> Option<&mut Keyword<R>>

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

source

pub fn expect_keyword(self) -> Keyword<R>
where Self: Debug,

Unwraps the value, yielding the content of Keyword.

§Panics

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

source

pub fn keyword(self) -> Option<Keyword<R>>

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

source

pub const fn is_alias(&self) -> bool

Returns true if self is of variant Alias.

source

pub fn as_alias(&self) -> Option<&Alias<R>>

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

source

pub fn as_mut_alias(&mut self) -> Option<&mut Alias<R>>

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

source

pub fn expect_alias(self) -> Alias<R>
where Self: Debug,

Unwraps the value, yielding the content of Alias.

§Panics

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

source

pub fn alias(self) -> Option<Alias<R>>

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

source

pub const fn is_with_item(&self) -> bool

Returns true if self is of variant WithItem.

source

pub fn as_with_item(&self) -> Option<&WithItem<R>>

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

source

pub fn as_mut_with_item(&mut self) -> Option<&mut WithItem<R>>

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

source

pub fn expect_with_item(self) -> WithItem<R>
where Self: Debug,

Unwraps the value, yielding the content of WithItem.

§Panics

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

source

pub fn with_item(self) -> Option<WithItem<R>>

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

source

pub const fn is_match_case(&self) -> bool

Returns true if self is of variant MatchCase.

source

pub fn as_match_case(&self) -> Option<&MatchCase<R>>

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

source

pub fn as_mut_match_case(&mut self) -> Option<&mut MatchCase<R>>

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

source

pub fn expect_match_case(self) -> MatchCase<R>
where Self: Debug,

Unwraps the value, yielding the content of MatchCase.

§Panics

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

source

pub fn match_case(self) -> Option<MatchCase<R>>

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

source

pub const fn is_pattern(&self) -> bool

Returns true if self is of variant Pattern.

source

pub fn as_pattern(&self) -> Option<&Pattern<R>>

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

source

pub fn as_mut_pattern(&mut self) -> Option<&mut Pattern<R>>

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

source

pub fn expect_pattern(self) -> Pattern<R>
where Self: Debug,

Unwraps the value, yielding the content of Pattern.

§Panics

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

source

pub fn pattern(self) -> Option<Pattern<R>>

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

source

pub const fn is_type_ignore(&self) -> bool

Returns true if self is of variant TypeIgnore.

source

pub fn as_type_ignore(&self) -> Option<&TypeIgnore<R>>

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

source

pub fn as_mut_type_ignore(&mut self) -> Option<&mut TypeIgnore<R>>

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

source

pub fn expect_type_ignore(self) -> TypeIgnore<R>
where Self: Debug,

Unwraps the value, yielding the content of TypeIgnore.

§Panics

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

source

pub fn type_ignore(self) -> Option<TypeIgnore<R>>

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

source

pub const fn is_type_param(&self) -> bool

Returns true if self is of variant TypeParam.

source

pub fn as_type_param(&self) -> Option<&TypeParam<R>>

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

source

pub fn as_mut_type_param(&mut self) -> Option<&mut TypeParam<R>>

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

source

pub fn expect_type_param(self) -> TypeParam<R>
where Self: Debug,

Unwraps the value, yielding the content of TypeParam.

§Panics

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

source

pub fn type_param(self) -> Option<TypeParam<R>>

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

Trait Implementations§

source§

impl<R: Clone> Clone for Ast<R>

source§

fn clone(&self) -> Ast<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 Ast<R>

source§

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

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

impl<R> From<Alias<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<Arg<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<Arguments<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<BoolOp> for Ast<R>

source§

fn from(node: BoolOp) -> Self

Converts to this type from the input type.
source§

impl<R> From<BoolOpAnd> for Ast<R>

source§

fn from(_: BoolOpAnd) -> Self

Converts to this type from the input type.
source§

impl<R> From<BoolOpOr> for Ast<R>

source§

fn from(_: BoolOpOr) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOp> for Ast<R>

source§

fn from(node: CmpOp) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpEq> for Ast<R>

source§

fn from(_: CmpOpEq) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpGt> for Ast<R>

source§

fn from(_: CmpOpGt) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpGtE> for Ast<R>

source§

fn from(_: CmpOpGtE) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpIn> for Ast<R>

source§

fn from(_: CmpOpIn) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpIs> for Ast<R>

source§

fn from(_: CmpOpIs) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpIsNot> for Ast<R>

source§

fn from(_: CmpOpIsNot) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpLt> for Ast<R>

source§

fn from(_: CmpOpLt) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpLtE> for Ast<R>

source§

fn from(_: CmpOpLtE) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpNotEq> for Ast<R>

source§

fn from(_: CmpOpNotEq) -> Self

Converts to this type from the input type.
source§

impl<R> From<CmpOpNotIn> for Ast<R>

source§

fn from(_: CmpOpNotIn) -> Self

Converts to this type from the input type.
source§

impl<R> From<Comprehension<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExceptHandler<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExceptHandlerExceptHandler<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<Expr<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprAttribute<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprAwait<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprBinOp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprBoolOp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprCall<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprCompare<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprConstant<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprContext> for Ast<R>

source§

fn from(node: ExprContext) -> Self

Converts to this type from the input type.
source§

impl<R> From<ExprContextDel> for Ast<R>

source§

fn from(_: ExprContextDel) -> Self

Converts to this type from the input type.
source§

impl<R> From<ExprContextLoad> for Ast<R>

source§

fn from(_: ExprContextLoad) -> Self

Converts to this type from the input type.
source§

impl<R> From<ExprContextStore> for Ast<R>

source§

fn from(_: ExprContextStore) -> Self

Converts to this type from the input type.
source§

impl<R> From<ExprDict<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprDictComp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprFormattedValue<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprGeneratorExp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprIfExp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprJoinedStr<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprLambda<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprList<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprListComp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprName<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprNamedExpr<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSet<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSetComp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSlice<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprStarred<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSubscript<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprTuple<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprUnaryOp<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprYield<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprYieldFrom<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<Keyword<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<MatchCase<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<Mod<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ModExpression<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ModFunctionType<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ModInteractive<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ModModule<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<Operator> for Ast<R>

source§

fn from(node: Operator) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorAdd> for Ast<R>

source§

fn from(_: OperatorAdd) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorBitAnd> for Ast<R>

source§

fn from(_: OperatorBitAnd) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorBitOr> for Ast<R>

source§

fn from(_: OperatorBitOr) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorBitXor> for Ast<R>

source§

fn from(_: OperatorBitXor) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorDiv> for Ast<R>

source§

fn from(_: OperatorDiv) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorFloorDiv> for Ast<R>

source§

fn from(_: OperatorFloorDiv) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorLShift> for Ast<R>

source§

fn from(_: OperatorLShift) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorMatMult> for Ast<R>

source§

fn from(_: OperatorMatMult) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorMod> for Ast<R>

source§

fn from(_: OperatorMod) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorMult> for Ast<R>

source§

fn from(_: OperatorMult) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorPow> for Ast<R>

source§

fn from(_: OperatorPow) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorRShift> for Ast<R>

source§

fn from(_: OperatorRShift) -> Self

Converts to this type from the input type.
source§

impl<R> From<OperatorSub> for Ast<R>

source§

fn from(_: OperatorSub) -> Self

Converts to this type from the input type.
source§

impl<R> From<Pattern<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchAs<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchClass<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchMapping<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchOr<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchSequence<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchSingleton<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchStar<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<PatternMatchValue<R>> for Ast<R>

source§

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

Converts to this type from the input type.
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 Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtAssert<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtAssign<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtAsyncFor<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtAsyncFunctionDef<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtAsyncWith<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtAugAssign<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtBreak<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtClassDef<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtContinue<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtDelete<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtExpr<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtFor<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtFunctionDef<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtGlobal<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtIf<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtImport<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtImportFrom<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtMatch<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtNonlocal<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtPass<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtRaise<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtReturn<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtTry<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtTryStar<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtTypeAlias<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtWhile<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<StmtWith<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<TypeIgnore<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<TypeIgnoreTypeIgnore<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<TypeParam<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<TypeParamParamSpec<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<TypeParamTypeVar<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<TypeParamTypeVarTuple<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<UnaryOp> for Ast<R>

source§

fn from(node: UnaryOp) -> Self

Converts to this type from the input type.
source§

impl<R> From<UnaryOpInvert> for Ast<R>

source§

fn from(_: UnaryOpInvert) -> Self

Converts to this type from the input type.
source§

impl<R> From<UnaryOpNot> for Ast<R>

source§

fn from(_: UnaryOpNot) -> Self

Converts to this type from the input type.
source§

impl<R> From<UnaryOpUAdd> for Ast<R>

source§

fn from(_: UnaryOpUAdd) -> Self

Converts to this type from the input type.
source§

impl<R> From<UnaryOpUSub> for Ast<R>

source§

fn from(_: UnaryOpUSub) -> Self

Converts to this type from the input type.
source§

impl<R> From<WithItem<R>> for Ast<R>

source§

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

Converts to this type from the input type.
source§

impl<R> Node for Ast<R>

source§

const NAME: &'static str = "AST"

source§

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

source§

impl<R: PartialEq> PartialEq for Ast<R>

source§

fn eq(&self, other: &Ast<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.
source§

impl<R> StructuralPartialEq for Ast<R>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<R> UnwindSafe for Ast<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