Skip to main content

ExprRef

Enum ExprRef 

Source
pub enum ExprRef<'a> {
Show 33 variants BoolOp(&'a ExprBoolOp), Named(&'a ExprNamed), BinOp(&'a ExprBinOp), UnaryOp(&'a ExprUnaryOp), Lambda(&'a ExprLambda), If(&'a ExprIf), Dict(&'a ExprDict), Set(&'a ExprSet), ListComp(&'a ExprListComp), SetComp(&'a ExprSetComp), DictComp(&'a ExprDictComp), Generator(&'a ExprGenerator), Await(&'a ExprAwait), Yield(&'a ExprYield), YieldFrom(&'a ExprYieldFrom), Compare(&'a ExprCompare), Call(&'a ExprCall), FString(&'a ExprFString), TString(&'a ExprTString), StringLiteral(&'a ExprStringLiteral), BytesLiteral(&'a ExprBytesLiteral), NumberLiteral(&'a ExprNumberLiteral), BooleanLiteral(&'a ExprBooleanLiteral), NoneLiteral(&'a ExprNoneLiteral), EllipsisLiteral(&'a ExprEllipsisLiteral), Attribute(&'a ExprAttribute), Subscript(&'a ExprSubscript), Starred(&'a ExprStarred), Name(&'a ExprName), List(&'a ExprList), Tuple(&'a ExprTuple), Slice(&'a ExprSlice), IpyEscapeCommand(&'a ExprIpyEscapeCommand),
}
Expand description

See also expr

Variants§

§

