Enum prql_compiler::ast::rq::ExprKind
source · pub enum ExprKind {
ColumnRef(CId),
Literal(Literal),
Range(Range<Box<Expr>>),
Binary {
left: Box<Expr>,
op: BinOp,
right: Box<Expr>,
},
Unary {
op: UnOp,
expr: Box<Expr>,
},
SString(Vec<InterpolateItem<Expr>>),
FString(Vec<InterpolateItem<Expr>>),
}
Variants§
ColumnRef(CId)
Literal(Literal)
Range(Range<Box<Expr>>)
Binary
Unary
SString(Vec<InterpolateItem<Expr>>)
FString(Vec<InterpolateItem<Expr>>)
Implementations§
source§impl ExprKind
impl ExprKind
sourcepub fn as_column_ref_mut(&mut self) -> Option<&mut CId>
pub fn as_column_ref_mut(&mut self) -> Option<&mut CId>
Optionally returns mutable references to the inner fields if this is a ExprKind::ColumnRef
, otherwise None
sourcepub fn as_column_ref(&self) -> Option<&CId>
pub fn as_column_ref(&self) -> Option<&CId>
Optionally returns references to the inner fields if this is a ExprKind::ColumnRef
, otherwise None
sourcepub fn into_column_ref(self) -> Result<CId, Self>
pub fn into_column_ref(self) -> Result<CId, Self>
Returns the inner fields if this is a ExprKind::ColumnRef
, 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_range_mut(&mut self) -> Option<&mut Range<Box<Expr>>>
pub fn as_range_mut(&mut self) -> Option<&mut Range<Box<Expr>>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Range
, otherwise None
sourcepub fn as_range(&self) -> Option<&Range<Box<Expr>>>
pub fn as_range(&self) -> Option<&Range<Box<Expr>>>
Optionally returns references to the inner fields if this is a ExprKind::Range
, otherwise None
sourcepub fn into_range(self) -> Result<Range<Box<Expr>>, Self>
pub fn into_range(self) -> Result<Range<Box<Expr>>, 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_s_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem<Expr>>>
pub fn as_s_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem<Expr>>>
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<Expr>>>
pub fn as_s_string(&self) -> Option<&Vec<InterpolateItem<Expr>>>
Optionally returns references to the inner fields if this is a ExprKind::SString
, otherwise None
sourcepub fn into_s_string(self) -> Result<Vec<InterpolateItem<Expr>>, Self>
pub fn into_s_string(self) -> Result<Vec<InterpolateItem<Expr>>, 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<Expr>>>
pub fn as_f_string_mut(&mut self) -> Option<&mut Vec<InterpolateItem<Expr>>>
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<Expr>>>
pub fn as_f_string(&self) -> Option<&Vec<InterpolateItem<Expr>>>
Optionally returns references to the inner fields if this is a ExprKind::FString
, otherwise None
sourcepub fn into_f_string(self) -> Result<Vec<InterpolateItem<Expr>>, Self>
pub fn into_f_string(self) -> Result<Vec<InterpolateItem<Expr>>, Self>
Returns the inner fields if this is a ExprKind::FString
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
source§impl<'de> Deserialize<'de> for ExprKind
impl<'de> Deserialize<'de> for ExprKind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for ExprKind
Auto Trait Implementations§
impl RefUnwindSafe for ExprKind
impl Send for ExprKind
impl Sync for ExprKind
impl Unpin for ExprKind
impl UnwindSafe for ExprKind
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more