Enum rustpython_ast::Expr

source ·
pub enum Expr<R = TextRange> {
Show 27 variants BoolOp(ExprBoolOp<R>), NamedExpr(ExprNamedExpr<R>), BinOp(ExprBinOp<R>), UnaryOp(ExprUnaryOp<R>), Lambda(ExprLambda<R>), IfExp(ExprIfExp<R>), Dict(ExprDict<R>), Set(ExprSet<R>), ListComp(ExprListComp<R>), SetComp(ExprSetComp<R>), DictComp(ExprDictComp<R>), GeneratorExp(ExprGeneratorExp<R>), Await(ExprAwait<R>), Yield(ExprYield<R>), YieldFrom(ExprYieldFrom<R>), Compare(ExprCompare<R>), Call(ExprCall<R>), FormattedValue(ExprFormattedValue<R>), JoinedStr(ExprJoinedStr<R>), Constant(ExprConstant<R>), Attribute(ExprAttribute<R>), Subscript(ExprSubscript<R>), Starred(ExprStarred<R>), Name(ExprName<R>), List(ExprList<R>), Tuple(ExprTuple<R>), Slice(ExprSlice<R>),
}
Expand description

See also expr

Variants§

§

BoolOp(ExprBoolOp<R>)

§

NamedExpr(ExprNamedExpr<R>)

§

BinOp(ExprBinOp<R>)

§

UnaryOp(ExprUnaryOp<R>)

§

Lambda(ExprLambda<R>)

§

IfExp(ExprIfExp<R>)

§

Dict(ExprDict<R>)

§

Set(ExprSet<R>)

§

ListComp(ExprListComp<R>)

§

SetComp(ExprSetComp<R>)

§

DictComp(ExprDictComp<R>)

§

GeneratorExp(ExprGeneratorExp<R>)

§

Await(ExprAwait<R>)

§

Yield(ExprYield<R>)

§

YieldFrom(ExprYieldFrom<R>)

§

Compare(ExprCompare<R>)

§

Call(ExprCall<R>)

§

FormattedValue(ExprFormattedValue<R>)

§

JoinedStr(ExprJoinedStr<R>)

§

Constant(ExprConstant<R>)

§

Attribute(ExprAttribute<R>)

§

Subscript(ExprSubscript<R>)

§

Starred(ExprStarred<R>)

§

Name(ExprName<R>)

§

List(ExprList<R>)

§

Tuple(ExprTuple<R>)

§

Slice(ExprSlice<R>)

Implementations§

source§

impl<R> Expr<R>

source

pub const fn is_bool_op_expr(&self) -> bool

Returns true if self is of variant BoolOp.

source

pub fn as_bool_op_expr(&self) -> Option<&ExprBoolOp<R>>

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

source

pub fn as_mut_bool_op_expr(&mut self) -> Option<&mut ExprBoolOp<R>>

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

source

pub fn expect_bool_op_expr(self) -> ExprBoolOp<R>
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_expr(self) -> Option<ExprBoolOp<R>>

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

source

pub const fn is_named_expr_expr(&self) -> bool

Returns true if self is of variant NamedExpr.

source

pub fn as_named_expr_expr(&self) -> Option<&ExprNamedExpr<R>>

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

source

pub fn as_mut_named_expr_expr(&mut self) -> Option<&mut ExprNamedExpr<R>>

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

source

pub fn expect_named_expr_expr(self) -> ExprNamedExpr<R>
where Self: Debug,

Unwraps the value, yielding the content of NamedExpr.

§Panics

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

source

pub fn named_expr_expr(self) -> Option<ExprNamedExpr<R>>

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

source

pub const fn is_bin_op_expr(&self) -> bool

Returns true if self is of variant BinOp.

source

pub fn as_bin_op_expr(&self) -> Option<&ExprBinOp<R>>

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

source

pub fn as_mut_bin_op_expr(&mut self) -> Option<&mut ExprBinOp<R>>

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

source

pub fn expect_bin_op_expr(self) -> ExprBinOp<R>
where Self: Debug,

Unwraps the value, yielding the content of BinOp.

§Panics

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

source

pub fn bin_op_expr(self) -> Option<ExprBinOp<R>>

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

source

pub const fn is_unary_op_expr(&self) -> bool

Returns true if self is of variant UnaryOp.

source

pub fn as_unary_op_expr(&self) -> Option<&ExprUnaryOp<R>>

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

source

pub fn as_mut_unary_op_expr(&mut self) -> Option<&mut ExprUnaryOp<R>>

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

source

pub fn expect_unary_op_expr(self) -> ExprUnaryOp<R>
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_expr(self) -> Option<ExprUnaryOp<R>>

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

