pub enum ExprKind {
Show 15 variants
Ident(Ident),
All {
within: Ident,
except: Vec<Expr>,
},
Literal(Literal),
Pipeline(Pipeline),
List(Vec<Expr>),
Range(Range),
Binary {
left: Box<Expr>,
op: BinOp,
right: Box<Expr>,
},
Unary {
op: UnOp,
expr: Box<Expr>,
},
FuncCall(FuncCall),
Closure(Box<Closure>),
TransformCall(TransformCall),
SString(Vec<InterpolateItem>),
FString(Vec<InterpolateItem>),
Switch(Vec<SwitchCase>),
BuiltInFunction {
name: String,
args: Vec<Expr>,
},
}
Variants§
Ident(Ident)
All
Literal(Literal)
Pipeline(Pipeline)
List(Vec<Expr>)
Range(Range)
Binary
Unary
FuncCall(FuncCall)
Closure(Box<Closure>)
TransformCall(TransformCall)
SString(Vec<InterpolateItem>)
FString(Vec<InterpolateItem>)
Switch(Vec<SwitchCase>)
BuiltInFunction
Implementations§
source§impl ExprKind
impl ExprKind
sourcepub fn as_ident_mut(&mut self) -> Option<&mut Ident>
pub fn as_ident_mut(&mut self) -> Option<&mut Ident>
Optionally returns mutable references to the inner fields if this is a ExprKind::Ident
, otherwise None
sourcepub fn as_ident(&self) -> Option<&Ident>
pub fn as_ident(&self) -> Option<&Ident>
Optionally returns references to the inner fields if this is a ExprKind::Ident
, otherwise None
sourcepub fn into_ident(self) -> Result<Ident, Self>
pub fn into_ident(self) -> Result<Ident, Self>
Returns the inner fields if this is a ExprKind::Ident
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_all_mut(&mut self) -> Option<(&mut Ident, &mut Vec<Expr>)>
pub fn as_all_mut(&mut self) -> Option<(&mut Ident, &mut Vec<Expr>)>
Optionally returns mutable references to the inner fields if this is a ExprKind::All
, otherwise None
sourcepub fn as_all(&self) -> Option<(&Ident, &Vec<Expr>)>
pub fn as_all(&self) -> Option<(&Ident, &Vec<Expr>)>
Optionally returns references to the inner fields if this is a ExprKind::All
, otherwise None
sourcepub fn into_all(self) -> Result<(Ident, Vec<Expr>), Self>
pub fn into_all(self) -> Result<(Ident, Vec<Expr>), Self>
Returns the inner fields if this is a ExprKind::All
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_literal_mut(&mut self) -> Option<&mut Literal>
pub fn as_literal_mut(&mut self) -> Option<&mut Literal>
Optionally returns mutable references to the inner fields if this is a ExprKind::Literal
, otherwise None
sourcepub fn as_literal(&self) -> Option<&Literal>
pub fn as_literal(&self) -> Option<&Literal>
Optionally returns references to the inner fields if this is a ExprKind::Literal
, otherwise None
sourcepub fn into_literal(self) -> Result<Literal, Self>
pub fn into_literal(self) -> Result<Literal, Self>
Returns the inner fields if this is a ExprKind::Literal
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_pipeline_mut(&mut self) -> Option<&mut Pipeline>
pub fn as_pipeline_mut(&mut self) -> Option<&mut Pipeline>
Optionally returns mutable references to the inner fields if this is a ExprKind::Pipeline
, otherwise None
sourcepub fn as_pipeline(&self) -> Option<&Pipeline>
pub fn as_pipeline(&self) -> Option<&Pipeline>
Optionally returns references to the inner fields if this is a ExprKind::Pipeline
, otherwise None
sourcepub fn into_pipeline(self) -> Result<Pipeline, Self>
pub fn into_pipeline(self) -> Result<Pipeline, Self>
Returns the inner fields if this is a ExprKind::Pipeline
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_list_mut(&mut self) -> Option<&mut Vec<Expr>>
pub fn as_list_mut(&mut self) -> Option<&mut Vec<Expr>>
Optionally returns mutable references to the inner fields if this is a ExprKind::List
, otherwise None
sourcepub fn as_list(&self) -> Option<&Vec<Expr>>
pub fn as_list(&self) -> Option<&Vec<Expr>>
Optionally returns references to the inner fields if this is a ExprKind::List
, otherwise None
sourcepub fn into_list(self) -> Result<Vec<Expr>, Self>
pub fn into_list(self) -> Result<Vec<Expr>, Self>
Returns the inner fields if this is a ExprKind::List
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_range_mut(&mut self) -> Option<&mut Range>
pub fn as_range_mut(&mut self) -> Option<&mut Range>
Optionally returns mutable references to the inner fields if this is a ExprKind::Range
, otherwise None
sourcepub fn as_range(&self) -> Option<&Range>
pub fn as_range(&self) -> Option<&Range>
Optionally returns references to the inner fields if this is a ExprKind::Range
, otherwise None
sourcepub fn into_range(self) -> Result<Range, Self>
pub fn into_range(self) -> Result<Range, Self>
Returns the inner fields if this is a ExprKind::Range
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_binary_mut(
&mut self
) -> Option<(&mut Box<Expr>, &mut BinOp, &mut Box<Expr>)>
pub fn as_binary_mut(
&mut self
) -> Option<(&mut Box<Expr>, &mut BinOp, &mut Box<Expr>)>
Optionally returns mutable references to the inner fields if this is a ExprKind::Binary
, otherwise None
sourcepub fn as_binary(&self) -> Option<(&Box<Expr>, &BinOp, &Box<Expr>)>
pub fn as_binary(&self) -> Option<(&Box<Expr>, &BinOp, &Box<Expr>)>
Optionally returns references to the inner fields if this is a ExprKind::Binary
, otherwise None
sourcepub fn into_binary(self) -> Result<(Box<Expr>, BinOp, Box<Expr>), Self>
pub fn into_binary(self) -> Result<(Box<Expr>, BinOp, Box<Expr>), Self>
Returns the inner fields if this is a ExprKind::Binary
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_unary_mut(&mut self) -> Option<(&mut UnOp, &mut Box<Expr>)>
pub fn as_unary_mut(&mut self) -> Option<(&mut UnOp, &mut Box<Expr>)>
Optionally returns mutable references to the inner fields if this is a ExprKind::Unary
, otherwise None
sourcepub fn as_unary(&self) -> Option<(&UnOp, &Box<Expr>)>
pub fn as_unary(&self) -> Option<(&UnOp, &Box<Expr>)>
Optionally returns references to the inner fields if this is a ExprKind::Unary
, otherwise None
sourcepub fn into_unary(self) -> Result<(UnOp, Box<Expr>), Self>
pub fn into_unary(self) -> Result<(UnOp, Box<Expr>), Self>
Returns the inner fields if this is a ExprKind::Unary
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_func_call_mut(&mut self) -> Option<&mut FuncCall>
pub fn as_func_call_mut(&mut self) -> Option<&mut FuncCall>
Optionally returns mutable references to the inner fields if this is a ExprKind::FuncCall
, otherwise None
sourcepub fn as_func_call(&self) -> Option<&FuncCall>
pub fn as_func_call(&self) -> Option<&FuncCall>
Optionally returns references to the inner fields if this is a ExprKind::FuncCall
, otherwise None
sourcepub fn into_func_call(self) -> Result<FuncCall, Self>
pub fn into_func_call(self) -> Result<FuncCall, Self>
Returns the inner fields if this is a ExprKind::FuncCall
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_closure_mut(&mut self) -> Option<&mut Box<Closure>>
pub fn as_closure_mut(&mut self) -> Option<&mut Box<Closure>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Closure
, otherwise None
sourcepub fn as_closure(&self) -> Option<&Box<Closure>>
pub fn as_closure(&self) -> Option<&Box<Closure>>
Optionally returns references to the inner fields if this is a ExprKind::Closure
, otherwise None
sourcepub fn into_closure(self) -> Result<Box<Closure>, Self>
pub fn into_closure(self) -> Result<Box<Closure>, Self>
Returns the inner fields if this is a ExprKind::Closure
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_transform_call_mut(&mut self) -> Option<&mut TransformCall>
pub fn as_transform_call_mut(&mut self) -> Option<&mut TransformCall>
Optionally returns mutable references to the inner fields if this is a ExprKind::TransformCall
, otherwise None
sourcepub fn as_transform_call(&self) -> Option<&TransformCall>
pub fn as_transform_call(&self) -> Option<&TransformCall>
Optionally returns references to the inner fields if this is a ExprKind::TransformCall
, otherwise None
sourcepub fn into_transform_call(self) -> Result<TransformCall, Self>
pub fn into_transform_call(self) -> Result<TransformCall, Self>
Returns the inner fields if this is a ExprKind::TransformCall
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_s_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem>>
pub fn as_s_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem>>
Optionally returns mutable references to the inner fields if this is a ExprKind::SString
, otherwise None
sourcepub fn as_s_string(&self) -> Option<&Vec<InterpolateItem>>
pub fn as_s_string(&self) -> Option<&Vec<InterpolateItem>>
Optionally returns references to the inner fields if this is a ExprKind::SString
, otherwise None
sourcepub fn into_s_string(self) -> Result<Vec<InterpolateItem>, Self>
pub fn into_s_string(self) -> Result<Vec<InterpolateItem>, Self>
Returns the inner fields if this is a ExprKind::SString
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_f_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem>>
pub fn as_f_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem>>
Optionally returns mutable references to the inner fields if this is a ExprKind::FString
, otherwise None
sourcepub fn as_f_string(&self) -> Option<&Vec<InterpolateItem>>
pub fn as_f_string(&self) -> Option<&Vec<InterpolateItem>>
Optionally returns references to the inner fields if this is a ExprKind::FString
, otherwise None
sourcepub fn into_f_string(self) -> Result<Vec<InterpolateItem>, Self>
pub fn into_f_string(self) -> Result<Vec<InterpolateItem>, Self>
Returns the inner fields if this is a ExprKind::FString
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_switch_mut(&mut self) -> Option<&mut Vec<SwitchCase>>
pub fn as_switch_mut(&mut self) -> Option<&mut Vec<SwitchCase>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Switch
, otherwise None
sourcepub fn as_switch(&self) -> Option<&Vec<SwitchCase>>
pub fn as_switch(&self) -> Option<&Vec<SwitchCase>>
Optionally returns references to the inner fields if this is a ExprKind::Switch
, otherwise None
sourcepub fn into_switch(self) -> Result<Vec<SwitchCase>, Self>
pub fn into_switch(self) -> Result<Vec<SwitchCase>, Self>
Returns the inner fields if this is a ExprKind::Switch
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_built_in_function_mut(
&mut self
) -> Option<(&mut String, &mut Vec<Expr>)>
pub fn as_built_in_function_mut(
&mut self
) -> Option<(&mut String, &mut Vec<Expr>)>
Optionally returns mutable references to the inner fields if this is a ExprKind::BuiltInFunction
, otherwise None