Enum prql_compiler::ast::pl::expr::TransformKind
source · pub enum TransformKind {
Derive {
assigns: Vec<Expr>,
},
Select {
assigns: Vec<Expr>,
},
Filter {
filter: Box<Expr>,
},
Aggregate {
assigns: Vec<Expr>,
},
Sort {
by: Vec<ColumnSort<Expr>>,
},
Take {
range: Range,
},
Join {
side: JoinSide,
with: Box<Expr>,
filter: Box<Expr>,
},
Group {
by: Vec<Expr>,
pipeline: Box<Expr>,
},
Window {
kind: WindowKind,
range: Range,
pipeline: Box<Expr>,
},
Append(Box<Expr>),
}
Variants§
Derive
Select
Filter
Aggregate
Sort
Fields
by: Vec<ColumnSort<Expr>>
Take
Join
Group
Window
Append(Box<Expr>)
Implementations§
source§impl TransformKind
impl TransformKind
sourcepub fn as_derive_mut(&mut self) -> Option<&mut Vec<Expr>>
pub fn as_derive_mut(&mut self) -> Option<&mut Vec<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Derive
, otherwise None
sourcepub fn as_derive(&self) -> Option<&Vec<Expr>>
pub fn as_derive(&self) -> Option<&Vec<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Derive
, otherwise None
sourcepub fn into_derive(self) -> Result<Vec<Expr>, Self>
pub fn into_derive(self) -> Result<Vec<Expr>, Self>
Returns the inner fields if this is a TransformKind::Derive
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_select_mut(&mut self) -> Option<&mut Vec<Expr>>
pub fn as_select_mut(&mut self) -> Option<&mut Vec<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Select
, otherwise None
sourcepub fn as_select(&self) -> Option<&Vec<Expr>>
pub fn as_select(&self) -> Option<&Vec<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Select
, otherwise None
sourcepub fn into_select(self) -> Result<Vec<Expr>, Self>
pub fn into_select(self) -> Result<Vec<Expr>, Self>
Returns the inner fields if this is a TransformKind::Select
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_filter_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_filter_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Filter
, otherwise None
sourcepub fn as_filter(&self) -> Option<&Box<Expr>>
pub fn as_filter(&self) -> Option<&Box<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Filter
, otherwise None
sourcepub fn into_filter(self) -> Result<Box<Expr>, Self>
pub fn into_filter(self) -> Result<Box<Expr>, Self>
Returns the inner fields if this is a TransformKind::Filter
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_aggregate_mut(&mut self) -> Option<&mut Vec<Expr>>
pub fn as_aggregate_mut(&mut self) -> Option<&mut Vec<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Aggregate
, otherwise None
sourcepub fn as_aggregate(&self) -> Option<&Vec<Expr>>
pub fn as_aggregate(&self) -> Option<&Vec<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Aggregate
, otherwise None
sourcepub fn into_aggregate(self) -> Result<Vec<Expr>, Self>
pub fn into_aggregate(self) -> Result<Vec<Expr>, Self>
Returns the inner fields if this is a TransformKind::Aggregate
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_sort_mut(&mut self) -> Option<&mut Vec<ColumnSort<Expr>>>
pub fn as_sort_mut(&mut self) -> Option<&mut Vec<ColumnSort<Expr>>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Sort
, otherwise None
sourcepub fn as_sort(&self) -> Option<&Vec<ColumnSort<Expr>>>
pub fn as_sort(&self) -> Option<&Vec<ColumnSort<Expr>>>
Optionally returns references to the inner fields if this is a TransformKind::Sort
, otherwise None
sourcepub fn into_sort(self) -> Result<Vec<ColumnSort<Expr>>, Self>
pub fn into_sort(self) -> Result<Vec<ColumnSort<Expr>>, Self>
Returns the inner fields if this is a TransformKind::Sort
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_take_mut(&mut self) -> Option<&mut Range>
pub fn as_take_mut(&mut self) -> Option<&mut Range>
Optionally returns mutable references to the inner fields if this is a TransformKind::Take
, otherwise None
sourcepub fn as_take(&self) -> Option<&Range>
pub fn as_take(&self) -> Option<&Range>
Optionally returns references to the inner fields if this is a TransformKind::Take
, otherwise None
sourcepub fn into_take(self) -> Result<Range, Self>
pub fn into_take(self) -> Result<Range, Self>
Returns the inner fields if this is a TransformKind::Take
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_join_mut(
&mut self
) -> Option<(&mut JoinSide, &mut Box<Expr>, &mut Box<Expr>)>
pub fn as_join_mut(
&mut self
) -> Option<(&mut JoinSide, &mut Box<Expr>, &mut Box<Expr>)>
Optionally returns mutable references to the inner fields if this is a TransformKind::Join
, otherwise None
sourcepub fn as_join(&self) -> Option<(&JoinSide, &Box<Expr>, &Box<Expr>)>
pub fn as_join(&self) -> Option<(&JoinSide, &Box<Expr>, &Box<Expr>)>
Optionally returns references to the inner fields if this is a TransformKind::Join
, otherwise None
sourcepub fn into_join(self) -> Result<(JoinSide, Box<Expr>, Box<Expr>), Self>
pub fn into_join(self) -> Result<(JoinSide, Box<Expr>, Box<Expr>), Self>
Returns the inner fields if this is a TransformKind::Join
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_group_mut(&mut self) -> Option<(&mut Vec<Expr>, &mut Box<Expr>)>
pub fn as_group_mut(&mut self) -> Option<(&mut Vec<Expr>, &mut Box<Expr>)>
Optionally returns mutable references to the inner fields if this is a TransformKind::Group
, otherwise None
sourcepub fn as_group(&self) -> Option<(&Vec<Expr>, &Box<Expr>)>
pub fn as_group(&self) -> Option<(&Vec<Expr>, &Box<Expr>)>
Optionally returns references to the inner fields if this is a TransformKind::Group
, otherwise None
sourcepub fn into_group(self) -> Result<(Vec<Expr>, Box<Expr>), Self>
pub fn into_group(self) -> Result<(Vec<Expr>, Box<Expr>), Self>
Returns the inner fields if this is a TransformKind::Group
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_window_mut(
&mut self
) -> Option<(&mut WindowKind, &mut Range, &mut Box<Expr>)>
pub fn as_window_mut(
&mut self
) -> Option<(&mut WindowKind, &mut Range, &mut Box<Expr>)>
Optionally returns mutable references to the inner fields if this is a TransformKind::Window
, otherwise None
sourcepub fn as_window(&self) -> Option<(&WindowKind, &Range, &Box<Expr>)>
pub fn as_window(&self) -> Option<(&WindowKind, &Range, &Box<Expr>)>
Optionally returns references to the inner fields if this is a TransformKind::Window
, otherwise None
sourcepub fn into_window(self) -> Result<(WindowKind, Range, Box<Expr>), Self>
pub fn into_window(self) -> Result<(WindowKind, Range, Box<Expr>), Self>
Returns the inner fields if this is a TransformKind::Window
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_append_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_append_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Append
, otherwise None
sourcepub fn as_append(&self) -> Option<&Box<Expr>>
pub fn as_append(&self) -> Option<&Box<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Append
, otherwise None
sourcepub fn into_append(self) -> Result<Box<Expr>, Self>
pub fn into_append(self) -> Result<Box<Expr>, Self>
Returns the inner fields if this is a TransformKind::Append
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
source§impl AsRef<str> for TransformKind
impl AsRef<str> for TransformKind
source§impl Clone for TransformKind
impl Clone for TransformKind
source§fn clone(&self) -> TransformKind
fn clone(&self) -> TransformKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TransformKind
impl Debug for TransformKind
source§impl<'de> Deserialize<'de> for TransformKind
impl<'de> Deserialize<'de> for TransformKind
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>,
source§impl From<TransformKind> for Error
impl From<TransformKind> for Error
source§fn from(kind: TransformKind) -> Self
fn from(kind: TransformKind) -> Self
source§impl PartialEq<TransformKind> for TransformKind
impl PartialEq<TransformKind> for TransformKind
source§fn eq(&self, other: &TransformKind) -> bool
fn eq(&self, other: &TransformKind) -> bool
self
and other
values to be equal, and is used
by ==
.