source

pub const fn is_lambda_expr(&self) -> bool

Returns true if self is of variant Lambda.

source

pub fn as_lambda_expr(&self) -> Option<&ExprLambda<R>>

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

source

pub fn as_mut_lambda_expr(&mut self) -> Option<&mut ExprLambda<R>>

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

source

pub fn expect_lambda_expr(self) -> ExprLambda<R>
where Self: Debug,

Unwraps the value, yielding the content of Lambda.

§Panics

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

source

pub fn lambda_expr(self) -> Option<ExprLambda<R>>

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

source

pub const fn is_if_exp_expr(&self) -> bool

Returns true if self is of variant IfExp.

source

pub fn as_if_exp_expr(&self) -> Option<&ExprIfExp<R>>

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

source

pub fn as_mut_if_exp_expr(&mut self) -> Option<&mut ExprIfExp<R>>

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

source

pub fn expect_if_exp_expr(self) -> ExprIfExp<R>
where Self: Debug,

Unwraps the value, yielding the content of IfExp.

§Panics

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

source

pub fn if_exp_expr(self) -> Option<ExprIfExp<R>>

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

source

pub const fn is_dict_expr(&self) -> bool

Returns true if self is of variant Dict.

source

pub fn as_dict_expr(&self) -> Option<&ExprDict<R>>

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

source

pub fn as_mut_dict_expr(&mut self) -> Option<&mut ExprDict<R>>

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

source

pub fn expect_dict_expr(self) -> ExprDict<R>
where Self: Debug,

Unwraps the value, yielding the content of Dict.

§Panics

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

source

pub fn dict_expr(self) -> Option<ExprDict<R>>

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

source

pub const fn is_set_expr(&self) -> bool

Returns true if self is of variant Set.

source

pub fn as_set_expr(&self) -> Option<&ExprSet<R>>

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

source

pub fn as_mut_set_expr(&mut self) -> Option<&mut ExprSet<R>>

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

source

pub fn expect_set_expr(self) -> ExprSet<R>
where Self: Debug,

Unwraps the value, yielding the content of Set.

§Panics

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

source

pub fn set_expr(self) -> Option<ExprSet<R>>

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

source

pub const fn is_list_comp_expr(&self) -> bool

Returns true if self is of variant ListComp.

source

pub fn as_list_comp_expr(&self) -> Option<&ExprListComp<R>>

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

source

pub fn as_mut_list_comp_expr(&mut self) -> Option<&mut ExprListComp<R>>

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

source

pub fn expect_list_comp_expr(self) -> ExprListComp<R>
where Self: Debug,

Unwraps the value, yielding the content of ListComp.

§Panics

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

source

pub fn list_comp_expr(self) -> Option<ExprListComp<R>>

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

source

pub const fn is_set_comp_expr(&self) -> bool

Returns true if self is of variant SetComp.

source

pub fn as_set_comp_expr(&self) -> Option<&ExprSetComp<R>>

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

source

pub fn as_mut_set_comp_expr(&mut self) -> Option<&mut ExprSetComp<R>>

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

source

pub fn expect_set_comp_expr(self) -> ExprSetComp<R>
where Self: Debug,

Unwraps the value, yielding the content of SetComp.

§Panics

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

source

pub fn set_comp_expr(self) -> Option<ExprSetComp<R>>

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

source

pub const fn is_dict_comp_expr(&self) -> bool

Returns true if self is of variant DictComp.

source

pub fn as_dict_comp_expr(&self) -> Option<&ExprDictComp<R>>

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

source

pub fn as_mut_dict_comp_expr(&mut self) -> Option<&mut ExprDictComp<R>>

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

source

pub fn expect_dict_comp_expr(self) -> ExprDictComp<R>
where Self: Debug,

Unwraps the value, yielding the content of DictComp.

§Panics

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

source

pub fn dict_comp_expr(self) -> Option<ExprDictComp<R>>

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

source

pub const fn is_generator_exp_expr(&self) -> bool

Returns true if self is of variant GeneratorExp.

source

pub fn as_generator_exp_expr(&self) -> Option<&ExprGeneratorExp<R>>

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

source

pub fn as_mut_generator_exp_expr(&mut self) -> Option<&mut ExprGeneratorExp<R>>

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

source

pub fn expect_generator_exp_expr(self) -> ExprGeneratorExp<R>
where Self: Debug,

Unwraps the value, yielding the content of GeneratorExp.

§Panics

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

source

pub fn generator_exp_expr(self) -> Option<ExprGeneratorExp<R>>

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

source

pub const fn is_await_expr(&self) -> bool

Returns true if self is of variant Await.

source