BoolOp(&'a ExprBoolOp)

§

Named(&'a ExprNamed)

§

BinOp(&'a ExprBinOp)

§

UnaryOp(&'a ExprUnaryOp)

§

Lambda(&'a ExprLambda)

§

If(&'a ExprIf)

§

Dict(&'a ExprDict)

§

Set(&'a ExprSet)

§

ListComp(&'a ExprListComp)

§

SetComp(&'a ExprSetComp)

§

DictComp(&'a ExprDictComp)

§

Generator(&'a ExprGenerator)

§

Await(&'a ExprAwait)

§

Yield(&'a ExprYield)

§

YieldFrom(&'a ExprYieldFrom)

§

Compare(&'a ExprCompare)

§

Call(&'a ExprCall)

§

FString(&'a ExprFString)

§

TString(&'a ExprTString)

§

StringLiteral(&'a ExprStringLiteral)

§

BytesLiteral(&'a ExprBytesLiteral)

§

NumberLiteral(&'a ExprNumberLiteral)

§

BooleanLiteral(&'a ExprBooleanLiteral)

§

NoneLiteral(&'a ExprNoneLiteral)

§

EllipsisLiteral(&'a ExprEllipsisLiteral)

§

Attribute(&'a ExprAttribute)

§

Subscript(&'a ExprSubscript)

§

Starred(&'a ExprStarred)

§

Name(&'a ExprName)

§

List(&'a ExprList)

§

Tuple(&'a ExprTuple)

§

Slice(&'a ExprSlice)

§

IpyEscapeCommand(&'a ExprIpyEscapeCommand)

Implementations§

Source§

impl<'a> ExprRef<'a>

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<&&'a ExprBoolOp>

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 &'a ExprBoolOp>

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

Source

pub fn expect_bool_op_expr(self) -> &'a ExprBoolOp
where ExprRef<'a>: 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<&'a ExprBoolOp>

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

Source

pub const fn is_named_expr(&self) -> bool

Returns true if self is of variant Named.

Source

pub fn as_named_expr(&self) -> Option<&&'a ExprNamed>

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

Source

pub fn as_mut_named_expr(&mut self) -> Option<&mut &'a ExprNamed>

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

Source

pub fn expect_named_expr(self) -> &'a ExprNamed
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of Named.

§Panics

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

Source

pub fn named_expr(self) -> Option<&'a ExprNamed>

Returns Some if self is of variant Named, 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<&&'a ExprBinOp>

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 &'a ExprBinOp>

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

Source

pub fn expect_bin_op_expr(self) -> &'a ExprBinOp
where ExprRef<'a>: 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<&'a ExprBinOp>

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<&&'a ExprUnaryOp>

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 &'a ExprUnaryOp>

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

Source

pub fn expect_unary_op_expr(self) -> &'a ExprUnaryOp
where ExprRef<'a>: 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<&'a ExprUnaryOp>

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<&&'a ExprLambda>

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

Source

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

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

Source

pub fn expect_lambda_expr(self) -> &'a ExprLambda
where ExprRef<'a>: 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<&'a ExprLambda>

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

Source

pub const fn is_if_expr(&self) -> bool

Returns true if self is of variant If.

Source

pub fn as_if_expr(&self) -> Option<&&'a ExprIf>

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

Source

pub fn as_mut_if_expr(&mut self) -> Option<&mut &'a ExprIf>

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

Source

pub fn expect_if_expr(self) -> &'a ExprIf
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of If.

§Panics

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

Source

pub fn if_expr(self) -> Option<&'a ExprIf>

Returns Some if self is of variant If, 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<&&'a ExprDict>

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

Source

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

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

Source

pub fn expect_dict_expr(self) -> &'a ExprDict
where ExprRef<'a>: 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<&'a ExprDict>

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<&&'a ExprSet>

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

Source

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

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

Source

pub fn expect_set_expr(self) -> &'a ExprSet
where ExprRef<'a>: 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<&'a ExprSet>

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<&&'a ExprListComp>

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 &'a ExprListComp>

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

Source

pub fn expect_list_comp_expr(self) -> &'a ExprListComp
where ExprRef<'a>: 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<&'a ExprListComp>

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<&&'a ExprSetComp>

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 &'a ExprSetComp>

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

Source

pub fn expect_set_comp_expr(self) -> &'a ExprSetComp
where ExprRef<'a>: 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<&'a ExprSetComp>

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<&&'a ExprDictComp>

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 &'a ExprDictComp>

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

Source

pub fn expect_dict_comp_expr(self) -> &'a ExprDictComp
where ExprRef<'a>: 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<&'a ExprDictComp>

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

Source

pub const fn is_generator_expr(&self) -> bool

Returns true if self is of variant Generator.

Source

pub fn as_generator_expr(&self) -> Option<&&'a ExprGenerator>

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

Source

pub fn as_mut_generator_expr(&mut self) -> Option<&mut &'a ExprGenerator>

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

Source

pub fn expect_generator_expr(self) -> &'a ExprGenerator
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of Generator.

§Panics

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

Source

pub fn generator_expr(self) -> Option<&'a ExprGenerator>

Returns Some if self is of variant Generator, 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<&&'a ExprAwait>

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

Source

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

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

Source

pub fn expect_await_expr(self) -> &'a ExprAwait
where ExprRef<'a>: 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<&'a ExprAwait>

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<&&'a ExprYield>

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

Source

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

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

Source

pub fn expect_yield_expr(self) -> &'a ExprYield
where ExprRef<'a>: 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<&'a ExprYield>

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<&&'a ExprYieldFrom>

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 &'a ExprYieldFrom>

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

Source

pub fn expect_yield_from_expr(self) -> &'a ExprYieldFrom
where ExprRef<'a>: 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<&'a ExprYieldFrom>

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<&&'a ExprCompare>

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

Source

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

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

Source

pub fn expect_compare_expr(self) -> &'a ExprCompare
where ExprRef<'a>: 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<&'a ExprCompare>

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<&&'a ExprCall>

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

Source

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

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

Source

pub fn expect_call_expr(self) -> &'a ExprCall
where ExprRef<'a>: 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<&'a ExprCall>

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

Source

pub const fn is_f_string_expr(&self) -> bool

Returns true if self is of variant FString.

Source

pub fn as_f_string_expr(&self) -> Option<&&'a ExprFString>

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

Source

pub fn as_mut_f_string_expr(&mut self) -> Option<&mut &'a ExprFString>

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

Source

pub fn expect_f_string_expr(self) -> &'a ExprFString
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of FString.

§Panics

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

Source

pub fn f_string_expr(self) -> Option<&'a ExprFString>

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

Source

pub const fn is_t_string_expr(&self) -> bool

Returns true if self is of variant TString.

Source

pub fn as_t_string_expr(&self) -> Option<&&'a ExprTString>

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

Source

pub fn as_mut_t_string_expr(&mut self) -> Option<&mut &'a ExprTString>

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

Source

pub fn expect_t_string_expr(self) -> &'a ExprTString
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of TString.

§Panics

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

Source

pub fn t_string_expr(self) -> Option<&'a ExprTString>

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

Source

pub const fn is_string_literal_expr(&self) -> bool

Returns true if self is of variant StringLiteral.

Source

pub fn as_string_literal_expr(&self) -> Option<&&'a ExprStringLiteral>

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

Source

pub fn as_mut_string_literal_expr( &mut self, ) -> Option<&mut &'a ExprStringLiteral>

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

Source

pub fn expect_string_literal_expr(self) -> &'a ExprStringLiteral
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of StringLiteral.

§Panics

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

Source

pub fn string_literal_expr(self) -> Option<&'a ExprStringLiteral>

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

Source

pub const fn is_bytes_literal_expr(&self) -> bool

Returns true if self is of variant BytesLiteral.

Source

pub fn as_bytes_literal_expr(&self) -> Option<&&'a ExprBytesLiteral>

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

Source

pub fn as_mut_bytes_literal_expr(&mut self) -> Option<&mut &'a ExprBytesLiteral>

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

Source

pub fn expect_bytes_literal_expr(self) -> &'a ExprBytesLiteral
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of BytesLiteral.

§Panics

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

Source

pub fn bytes_literal_expr(self) -> Option<&'a ExprBytesLiteral>

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

Source

pub const fn is_number_literal_expr(&self) -> bool

Returns true if self is of variant NumberLiteral.

Source

pub fn as_number_literal_expr(&self) -> Option<&&'a ExprNumberLiteral>

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

Source

pub fn as_mut_number_literal_expr( &mut self, ) -> Option<&mut &'a ExprNumberLiteral>

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

Source

pub fn expect_number_literal_expr(self) -> &'a ExprNumberLiteral
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of NumberLiteral.

§Panics

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

Source

pub fn number_literal_expr(self) -> Option<&'a ExprNumberLiteral>

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

Source

pub const fn is_boolean_literal_expr(&self) -> bool

Returns true if self is of variant BooleanLiteral.

Source

pub fn as_boolean_literal_expr(&self) -> Option<&&'a ExprBooleanLiteral>

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

Source

pub fn as_mut_boolean_literal_expr( &mut self, ) -> Option<&mut &'a ExprBooleanLiteral>

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

Source

pub fn expect_boolean_literal_expr(self) -> &'a ExprBooleanLiteral
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of BooleanLiteral.

§Panics

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

Source

pub fn boolean_literal_expr(self) -> Option<&'a ExprBooleanLiteral>

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

Source

pub const fn is_none_literal_expr(&self) -> bool

Returns true if self is of variant NoneLiteral.

Source

pub fn as_none_literal_expr(&self) -> Option<&&'a ExprNoneLiteral>

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

Source

pub fn as_mut_none_literal_expr(&mut self) -> Option<&mut &'a ExprNoneLiteral>

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

Source

pub fn expect_none_literal_expr(self) -> &'a ExprNoneLiteral
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of NoneLiteral.

§Panics

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

Source

pub fn none_literal_expr(self) -> Option<&'a ExprNoneLiteral>

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

Source

pub const fn is_ellipsis_literal_expr(&self) -> bool

Returns true if self is of variant EllipsisLiteral.

Source

pub fn as_ellipsis_literal_expr(&self) -> Option<&&'a ExprEllipsisLiteral>

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

Source

pub fn as_mut_ellipsis_literal_expr( &mut self, ) -> Option<&mut &'a ExprEllipsisLiteral>

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

Source

pub fn expect_ellipsis_literal_expr(self) -> &'a ExprEllipsisLiteral
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of EllipsisLiteral.

§Panics

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

Source

pub fn ellipsis_literal_expr(self) -> Option<&'a ExprEllipsisLiteral>

Returns Some if self is of variant EllipsisLiteral, 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<&&'a ExprAttribute>

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

Source

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

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

Source

pub fn expect_attribute_expr(self) -> &'a ExprAttribute
where ExprRef<'a>: 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<&'a ExprAttribute>

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<&&'a ExprSubscript>

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

Source

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

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

Source

pub fn expect_subscript_expr(self) -> &'a ExprSubscript
where ExprRef<'a>: 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<&'a ExprSubscript>

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<&&'a ExprStarred>

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

Source

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

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

Source

pub fn expect_starred_expr(self) -> &'a ExprStarred
where ExprRef<'a>: 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<&'a ExprStarred>

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<&&'a ExprName>

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

Source

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

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

Source

pub fn expect_name_expr(self) -> &'a ExprName
where ExprRef<'a>: 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<&'a ExprName>

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<&&'a ExprList>

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

Source

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

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

Source

pub fn expect_list_expr(self) -> &'a ExprList
where ExprRef<'a>: 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<&'a ExprList>

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<&&'a ExprTuple>

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

Source

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

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

Source

pub fn expect_tuple_expr(self) -> &'a ExprTuple
where ExprRef<'a>: 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<&'a ExprTuple>

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<&&'a ExprSlice>

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

Source

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

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

Source

pub fn expect_slice_expr(self) -> &'a ExprSlice
where ExprRef<'a>: 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<&'a ExprSlice>

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

Source

pub const fn is_ipy_escape_command_expr(&self) -> bool

Returns true if self is of variant IpyEscapeCommand.

Source

pub fn as_ipy_escape_command_expr(&self) -> Option<&&'a ExprIpyEscapeCommand>

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

Source

pub fn as_mut_ipy_escape_command_expr( &mut self, ) -> Option<&mut &'a ExprIpyEscapeCommand>

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

Source

pub fn expect_ipy_escape_command_expr(self) -> &'a ExprIpyEscapeCommand
where ExprRef<'a>: Debug,

Unwraps the value, yielding the content of IpyEscapeCommand.

§Panics

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

Source

pub fn ipy_escape_command_expr(self) -> Option<&'a ExprIpyEscapeCommand>

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

Source§

impl ExprRef<'_>

Trait Implementations§

Source§

impl<'a> Clone for ExprRef<'a>

Source§

fn clone(&self) -> ExprRef<'a>

Returns a duplicate 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<'a> Debug for ExprRef<'a>

Source§

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

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

impl<'a> From<&'a Box<Expr>> for ExprRef<'a>

Source§

fn from(value: &'a Box<Expr>) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Expr> for ExprRef<'a>

Source§

fn from(node: &'a Expr) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprAttribute> for ExprRef<'a>

Source§

fn from(node: &'a ExprAttribute) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprAwait> for ExprRef<'a>

Source§

fn from(node: &'a ExprAwait) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprBinOp> for ExprRef<'a>

Source§

fn from(node: &'a ExprBinOp) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprBoolOp> for ExprRef<'a>

Source§

fn from(node: &'a ExprBoolOp) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprBooleanLiteral> for ExprRef<'a>

Source§

fn from(node: &'a ExprBooleanLiteral) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprBytesLiteral> for ExprRef<'a>

Source§

fn from(node: &'a ExprBytesLiteral) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprCall> for ExprRef<'a>

Source§

fn from(node: &'a ExprCall) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprCompare> for ExprRef<'a>

Source§

fn from(node: &'a ExprCompare) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprDict> for ExprRef<'a>

Source§

fn from(node: &'a ExprDict) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprDictComp> for ExprRef<'a>

Source§

fn from(node: &'a ExprDictComp) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprEllipsisLiteral> for ExprRef<'a>

Source§

fn from(node: &'a ExprEllipsisLiteral) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprFString> for ExprRef<'a>

Source§

fn from(node: &'a ExprFString) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprGenerator> for ExprRef<'a>

Source§

fn from(node: &'a ExprGenerator) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprIf> for ExprRef<'a>

Source§

fn from(node: &'a ExprIf) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprIpyEscapeCommand> for ExprRef<'a>

Source§

fn from(node: &'a ExprIpyEscapeCommand) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprLambda> for ExprRef<'a>

Source§

fn from(node: &'a ExprLambda) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprList> for ExprRef<'a>

Source§

fn from(node: &'a ExprList) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprListComp> for ExprRef<'a>

Source§

fn from(node: &'a ExprListComp) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprName> for ExprRef<'a>

Source§

fn from(node: &'a ExprName) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprNamed> for ExprRef<'a>

Source§

fn from(node: &'a ExprNamed) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprNoneLiteral> for ExprRef<'a>

Source§

fn from(node: &'a ExprNoneLiteral) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprNumberLiteral> for ExprRef<'a>

Source§

fn from(node: &'a ExprNumberLiteral) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&ExprRef<'a>> for OperatorPrecedence

Source§

fn from(expr_ref: &ExprRef<'a>) -> OperatorPrecedence

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprSet> for ExprRef<'a>

Source§

fn from(node: &'a ExprSet) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprSetComp> for ExprRef<'a>

Source§

fn from(node: &'a ExprSetComp) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprSlice> for ExprRef<'a>

Source§

fn from(node: &'a ExprSlice) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprStarred> for ExprRef<'a>

Source§

fn from(node: &'a ExprStarred) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprStringLiteral> for ExprRef<'a>

Source§

fn from(node: &'a ExprStringLiteral) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprSubscript> for ExprRef<'a>

Source§

fn from(node: &'a ExprSubscript) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprTString> for ExprRef<'a>

Source§

fn from(node: &'a ExprTString) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprTuple> for ExprRef<'a>

Source§

fn from(node: &'a ExprTuple) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprUnaryOp> for ExprRef<'a>

Source§

fn from(node: &'a ExprUnaryOp) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprYield> for ExprRef<'a>

Source§

fn from(node: &'a ExprYield) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExprYieldFrom> for ExprRef<'a>

Source§

fn from(node: &'a ExprYieldFrom) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&StringLike<'a>> for ExprRef<'a>

Source§

fn from(value: &StringLike<'a>) -> ExprRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<ExprRef<'a>> for AnyNodeRef<'a>

Source§

fn from(node: ExprRef<'a>) -> AnyNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> GetSize for ExprRef<'a>

Source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
Source§

fn get_heap_size_with_tracker<TRACKER>( &self, tracker: TRACKER, ) -> (usize, TRACKER)
where TRACKER: GetSizeTracker,

Determines how many bytes this object occupies inside the heap while using a tracker. Read more
Source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
Source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
Source§

fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)
where T: GetSizeTracker,

Determines the total size of the object while using a tracker. Read more
Source§

impl HasNodeIndex for ExprRef<'_>

Source§

fn node_index(&self) -> &AtomicNodeIndex

Returns the AtomicNodeIndex for this node.
Source§

impl<'a> PartialEq for ExprRef<'a>

Source§

fn eq(&self, other: &ExprRef<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Ranged for ExprRef<'_>

Source§

fn range(&self) -> TextRange

The range of this item in the source text.
Source§

fn start(&self) -> TextSize

The start offset of this item in the source text.
Source§

fn end(&self) -> TextSize

The end offset of this item in the source text.
Source§

impl<'a> Copy for ExprRef<'a>

Source§

impl<'a> StructuralPartialEq for ExprRef<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ExprRef<'a>

§

impl<'a> RefUnwindSafe for ExprRef<'a>

§

impl<'a> Send for ExprRef<'a>

§

impl<'a> Sync for ExprRef<'a>

§

impl<'a> Unpin for ExprRef<'a>

§

impl<'a> UnsafeUnpin for ExprRef<'a>

§

impl<'a> UnwindSafe for ExprRef<'a>

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

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

Source§

impl<T> PyThreadingConstraint for T