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>
impl<'a> ExprRef<'a>
Sourcepub const fn is_bool_op_expr(&self) -> bool
pub const fn is_bool_op_expr(&self) -> bool
Returns true if self is of variant BoolOp.
Sourcepub fn as_bool_op_expr(&self) -> Option<&&'a ExprBoolOp>
pub fn as_bool_op_expr(&self) -> Option<&&'a ExprBoolOp>
Returns Some if self is a reference of variant BoolOp, and None otherwise.
Sourcepub fn as_mut_bool_op_expr(&mut self) -> Option<&mut &'a ExprBoolOp>
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.
Sourcepub fn expect_bool_op_expr(self) -> &'a ExprBoolOp
pub fn expect_bool_op_expr(self) -> &'a ExprBoolOp
Sourcepub fn bool_op_expr(self) -> Option<&'a ExprBoolOp>
pub fn bool_op_expr(self) -> Option<&'a ExprBoolOp>
Returns Some if self is of variant BoolOp, and None otherwise.
Sourcepub const fn is_named_expr(&self) -> bool
pub const fn is_named_expr(&self) -> bool
Returns true if self is of variant Named.
Sourcepub fn as_named_expr(&self) -> Option<&&'a ExprNamed>
pub fn as_named_expr(&self) -> Option<&&'a ExprNamed>
Returns Some if self is a reference of variant Named, and None otherwise.
Sourcepub fn as_mut_named_expr(&mut self) -> Option<&mut &'a ExprNamed>
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.
Sourcepub fn expect_named_expr(self) -> &'a ExprNamed
pub fn expect_named_expr(self) -> &'a ExprNamed
Sourcepub fn named_expr(self) -> Option<&'a ExprNamed>
pub fn named_expr(self) -> Option<&'a ExprNamed>
Returns Some if self is of variant Named, and None otherwise.
Sourcepub const fn is_bin_op_expr(&self) -> bool
pub const fn is_bin_op_expr(&self) -> bool
Returns true if self is of variant BinOp.
Sourcepub fn as_bin_op_expr(&self) -> Option<&&'a ExprBinOp>
pub fn as_bin_op_expr(&self) -> Option<&&'a ExprBinOp>
Returns Some if self is a reference of variant BinOp, and None otherwise.
Sourcepub fn as_mut_bin_op_expr(&mut self) -> Option<&mut &'a ExprBinOp>
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.
Sourcepub fn expect_bin_op_expr(self) -> &'a ExprBinOp
pub fn expect_bin_op_expr(self) -> &'a ExprBinOp
Sourcepub fn bin_op_expr(self) -> Option<&'a ExprBinOp>
pub fn bin_op_expr(self) -> Option<&'a ExprBinOp>
Returns Some if self is of variant BinOp, and None otherwise.
Sourcepub const fn is_unary_op_expr(&self) -> bool
pub const fn is_unary_op_expr(&self) -> bool
Returns true if self is of variant UnaryOp.
Sourcepub fn as_unary_op_expr(&self) -> Option<&&'a ExprUnaryOp>
pub fn as_unary_op_expr(&self) -> Option<&&'a ExprUnaryOp>
Returns Some if self is a reference of variant UnaryOp, and None otherwise.
Sourcepub fn as_mut_unary_op_expr(&mut self) -> Option<&mut &'a ExprUnaryOp>
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.
Sourcepub fn expect_unary_op_expr(self) -> &'a ExprUnaryOp
pub fn expect_unary_op_expr(self) -> &'a ExprUnaryOp
Sourcepub fn unary_op_expr(self) -> Option<&'a ExprUnaryOp>
pub fn unary_op_expr(self) -> Option<&'a ExprUnaryOp>
Returns Some if self is of variant UnaryOp, and None otherwise.
Sourcepub const fn is_lambda_expr(&self) -> bool
pub const fn is_lambda_expr(&self) -> bool
Returns true if self is of variant Lambda.
Sourcepub fn as_lambda_expr(&self) -> Option<&&'a ExprLambda>
pub fn as_lambda_expr(&self) -> Option<&&'a ExprLambda>
Returns Some if self is a reference of variant Lambda, and None otherwise.
Sourcepub fn as_mut_lambda_expr(&mut self) -> Option<&mut &'a ExprLambda>
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.
Sourcepub fn expect_lambda_expr(self) -> &'a ExprLambda
pub fn expect_lambda_expr(self) -> &'a ExprLambda
Sourcepub fn lambda_expr(self) -> Option<&'a ExprLambda>
pub fn lambda_expr(self) -> Option<&'a ExprLambda>
Returns Some if self is of variant Lambda, and None otherwise.
Sourcepub const fn is_if_expr(&self) -> bool
pub const fn is_if_expr(&self) -> bool
Returns true if self is of variant If.
Sourcepub fn as_if_expr(&self) -> Option<&&'a ExprIf>
pub fn as_if_expr(&self) -> Option<&&'a ExprIf>
Returns Some if self is a reference of variant If, and None otherwise.
Sourcepub fn as_mut_if_expr(&mut self) -> Option<&mut &'a ExprIf>
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.
Sourcepub fn expect_if_expr(self) -> &'a ExprIf
pub fn expect_if_expr(self) -> &'a ExprIf
Sourcepub fn if_expr(self) -> Option<&'a ExprIf>
pub fn if_expr(self) -> Option<&'a ExprIf>
Returns Some if self is of variant If, and None otherwise.
Sourcepub const fn is_dict_expr(&self) -> bool
pub const fn is_dict_expr(&self) -> bool
Returns true if self is of variant Dict.
Sourcepub fn as_dict_expr(&self) -> Option<&&'a ExprDict>
pub fn as_dict_expr(&self) -> Option<&&'a ExprDict>
Returns Some if self is a reference of variant Dict, and None otherwise.
Sourcepub fn as_mut_dict_expr(&mut self) -> Option<&mut &'a ExprDict>
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.
Sourcepub fn expect_dict_expr(self) -> &'a ExprDict
pub fn expect_dict_expr(self) -> &'a ExprDict
Sourcepub fn dict_expr(self) -> Option<&'a ExprDict>
pub fn dict_expr(self) -> Option<&'a ExprDict>
Returns Some if self is of variant Dict, and None otherwise.
Sourcepub const fn is_set_expr(&self) -> bool
pub const fn is_set_expr(&self) -> bool
Returns true if self is of variant Set.
Sourcepub fn as_set_expr(&self) -> Option<&&'a ExprSet>
pub fn as_set_expr(&self) -> Option<&&'a ExprSet>
Returns Some if self is a reference of variant Set, and None otherwise.
Sourcepub fn as_mut_set_expr(&mut self) -> Option<&mut &'a ExprSet>
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.
Sourcepub fn expect_set_expr(self) -> &'a ExprSet
pub fn expect_set_expr(self) -> &'a ExprSet
Sourcepub fn set_expr(self) -> Option<&'a ExprSet>
pub fn set_expr(self) -> Option<&'a ExprSet>
Returns Some if self is of variant Set, and None otherwise.
Sourcepub const fn is_list_comp_expr(&self) -> bool
pub const fn is_list_comp_expr(&self) -> bool
Returns true if self is of variant ListComp.
Sourcepub fn as_list_comp_expr(&self) -> Option<&&'a ExprListComp>
pub fn as_list_comp_expr(&self) -> Option<&&'a ExprListComp>
Returns Some if self is a reference of variant ListComp, and None otherwise.
Sourcepub fn as_mut_list_comp_expr(&mut self) -> Option<&mut &'a ExprListComp>
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.
Sourcepub fn expect_list_comp_expr(self) -> &'a ExprListComp
pub fn expect_list_comp_expr(self) -> &'a ExprListComp
Sourcepub fn list_comp_expr(self) -> Option<&'a ExprListComp>
pub fn list_comp_expr(self) -> Option<&'a ExprListComp>
Returns Some if self is of variant ListComp, and None otherwise.
Sourcepub const fn is_set_comp_expr(&self) -> bool
pub const fn is_set_comp_expr(&self) -> bool
Returns true if self is of variant SetComp.
Sourcepub fn as_set_comp_expr(&self) -> Option<&&'a ExprSetComp>
pub fn as_set_comp_expr(&self) -> Option<&&'a ExprSetComp>
Returns Some if self is a reference of variant SetComp, and None otherwise.
Sourcepub fn as_mut_set_comp_expr(&mut self) -> Option<&mut &'a ExprSetComp>
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.
Sourcepub fn expect_set_comp_expr(self) -> &'a ExprSetComp
pub fn expect_set_comp_expr(self) -> &'a ExprSetComp
Sourcepub fn set_comp_expr(self) -> Option<&'a ExprSetComp>
pub fn set_comp_expr(self) -> Option<&'a ExprSetComp>
Returns Some if self is of variant SetComp, and None otherwise.
Sourcepub const fn is_dict_comp_expr(&self) -> bool
pub const fn is_dict_comp_expr(&self) -> bool
Returns true if self is of variant DictComp.
Sourcepub fn as_dict_comp_expr(&self) -> Option<&&'a ExprDictComp>
pub fn as_dict_comp_expr(&self) -> Option<&&'a ExprDictComp>
Returns Some if self is a reference of variant DictComp, and None otherwise.
Sourcepub fn as_mut_dict_comp_expr(&mut self) -> Option<&mut &'a ExprDictComp>
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.
Sourcepub fn expect_dict_comp_expr(self) -> &'a ExprDictComp
pub fn expect_dict_comp_expr(self) -> &'a ExprDictComp
Sourcepub fn dict_comp_expr(self) -> Option<&'a ExprDictComp>
pub fn dict_comp_expr(self) -> Option<&'a ExprDictComp>
Returns Some if self is of variant DictComp, and None otherwise.
Sourcepub const fn is_generator_expr(&self) -> bool
pub const fn is_generator_expr(&self) -> bool
Returns true if self is of variant Generator.
Sourcepub fn as_generator_expr(&self) -> Option<&&'a ExprGenerator>
pub fn as_generator_expr(&self) -> Option<&&'a ExprGenerator>
Returns Some if self is a reference of variant Generator, and None otherwise.
Sourcepub fn as_mut_generator_expr(&mut self) -> Option<&mut &'a ExprGenerator>
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.
Sourcepub fn expect_generator_expr(self) -> &'a ExprGenerator
pub fn expect_generator_expr(self) -> &'a ExprGenerator
Sourcepub fn generator_expr(self) -> Option<&'a ExprGenerator>
pub fn generator_expr(self) -> Option<&'a ExprGenerator>
Returns Some if self is of variant Generator, and None otherwise.
Sourcepub const fn is_await_expr(&self) -> bool
pub const fn is_await_expr(&self) -> bool
Returns true if self is of variant Await.
Sourcepub fn as_await_expr(&self) -> Option<&&'a ExprAwait>
pub fn as_await_expr(&self) -> Option<&&'a ExprAwait>
Returns Some if self is a reference of variant Await, and None otherwise.
Sourcepub fn as_mut_await_expr(&mut self) -> Option<&mut &'a ExprAwait>
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.
Sourcepub fn expect_await_expr(self) -> &'a ExprAwait
pub fn expect_await_expr(self) -> &'a ExprAwait
Sourcepub fn await_expr(self) -> Option<&'a ExprAwait>
pub fn await_expr(self) -> Option<&'a ExprAwait>
Returns Some if self is of variant Await, and None otherwise.
Sourcepub const fn is_yield_expr(&self) -> bool
pub const fn is_yield_expr(&self) -> bool
Returns true if self is of variant Yield.
Sourcepub fn as_yield_expr(&self) -> Option<&&'a ExprYield>
pub fn as_yield_expr(&self) -> Option<&&'a ExprYield>
Returns Some if self is a reference of variant Yield, and None otherwise.
Sourcepub fn as_mut_yield_expr(&mut self) -> Option<&mut &'a ExprYield>
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.
Sourcepub fn expect_yield_expr(self) -> &'a ExprYield
pub fn expect_yield_expr(self) -> &'a ExprYield
Sourcepub fn yield_expr(self) -> Option<&'a ExprYield>
pub fn yield_expr(self) -> Option<&'a ExprYield>
Returns Some if self is of variant Yield, and None otherwise.
Sourcepub const fn is_yield_from_expr(&self) -> bool
pub const fn is_yield_from_expr(&self) -> bool
Returns true if self is of variant YieldFrom.
Sourcepub fn as_yield_from_expr(&self) -> Option<&&'a ExprYieldFrom>
pub fn as_yield_from_expr(&self) -> Option<&&'a ExprYieldFrom>
Returns Some if self is a reference of variant YieldFrom, and None otherwise.
Sourcepub fn as_mut_yield_from_expr(&mut self) -> Option<&mut &'a ExprYieldFrom>
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.
Sourcepub fn expect_yield_from_expr(self) -> &'a ExprYieldFrom
pub fn expect_yield_from_expr(self) -> &'a ExprYieldFrom
Sourcepub fn yield_from_expr(self) -> Option<&'a ExprYieldFrom>
pub fn yield_from_expr(self) -> Option<&'a ExprYieldFrom>
Returns Some if self is of variant YieldFrom, and None otherwise.
Sourcepub const fn is_compare_expr(&self) -> bool
pub const fn is_compare_expr(&self) -> bool
Returns true if self is of variant Compare.
Sourcepub fn as_compare_expr(&self) -> Option<&&'a ExprCompare>
pub fn as_compare_expr(&self) -> Option<&&'a ExprCompare>
Returns Some if self is a reference of variant Compare, and None otherwise.
Sourcepub fn as_mut_compare_expr(&mut self) -> Option<&mut &'a ExprCompare>
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.
Sourcepub fn expect_compare_expr(self) -> &'a ExprCompare
pub fn expect_compare_expr(self) -> &'a ExprCompare
Sourcepub fn compare_expr(self) -> Option<&'a ExprCompare>
pub fn compare_expr(self) -> Option<&'a ExprCompare>
Returns Some if self is of variant Compare, and None otherwise.
Sourcepub const fn is_call_expr(&self) -> bool
pub const fn is_call_expr(&self) -> bool
Returns true if self is of variant Call.
Sourcepub fn as_call_expr(&self) -> Option<&&'a ExprCall>
pub fn as_call_expr(&self) -> Option<&&'a ExprCall>
Returns Some if self is a reference of variant Call, and None otherwise.
Sourcepub fn as_mut_call_expr(&mut self) -> Option<&mut &'a ExprCall>
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.
Sourcepub fn expect_call_expr(self) -> &'a ExprCall
pub fn expect_call_expr(self) -> &'a ExprCall
Sourcepub fn call_expr(self) -> Option<&'a ExprCall>
pub fn call_expr(self) -> Option<&'a ExprCall>
Returns Some if self is of variant Call, and None otherwise.
Sourcepub const fn is_f_string_expr(&self) -> bool
pub const fn is_f_string_expr(&self) -> bool
Returns true if self is of variant FString.
Sourcepub fn as_f_string_expr(&self) -> Option<&&'a ExprFString>
pub fn as_f_string_expr(&self) -> Option<&&'a ExprFString>
Returns Some if self is a reference of variant FString, and None otherwise.
Sourcepub fn as_mut_f_string_expr(&mut self) -> Option<&mut &'a ExprFString>
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.
Sourcepub fn expect_f_string_expr(self) -> &'a ExprFString
pub fn expect_f_string_expr(self) -> &'a ExprFString
Sourcepub fn f_string_expr(self) -> Option<&'a ExprFString>
pub fn f_string_expr(self) -> Option<&'a ExprFString>
Returns Some if self is of variant FString, and None otherwise.
Sourcepub const fn is_t_string_expr(&self) -> bool
pub const fn is_t_string_expr(&self) -> bool
Returns true if self is of variant TString.
Sourcepub fn as_t_string_expr(&self) -> Option<&&'a ExprTString>
pub fn as_t_string_expr(&self) -> Option<&&'a ExprTString>
Returns Some if self is a reference of variant TString, and None otherwise.
Sourcepub fn as_mut_t_string_expr(&mut self) -> Option<&mut &'a ExprTString>
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.
Sourcepub fn expect_t_string_expr(self) -> &'a ExprTString
pub fn expect_t_string_expr(self) -> &'a ExprTString
Sourcepub fn t_string_expr(self) -> Option<&'a ExprTString>
pub fn t_string_expr(self) -> Option<&'a ExprTString>
Returns Some if self is of variant TString, and None otherwise.
Sourcepub const fn is_string_literal_expr(&self) -> bool
pub const fn is_string_literal_expr(&self) -> bool
Returns true if self is of variant StringLiteral.
Sourcepub fn as_string_literal_expr(&self) -> Option<&&'a ExprStringLiteral>
pub fn as_string_literal_expr(&self) -> Option<&&'a ExprStringLiteral>
Returns Some if self is a reference of variant StringLiteral, and None otherwise.
Sourcepub fn as_mut_string_literal_expr(
&mut self,
) -> Option<&mut &'a ExprStringLiteral>
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.
Sourcepub fn expect_string_literal_expr(self) -> &'a ExprStringLiteral
pub fn expect_string_literal_expr(self) -> &'a ExprStringLiteral
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.
Sourcepub fn string_literal_expr(self) -> Option<&'a ExprStringLiteral>
pub fn string_literal_expr(self) -> Option<&'a ExprStringLiteral>
Returns Some if self is of variant StringLiteral, and None otherwise.
Sourcepub const fn is_bytes_literal_expr(&self) -> bool
pub const fn is_bytes_literal_expr(&self) -> bool
Returns true if self is of variant BytesLiteral.
Sourcepub fn as_bytes_literal_expr(&self) -> Option<&&'a ExprBytesLiteral>
pub fn as_bytes_literal_expr(&self) -> Option<&&'a ExprBytesLiteral>
Returns Some if self is a reference of variant BytesLiteral, and None otherwise.
Sourcepub fn as_mut_bytes_literal_expr(&mut self) -> Option<&mut &'a ExprBytesLiteral>
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.
Sourcepub fn expect_bytes_literal_expr(self) -> &'a ExprBytesLiteral
pub fn expect_bytes_literal_expr(self) -> &'a ExprBytesLiteral
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.
Sourcepub fn bytes_literal_expr(self) -> Option<&'a ExprBytesLiteral>
pub fn bytes_literal_expr(self) -> Option<&'a ExprBytesLiteral>
Returns Some if self is of variant BytesLiteral, and None otherwise.
Sourcepub const fn is_number_literal_expr(&self) -> bool
pub const fn is_number_literal_expr(&self) -> bool
Returns true if self is of variant NumberLiteral.
Sourcepub fn as_number_literal_expr(&self) -> Option<&&'a ExprNumberLiteral>
pub fn as_number_literal_expr(&self) -> Option<&&'a ExprNumberLiteral>
Returns Some if self is a reference of variant NumberLiteral, and None otherwise.
Sourcepub fn as_mut_number_literal_expr(
&mut self,
) -> Option<&mut &'a ExprNumberLiteral>
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.
Sourcepub fn expect_number_literal_expr(self) -> &'a ExprNumberLiteral
pub fn expect_number_literal_expr(self) -> &'a ExprNumberLiteral
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.
Sourcepub fn number_literal_expr(self) -> Option<&'a ExprNumberLiteral>
pub fn number_literal_expr(self) -> Option<&'a ExprNumberLiteral>
Returns Some if self is of variant NumberLiteral, and None otherwise.
Sourcepub const fn is_boolean_literal_expr(&self) -> bool
pub const fn is_boolean_literal_expr(&self) -> bool
Returns true if self is of variant BooleanLiteral.
Sourcepub fn as_boolean_literal_expr(&self) -> Option<&&'a ExprBooleanLiteral>
pub fn as_boolean_literal_expr(&self) -> Option<&&'a ExprBooleanLiteral>
Returns Some if self is a reference of variant BooleanLiteral, and None otherwise.
Sourcepub fn as_mut_boolean_literal_expr(
&mut self,
) -> Option<&mut &'a ExprBooleanLiteral>
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.
Sourcepub fn expect_boolean_literal_expr(self) -> &'a ExprBooleanLiteral
pub fn expect_boolean_literal_expr(self) -> &'a ExprBooleanLiteral
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.
Sourcepub fn boolean_literal_expr(self) -> Option<&'a ExprBooleanLiteral>
pub fn boolean_literal_expr(self) -> Option<&'a ExprBooleanLiteral>
Returns Some if self is of variant BooleanLiteral, and None otherwise.
Sourcepub const fn is_none_literal_expr(&self) -> bool
pub const fn is_none_literal_expr(&self) -> bool
Returns true if self is of variant NoneLiteral.
Sourcepub fn as_none_literal_expr(&self) -> Option<&&'a ExprNoneLiteral>
pub fn as_none_literal_expr(&self) -> Option<&&'a ExprNoneLiteral>
Returns Some if self is a reference of variant NoneLiteral, and None otherwise.
Sourcepub fn as_mut_none_literal_expr(&mut self) -> Option<&mut &'a ExprNoneLiteral>
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.
Sourcepub fn expect_none_literal_expr(self) -> &'a ExprNoneLiteral
pub fn expect_none_literal_expr(self) -> &'a ExprNoneLiteral
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.
Sourcepub fn none_literal_expr(self) -> Option<&'a ExprNoneLiteral>
pub fn none_literal_expr(self) -> Option<&'a ExprNoneLiteral>
Returns Some if self is of variant NoneLiteral, and None otherwise.
Sourcepub const fn is_ellipsis_literal_expr(&self) -> bool
pub const fn is_ellipsis_literal_expr(&self) -> bool
Returns true if self is of variant EllipsisLiteral.
Sourcepub fn as_ellipsis_literal_expr(&self) -> Option<&&'a ExprEllipsisLiteral>
pub fn as_ellipsis_literal_expr(&self) -> Option<&&'a ExprEllipsisLiteral>
Returns Some if self is a reference of variant EllipsisLiteral, and None otherwise.
Sourcepub fn as_mut_ellipsis_literal_expr(
&mut self,
) -> Option<&mut &'a ExprEllipsisLiteral>
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.
Sourcepub fn expect_ellipsis_literal_expr(self) -> &'a ExprEllipsisLiteral
pub fn expect_ellipsis_literal_expr(self) -> &'a ExprEllipsisLiteral
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.
Sourcepub fn ellipsis_literal_expr(self) -> Option<&'a ExprEllipsisLiteral>
pub fn ellipsis_literal_expr(self) -> Option<&'a ExprEllipsisLiteral>
Returns Some if self is of variant EllipsisLiteral, and None otherwise.
Sourcepub const fn is_attribute_expr(&self) -> bool
pub const fn is_attribute_expr(&self) -> bool
Returns true if self is of variant Attribute.
Sourcepub fn as_attribute_expr(&self) -> Option<&&'a ExprAttribute>
pub fn as_attribute_expr(&self) -> Option<&&'a ExprAttribute>
Returns Some if self is a reference of variant Attribute, and None otherwise.
Sourcepub fn as_mut_attribute_expr(&mut self) -> Option<&mut &'a ExprAttribute>
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.
Sourcepub fn expect_attribute_expr(self) -> &'a ExprAttribute
pub fn expect_attribute_expr(self) -> &'a ExprAttribute
Sourcepub fn attribute_expr(self) -> Option<&'a ExprAttribute>
pub fn attribute_expr(self) -> Option<&'a ExprAttribute>
Returns Some if self is of variant Attribute, and None otherwise.
Sourcepub const fn is_subscript_expr(&self) -> bool
pub const fn is_subscript_expr(&self) -> bool
Returns true if self is of variant Subscript.
Sourcepub fn as_subscript_expr(&self) -> Option<&&'a ExprSubscript>
pub fn as_subscript_expr(&self) -> Option<&&'a ExprSubscript>
Returns Some if self is a reference of variant Subscript, and None otherwise.
Sourcepub fn as_mut_subscript_expr(&mut self) -> Option<&mut &'a ExprSubscript>
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.
Sourcepub fn expect_subscript_expr(self) -> &'a ExprSubscript
pub fn expect_subscript_expr(self) -> &'a ExprSubscript
Sourcepub fn subscript_expr(self) -> Option<&'a ExprSubscript>
pub fn subscript_expr(self) -> Option<&'a ExprSubscript>
Returns Some if self is of variant Subscript, and None otherwise.
Sourcepub const fn is_starred_expr(&self) -> bool
pub const fn is_starred_expr(&self) -> bool
Returns true if self is of variant Starred.
Sourcepub fn as_starred_expr(&self) -> Option<&&'a ExprStarred>
pub fn as_starred_expr(&self) -> Option<&&'a ExprStarred>
Returns Some if self is a reference of variant Starred, and None otherwise.
Sourcepub fn as_mut_starred_expr(&mut self) -> Option<&mut &'a ExprStarred>
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.
Sourcepub fn expect_starred_expr(self) -> &'a ExprStarred
pub fn expect_starred_expr(self) -> &'a ExprStarred
Sourcepub fn starred_expr(self) -> Option<&'a ExprStarred>
pub fn starred_expr(self) -> Option<&'a ExprStarred>
Returns Some if self is of variant Starred, and None otherwise.
Sourcepub const fn is_name_expr(&self) -> bool
pub const fn is_name_expr(&self) -> bool
Returns true if self is of variant Name.
Sourcepub fn as_name_expr(&self) -> Option<&&'a ExprName>
pub fn as_name_expr(&self) -> Option<&&'a ExprName>
Returns Some if self is a reference of variant Name, and None otherwise.
Sourcepub fn as_mut_name_expr(&mut self) -> Option<&mut &'a ExprName>
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.
Sourcepub fn expect_name_expr(self) -> &'a ExprName
pub fn expect_name_expr(self) -> &'a ExprName
Sourcepub fn name_expr(self) -> Option<&'a ExprName>
pub fn name_expr(self) -> Option<&'a ExprName>
Returns Some if self is of variant Name, and None otherwise.
Sourcepub const fn is_list_expr(&self) -> bool
pub const fn is_list_expr(&self) -> bool
Returns true if self is of variant List.
Sourcepub fn as_list_expr(&self) -> Option<&&'a ExprList>
pub fn as_list_expr(&self) -> Option<&&'a ExprList>
Returns Some if self is a reference of variant List, and None otherwise.
Sourcepub fn as_mut_list_expr(&mut self) -> Option<&mut &'a ExprList>
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.
Sourcepub fn expect_list_expr(self) -> &'a ExprList
pub fn expect_list_expr(self) -> &'a ExprList
Sourcepub fn list_expr(self) -> Option<&'a ExprList>
pub fn list_expr(self) -> Option<&'a ExprList>
Returns Some if self is of variant List, and None otherwise.
Sourcepub const fn is_tuple_expr(&self) -> bool
pub const fn is_tuple_expr(&self) -> bool
Returns true if self is of variant Tuple.
Sourcepub fn as_tuple_expr(&self) -> Option<&&'a ExprTuple>
pub fn as_tuple_expr(&self) -> Option<&&'a ExprTuple>
Returns Some if self is a reference of variant Tuple, and None otherwise.
Sourcepub fn as_mut_tuple_expr(&mut self) -> Option<&mut &'a ExprTuple>
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.
Sourcepub fn expect_tuple_expr(self) -> &'a ExprTuple
pub fn expect_tuple_expr(self) -> &'a ExprTuple
Sourcepub fn tuple_expr(self) -> Option<&'a ExprTuple>
pub fn tuple_expr(self) -> Option<&'a ExprTuple>
Returns Some if self is of variant Tuple, and None otherwise.
Sourcepub const fn is_slice_expr(&self) -> bool
pub const fn is_slice_expr(&self) -> bool
Returns true if self is of variant Slice.
Sourcepub fn as_slice_expr(&self) -> Option<&&'a ExprSlice>
pub fn as_slice_expr(&self) -> Option<&&'a ExprSlice>
Returns Some if self is a reference of variant Slice, and None otherwise.
Sourcepub fn as_mut_slice_expr(&mut self) -> Option<&mut &'a ExprSlice>
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.
Sourcepub fn expect_slice_expr(self) -> &'a ExprSlice
pub fn expect_slice_expr(self) -> &'a ExprSlice
Sourcepub fn slice_expr(self) -> Option<&'a ExprSlice>
pub fn slice_expr(self) -> Option<&'a ExprSlice>
Returns Some if self is of variant Slice, and None otherwise.
Sourcepub const fn is_ipy_escape_command_expr(&self) -> bool
pub const fn is_ipy_escape_command_expr(&self) -> bool
Returns true if self is of variant IpyEscapeCommand.
Sourcepub fn as_ipy_escape_command_expr(&self) -> Option<&&'a ExprIpyEscapeCommand>
pub fn as_ipy_escape_command_expr(&self) -> Option<&&'a ExprIpyEscapeCommand>
Returns Some if self is a reference of variant IpyEscapeCommand, and None otherwise.
Sourcepub fn as_mut_ipy_escape_command_expr(
&mut self,
) -> Option<&mut &'a ExprIpyEscapeCommand>
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.
Sourcepub fn expect_ipy_escape_command_expr(self) -> &'a ExprIpyEscapeCommand
pub fn expect_ipy_escape_command_expr(self) -> &'a ExprIpyEscapeCommand
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.
Sourcepub fn ipy_escape_command_expr(self) -> Option<&'a ExprIpyEscapeCommand>
pub fn ipy_escape_command_expr(self) -> Option<&'a ExprIpyEscapeCommand>
Returns Some if self is of variant IpyEscapeCommand, and None otherwise.
Source§impl ExprRef<'_>
impl ExprRef<'_>
Sourcepub fn is_literal_expr(&self) -> bool
pub fn is_literal_expr(&self) -> bool
pub fn precedence(&self) -> OperatorPrecedence
Trait Implementations§
Source§impl<'a> From<&'a ExprAttribute> for ExprRef<'a>
impl<'a> From<&'a ExprAttribute> for ExprRef<'a>
Source§fn from(node: &'a ExprAttribute) -> ExprRef<'a>
fn from(node: &'a ExprAttribute) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprBoolOp> for ExprRef<'a>
impl<'a> From<&'a ExprBoolOp> for ExprRef<'a>
Source§fn from(node: &'a ExprBoolOp) -> ExprRef<'a>
fn from(node: &'a ExprBoolOp) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprBooleanLiteral> for ExprRef<'a>
impl<'a> From<&'a ExprBooleanLiteral> for ExprRef<'a>
Source§fn from(node: &'a ExprBooleanLiteral) -> ExprRef<'a>
fn from(node: &'a ExprBooleanLiteral) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprBytesLiteral> for ExprRef<'a>
impl<'a> From<&'a ExprBytesLiteral> for ExprRef<'a>
Source§fn from(node: &'a ExprBytesLiteral) -> ExprRef<'a>
fn from(node: &'a ExprBytesLiteral) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprCompare> for ExprRef<'a>
impl<'a> From<&'a ExprCompare> for ExprRef<'a>
Source§fn from(node: &'a ExprCompare) -> ExprRef<'a>
fn from(node: &'a ExprCompare) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprDictComp> for ExprRef<'a>
impl<'a> From<&'a ExprDictComp> for ExprRef<'a>
Source§fn from(node: &'a ExprDictComp) -> ExprRef<'a>
fn from(node: &'a ExprDictComp) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprEllipsisLiteral> for ExprRef<'a>
impl<'a> From<&'a ExprEllipsisLiteral> for ExprRef<'a>
Source§fn from(node: &'a ExprEllipsisLiteral) -> ExprRef<'a>
fn from(node: &'a ExprEllipsisLiteral) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprFString> for ExprRef<'a>
impl<'a> From<&'a ExprFString> for ExprRef<'a>
Source§fn from(node: &'a ExprFString) -> ExprRef<'a>
fn from(node: &'a ExprFString) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprGenerator> for ExprRef<'a>
impl<'a> From<&'a ExprGenerator> for ExprRef<'a>
Source§fn from(node: &'a ExprGenerator) -> ExprRef<'a>
fn from(node: &'a ExprGenerator) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprIpyEscapeCommand> for ExprRef<'a>
impl<'a> From<&'a ExprIpyEscapeCommand> for ExprRef<'a>
Source§fn from(node: &'a ExprIpyEscapeCommand) -> ExprRef<'a>
fn from(node: &'a ExprIpyEscapeCommand) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprLambda> for ExprRef<'a>
impl<'a> From<&'a ExprLambda> for ExprRef<'a>
Source§fn from(node: &'a ExprLambda) -> ExprRef<'a>
fn from(node: &'a ExprLambda) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprListComp> for ExprRef<'a>
impl<'a> From<&'a ExprListComp> for ExprRef<'a>
Source§fn from(node: &'a ExprListComp) -> ExprRef<'a>
fn from(node: &'a ExprListComp) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprNoneLiteral> for ExprRef<'a>
impl<'a> From<&'a ExprNoneLiteral> for ExprRef<'a>
Source§fn from(node: &'a ExprNoneLiteral) -> ExprRef<'a>
fn from(node: &'a ExprNoneLiteral) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprNumberLiteral> for ExprRef<'a>
impl<'a> From<&'a ExprNumberLiteral> for ExprRef<'a>
Source§fn from(node: &'a ExprNumberLiteral) -> ExprRef<'a>
fn from(node: &'a ExprNumberLiteral) -> ExprRef<'a>
Source§impl<'a> From<&ExprRef<'a>> for OperatorPrecedence
impl<'a> From<&ExprRef<'a>> for OperatorPrecedence
Source§fn from(expr_ref: &ExprRef<'a>) -> OperatorPrecedence
fn from(expr_ref: &ExprRef<'a>) -> OperatorPrecedence
Source§impl<'a> From<&'a ExprSetComp> for ExprRef<'a>
impl<'a> From<&'a ExprSetComp> for ExprRef<'a>
Source§fn from(node: &'a ExprSetComp) -> ExprRef<'a>
fn from(node: &'a ExprSetComp) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprStarred> for ExprRef<'a>
impl<'a> From<&'a ExprStarred> for ExprRef<'a>
Source§fn from(node: &'a ExprStarred) -> ExprRef<'a>
fn from(node: &'a ExprStarred) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprStringLiteral> for ExprRef<'a>
impl<'a> From<&'a ExprStringLiteral> for ExprRef<'a>
Source§fn from(node: &'a ExprStringLiteral) -> ExprRef<'a>
fn from(node: &'a ExprStringLiteral) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprSubscript> for ExprRef<'a>
impl<'a> From<&'a ExprSubscript> for ExprRef<'a>
Source§fn from(node: &'a ExprSubscript) -> ExprRef<'a>
fn from(node: &'a ExprSubscript) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprTString> for ExprRef<'a>
impl<'a> From<&'a ExprTString> for ExprRef<'a>
Source§fn from(node: &'a ExprTString) -> ExprRef<'a>
fn from(node: &'a ExprTString) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprUnaryOp> for ExprRef<'a>
impl<'a> From<&'a ExprUnaryOp> for ExprRef<'a>
Source§fn from(node: &'a ExprUnaryOp) -> ExprRef<'a>
fn from(node: &'a ExprUnaryOp) -> ExprRef<'a>
Source§impl<'a> From<&'a ExprYieldFrom> for ExprRef<'a>
impl<'a> From<&'a ExprYieldFrom> for ExprRef<'a>
Source§fn from(node: &'a ExprYieldFrom) -> ExprRef<'a>
fn from(node: &'a ExprYieldFrom) -> ExprRef<'a>
Source§impl<'a> From<&StringLike<'a>> for ExprRef<'a>
impl<'a> From<&StringLike<'a>> for ExprRef<'a>
Source§fn from(value: &StringLike<'a>) -> ExprRef<'a>
fn from(value: &StringLike<'a>) -> ExprRef<'a>
Source§impl<'a> From<ExprRef<'a>> for AnyNodeRef<'a>
impl<'a> From<ExprRef<'a>> for AnyNodeRef<'a>
Source§fn from(node: ExprRef<'a>) -> AnyNodeRef<'a>
fn from(node: ExprRef<'a>) -> AnyNodeRef<'a>
Source§impl<'a> GetSize for ExprRef<'a>
impl<'a> GetSize for ExprRef<'a>
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
tracker. Read moreSource§impl HasNodeIndex for ExprRef<'_>
impl HasNodeIndex for ExprRef<'_>
Source§fn node_index(&self) -> &AtomicNodeIndex
fn node_index(&self) -> &AtomicNodeIndex
AtomicNodeIndex for this node.impl<'a> Copy for ExprRef<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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