pub fn as_await_expr(&self) -> Option<&ExprAwait<R>>

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

source

pub fn as_mut_await_expr(&mut self) -> Option<&mut ExprAwait<R>>

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

source

pub fn expect_await_expr(self) -> ExprAwait<R>
where Self: Debug,

Unwraps the value, yielding the content of Await.

§Panics

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

source

pub fn await_expr(self) -> Option<ExprAwait<R>>

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

source

pub const fn is_yield_expr(&self) -> bool

Returns true if self is of variant Yield.

source

pub fn as_yield_expr(&self) -> Option<&ExprYield<R>>

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

source

pub fn as_mut_yield_expr(&mut self) -> Option<&mut ExprYield<R>>

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

source

pub fn expect_yield_expr(self) -> ExprYield<R>
where Self: Debug,

Unwraps the value, yielding the content of Yield.

§Panics

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

source

pub fn yield_expr(self) -> Option<ExprYield<R>>

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

source

pub const fn is_yield_from_expr(&self) -> bool

Returns true if self is of variant YieldFrom.

source

pub fn as_yield_from_expr(&self) -> Option<&ExprYieldFrom<R>>

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

source

pub fn as_mut_yield_from_expr(&mut self) -> Option<&mut ExprYieldFrom<R>>

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

source

pub fn expect_yield_from_expr(self) -> ExprYieldFrom<R>
where Self: Debug,

Unwraps the value, yielding the content of YieldFrom.

§Panics

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

source

pub fn yield_from_expr(self) -> Option<ExprYieldFrom<R>>

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

source

pub const fn is_compare_expr(&self) -> bool

Returns true if self is of variant Compare.

source

pub fn as_compare_expr(&self) -> Option<&ExprCompare<R>>

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

source

pub fn as_mut_compare_expr(&mut self) -> Option<&mut ExprCompare<R>>

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

source

pub fn expect_compare_expr(self) -> ExprCompare<R>
where Self: Debug,

Unwraps the value, yielding the content of Compare.

§Panics

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

source

pub fn compare_expr(self) -> Option<ExprCompare<R>>

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

source

pub const fn is_call_expr(&self) -> bool

Returns true if self is of variant Call.

source

pub fn as_call_expr(&self) -> Option<&ExprCall<R>>

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

source

pub fn as_mut_call_expr(&mut self) -> Option<&mut ExprCall<R>>

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

source

pub fn expect_call_expr(self) -> ExprCall<R>
where Self: Debug,

Unwraps the value, yielding the content of Call.

§Panics

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

source

pub fn call_expr(self) -> Option<ExprCall<R>>

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

source

pub const fn is_formatted_value_expr(&self) -> bool

Returns true if self is of variant FormattedValue.

source

pub fn as_formatted_value_expr(&self) -> Option<&ExprFormattedValue<R>>

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

source

pub fn as_mut_formatted_value_expr( &mut self ) -> Option<&mut ExprFormattedValue<R>>

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

source

pub fn expect_formatted_value_expr(self) -> ExprFormattedValue<R>
where Self: Debug,

Unwraps the value, yielding the content of FormattedValue.

§Panics

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

source

pub fn formatted_value_expr(self) -> Option<ExprFormattedValue<R>>

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

source

pub const fn is_joined_str_expr(&self) -> bool

Returns true if self is of variant JoinedStr.

source

pub fn as_joined_str_expr(&self) -> Option<&ExprJoinedStr<R>>

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

source

pub fn as_mut_joined_str_expr(&mut self) -> Option<&mut ExprJoinedStr<R>>

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

source

pub fn expect_joined_str_expr(self) -> ExprJoinedStr<R>
where Self: Debug,

Unwraps the value, yielding the content of JoinedStr.

§Panics

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

source

pub fn joined_str_expr(self) -> Option<ExprJoinedStr<R>>

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

source

pub const fn is_constant_expr(&self) -> bool

Returns true if self is of variant Constant.

source

pub fn as_constant_expr(&self) -> Option<&ExprConstant<R>>

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

source

pub fn as_mut_constant_expr(&mut self) -> Option<&mut ExprConstant<R>>

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

source

pub fn expect_constant_expr(self) -> ExprConstant<R>
where Self: Debug,

Unwraps the value, yielding the content of Constant.

§Panics

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

source

pub fn constant_expr(self) -> Option<ExprConstant<R>>

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

source

pub const fn is_attribute_expr(&self) -> bool

Returns true if self is of variant Attribute.

source

pub fn as_attribute_expr(&self) -> Option<&ExprAttribute<R>>

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

source

pub fn as_mut_attribute_expr(&mut self) -> Option<&mut ExprAttribute<R>>

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

source

