Enum prql_compiler::ir::pl::TransformKind
source · pub enum TransformKind {
Derive {
assigns: Box<Expr>,
},
Select {
assigns: Box<Expr>,
},
Filter {
filter: Box<Expr>,
},
Aggregate {
assigns: Box<Expr>,
},
Sort {
by: Vec<ColumnSort<Box<Expr>>>,
},
Take {
range: Range<Box<Expr>>,
},
Join {
side: JoinSide,
with: Box<Expr>,
filter: Box<Expr>,
},
Group {
by: Box<Expr>,
pipeline: Box<Expr>,
},
Window {
kind: WindowKind,
range: Range<Box<Expr>>,
pipeline: Box<Expr>,
},
Append(Box<Expr>),
Loop(Box<Expr>),
}
Variants§
Derive
Select
Filter
Aggregate
Sort
Fields
by: Vec<ColumnSort<Box<Expr>>>
Take
Join
Group
Window
Append(Box<Expr>)
Loop(Box<Expr>)
Implementations§
source§impl TransformKind
impl TransformKind
sourcepub fn is_derive(&self) -> bool
pub fn is_derive(&self) -> bool
Returns true if this is a TransformKind::Derive
, otherwise false
sourcepub fn as_derive_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_derive_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Derive
, otherwise None
sourcepub fn as_derive(&self) -> Option<&Box<Expr>>
pub fn as_derive(&self) -> Option<&Box<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Derive
, otherwise None
sourcepub fn into_derive(self) -> Result<Box<Expr>, TransformKind>
pub fn into_derive(self) -> Result<Box<Expr>, TransformKind>
Returns the inner fields if this is a TransformKind::Derive
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_select(&self) -> bool
pub fn is_select(&self) -> bool
Returns true if this is a TransformKind::Select
, otherwise false
sourcepub fn as_select_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_select_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Select
, otherwise None
sourcepub fn as_select(&self) -> Option<&Box<Expr>>
pub fn as_select(&self) -> Option<&Box<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Select
, otherwise None
sourcepub fn into_select(self) -> Result<Box<Expr>, TransformKind>
pub fn into_select(self) -> Result<Box<Expr>, TransformKind>
Returns the inner fields if this is a TransformKind::Select
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_filter(&self) -> bool
pub fn is_filter(&self) -> bool
Returns true if this is a TransformKind::Filter
, otherwise false
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>, TransformKind>
pub fn into_filter(self) -> Result<Box<Expr>, TransformKind>
Returns the inner fields if this is a TransformKind::Filter
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_aggregate(&self) -> bool
pub fn is_aggregate(&self) -> bool
Returns true if this is a TransformKind::Aggregate
, otherwise false
sourcepub fn as_aggregate_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_aggregate_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Aggregate
, otherwise None
sourcepub fn as_aggregate(&self) -> Option<&Box<Expr>>
pub fn as_aggregate(&self) -> Option<&Box<Expr>>
Optionally returns references to the inner fields if this is a TransformKind::Aggregate
, otherwise None
sourcepub fn into_aggregate(self) -> Result<Box<Expr>, TransformKind>
pub fn into_aggregate(self) -> Result<Box<Expr>, TransformKind>
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<Box<Expr>>>>
pub fn as_sort_mut(&mut self) -> Option<&mut Vec<ColumnSort<Box<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<Box<Expr>>>>
pub fn as_sort(&self) -> Option<&Vec<ColumnSort<Box<Expr>>>>
Optionally returns references to the inner fields if this is a TransformKind::Sort
, otherwise None
sourcepub fn into_sort(self) -> Result<Vec<ColumnSort<Box<Expr>>>, TransformKind>
pub fn into_sort(self) -> Result<Vec<ColumnSort<Box<Expr>>>, TransformKind>
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<Box<Expr>>>
pub fn as_take_mut(&mut self) -> Option<&mut Range<Box<Expr>>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Take
, otherwise None
sourcepub fn as_take(&self) -> Option<&Range<Box<Expr>>>
pub fn as_take(&self) -> Option<&Range<Box<Expr>>>
Optionally returns references to the inner fields if this is a TransformKind::Take
, otherwise None
sourcepub fn into_take(self) -> Result<Range<Box<Expr>>, TransformKind>
pub fn into_take(self) -> Result<Range<Box<Expr>>, TransformKind>
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>), TransformKind>
pub fn into_join( self ) -> Result<(JoinSide, Box<Expr>, Box<Expr>), TransformKind>
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 Box<Expr>, &mut Box<Expr>)>
pub fn as_group_mut(&mut self) -> Option<(&mut Box<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<(&Box<Expr>, &Box<Expr>)>
pub fn as_group(&self) -> Option<(&Box<Expr>, &Box<Expr>)>
Optionally returns references to the inner fields if this is a TransformKind::Group
, otherwise None
sourcepub fn into_group(self) -> Result<(Box<Expr>, Box<Expr>), TransformKind>
pub fn into_group(self) -> Result<(Box<Expr>, Box<Expr>), TransformKind>
Returns the inner fields if this is a TransformKind::Group
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_window(&self) -> bool
pub fn is_window(&self) -> bool
Returns true if this is a TransformKind::Window
, otherwise false
sourcepub fn as_window_mut(
&mut self
) -> Option<(&mut WindowKind, &mut Range<Box<Expr>>, &mut Box<Expr>)>
pub fn as_window_mut( &mut self ) -> Option<(&mut WindowKind, &mut Range<Box<Expr>>, &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>>, &Box<Expr>)>
pub fn as_window(&self) -> Option<(&WindowKind, &Range<Box<Expr>>, &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>>, Box<Expr>), TransformKind>
pub fn into_window( self ) -> Result<(WindowKind, Range<Box<Expr>>, Box<Expr>), TransformKind>
Returns the inner fields if this is a TransformKind::Window
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_append(&self) -> bool
pub fn is_append(&self) -> bool
Returns true if this is a TransformKind::Append
, otherwise false
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>, TransformKind>
pub fn into_append(self) -> Result<Box<Expr>, TransformKind>
Returns the inner fields if this is a TransformKind::Append
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_loop_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_loop_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TransformKind::Loop
, otherwise None
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<TransformKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TransformKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for TransformKind
impl PartialEq 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 ==
.