Skip to main content

Expr

Enum 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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. In debug builds the panic message includes 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 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 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>

Source§

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

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

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

Inequality operator !=. Read more
§

impl Ranged for Expr

§

fn range(&self) -> TextRange

Source§

fn start(&self) -> TextSize

Source§

fn end(&self) -> TextSize

Source§

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

Auto Trait Implementations§

§

impl<R> Freeze for Expr<R>

§

impl<R> RefUnwindSafe for Expr<R>

§

impl<R> Send for Expr<R>

§

impl<R> Sync for Expr<R>

§

impl<R> Unpin for Expr<R>

§

impl<R> UnsafeUnpin for Expr<R>

§

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