pub fn expect_attribute_expr(self) -> ExprAttribute<R>
where Self: Debug,

Unwraps the value, yielding the content of Attribute.

§Panics

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

source

pub fn attribute_expr(self) -> Option<ExprAttribute<R>>

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

source

pub const fn is_subscript_expr(&self) -> bool

Returns true if self is of variant Subscript.

source

pub fn as_subscript_expr(&self) -> Option<&ExprSubscript<R>>

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

source

pub fn as_mut_subscript_expr(&mut self) -> Option<&mut ExprSubscript<R>>

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

source

pub fn expect_subscript_expr(self) -> ExprSubscript<R>
where Self: Debug,

Unwraps the value, yielding the content of Subscript.

§Panics

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

source

pub fn subscript_expr(self) -> Option<ExprSubscript<R>>

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

source

pub const fn is_starred_expr(&self) -> bool

Returns true if self is of variant Starred.

source

pub fn as_starred_expr(&self) -> Option<&ExprStarred<R>>

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

source

pub fn as_mut_starred_expr(&mut self) -> Option<&mut ExprStarred<R>>

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

source

pub fn expect_starred_expr(self) -> ExprStarred<R>
where Self: Debug,

Unwraps the value, yielding the content of Starred.

§Panics

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

source

pub fn starred_expr(self) -> Option<ExprStarred<R>>

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

source

pub const fn is_name_expr(&self) -> bool

Returns true if self is of variant Name.

source

pub fn as_name_expr(&self) -> Option<&ExprName<R>>

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

source

pub fn as_mut_name_expr(&mut self) -> Option<&mut ExprName<R>>

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

source

pub fn expect_name_expr(self) -> ExprName<R>
where Self: Debug,

Unwraps the value, yielding the content of Name.

§Panics

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

source

pub fn name_expr(self) -> Option<ExprName<R>>

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

source

pub const fn is_list_expr(&self) -> bool

Returns true if self is of variant List.

source

pub fn as_list_expr(&self) -> Option<&ExprList<R>>

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

source

pub fn as_mut_list_expr(&mut self) -> Option<&mut ExprList<R>>

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

source

pub fn expect_list_expr(self) -> ExprList<R>
where Self: Debug,

Unwraps the value, yielding the content of List.

§Panics

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

source

pub fn list_expr(self) -> Option<ExprList<R>>

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

source

pub const fn is_tuple_expr(&self) -> bool

Returns true if self is of variant Tuple.

source

pub fn as_tuple_expr(&self) -> Option<&ExprTuple<R>>

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

source

pub fn as_mut_tuple_expr(&mut self) -> Option<&mut ExprTuple<R>>

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

source

pub fn expect_tuple_expr(self) -> ExprTuple<R>
where Self: Debug,

Unwraps the value, yielding the content of Tuple.

§Panics

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

source

pub fn tuple_expr(self) -> Option<ExprTuple<R>>

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

source

pub const fn is_slice_expr(&self) -> bool

Returns true if self is of variant Slice.

source

pub fn as_slice_expr(&self) -> Option<&ExprSlice<R>>

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

source

pub fn as_mut_slice_expr(&mut self) -> Option<&mut ExprSlice<R>>

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

source

pub fn expect_slice_expr(self) -> ExprSlice<R>
where Self: Debug,

Unwraps the value, yielding the content of Slice.

§Panics

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

source

pub fn slice_expr(self) -> Option<ExprSlice<R>>

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

source§

impl<R> Expr<R>

source

pub fn python_name(&self) -> &'static str

Returns a short name for the node suitable for use in error messages.

Trait Implementations§

source§

impl<R: Clone> Clone for Expr<R>

source§

fn clone(&self) -> Expr<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 Expr<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 Expr<T>

§

type Mapped = Expr<U>

source§

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

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 Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprAwait<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprBinOp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprBoolOp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprCall<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprCompare<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprConstant<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprDict<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprDictComp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprFormattedValue<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprGeneratorExp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprIfExp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprJoinedStr<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprLambda<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprList<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprListComp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprName<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprNamedExpr<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSet<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSetComp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSlice<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprStarred<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprSubscript<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprTuple<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprUnaryOp<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprYield<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> From<ExprYieldFrom<R>> for Expr<R>

source§

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

Converts to this type from the input type.
source§

impl<R> Node for Expr<R>

source§

const NAME: &'static str = "expr"

source§

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

source§

impl<R: PartialEq> PartialEq for Expr<R>

source§

fn eq(&self, other: &Expr<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 Expr

§

fn range(&self) -> TextRange

source§

fn start(&self) -> TextSize

source§

fn end(&self) -> TextSize

source§

impl<R> StructuralPartialEq for Expr<R>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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