Enum prql_compiler::ast::rq::Transform
source · pub enum Transform {
From(TableRef),
Compute(Compute),
Select(Vec<CId>),
Filter(Expr),
Aggregate {
partition: Vec<CId>,
compute: Vec<CId>,
},
Sort(Vec<ColumnSort<CId>>),
Take(Take),
Join {
side: JoinSide,
with: TableRef,
filter: Expr,
},
Append(TableRef),
}
Expand description
Transformation of a table.
Variants§
From(TableRef)
Compute(Compute)
Select(Vec<CId>)
Filter(Expr)
Aggregate
Sort(Vec<ColumnSort<CId>>)
Take(Take)
Join
Append(TableRef)
Implementations§
source§impl Transform
impl Transform
sourcepub fn as_from_mut(&mut self) -> Option<&mut TableRef>
pub fn as_from_mut(&mut self) -> Option<&mut TableRef>
Optionally returns mutable references to the inner fields if this is a Transform::From
, otherwise None
sourcepub fn as_from(&self) -> Option<&TableRef>
pub fn as_from(&self) -> Option<&TableRef>
Optionally returns references to the inner fields if this is a Transform::From
, otherwise None
sourcepub fn into_from(self) -> Result<TableRef, Self>
pub fn into_from(self) -> Result<TableRef, Self>
Returns the inner fields if this is a Transform::From
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_compute_mut(&mut self) -> Option<&mut Compute>
pub fn as_compute_mut(&mut self) -> Option<&mut Compute>
Optionally returns mutable references to the inner fields if this is a Transform::Compute
, otherwise None
sourcepub fn as_compute(&self) -> Option<&Compute>
pub fn as_compute(&self) -> Option<&Compute>
Optionally returns references to the inner fields if this is a Transform::Compute
, otherwise None
sourcepub fn into_compute(self) -> Result<Compute, Self>
pub fn into_compute(self) -> Result<Compute, Self>
Returns the inner fields if this is a Transform::Compute
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_select_mut(&mut self) -> Option<&mut Vec<CId>>
pub fn as_select_mut(&mut self) -> Option<&mut Vec<CId>>
Optionally returns mutable references to the inner fields if this is a Transform::Select
, otherwise None
sourcepub fn as_select(&self) -> Option<&Vec<CId>>
pub fn as_select(&self) -> Option<&Vec<CId>>
Optionally returns references to the inner fields if this is a Transform::Select
, otherwise None
sourcepub fn into_select(self) -> Result<Vec<CId>, Self>
pub fn into_select(self) -> Result<Vec<CId>, Self>
Returns the inner fields if this is a Transform::Select
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_filter_mut(&mut self) -> Option<&mut Expr>
pub fn as_filter_mut(&mut self) -> Option<&mut Expr>
Optionally returns mutable references to the inner fields if this is a Transform::Filter
, otherwise None
sourcepub fn as_filter(&self) -> Option<&Expr>
pub fn as_filter(&self) -> Option<&Expr>
Optionally returns references to the inner fields if this is a Transform::Filter
, otherwise None
sourcepub fn into_filter(self) -> Result<Expr, Self>
pub fn into_filter(self) -> Result<Expr, Self>
Returns the inner fields if this is a Transform::Filter
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_aggregate_mut(&mut self) -> Option<(&mut Vec<CId>, &mut Vec<CId>)>
pub fn as_aggregate_mut(&mut self) -> Option<(&mut Vec<CId>, &mut Vec<CId>)>
Optionally returns mutable references to the inner fields if this is a Transform::Aggregate
, otherwise None
sourcepub fn as_aggregate(&self) -> Option<(&Vec<CId>, &Vec<CId>)>
pub fn as_aggregate(&self) -> Option<(&Vec<CId>, &Vec<CId>)>
Optionally returns references to the inner fields if this is a Transform::Aggregate
, otherwise None
sourcepub fn into_aggregate(self) -> Result<(Vec<CId>, Vec<CId>), Self>
pub fn into_aggregate(self) -> Result<(Vec<CId>, Vec<CId>), Self>
Returns the inner fields if this is a Transform::Aggregate
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_sort_mut(&mut self) -> Option<&mut Vec<ColumnSort<CId>>>
pub fn as_sort_mut(&mut self) -> Option<&mut Vec<ColumnSort<CId>>>
Optionally returns mutable references to the inner fields if this is a Transform::Sort
, otherwise None
sourcepub fn as_sort(&self) -> Option<&Vec<ColumnSort<CId>>>
pub fn as_sort(&self) -> Option<&Vec<ColumnSort<CId>>>
Optionally returns references to the inner fields if this is a Transform::Sort
, otherwise None
sourcepub fn into_sort(self) -> Result<Vec<ColumnSort<CId>>, Self>
pub fn into_sort(self) -> Result<Vec<ColumnSort<CId>>, Self>
Returns the inner fields if this is a Transform::Sort
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_take_mut(&mut self) -> Option<&mut Take>
pub fn as_take_mut(&mut self) -> Option<&mut Take>
Optionally returns mutable references to the inner fields if this is a Transform::Take
, otherwise None
sourcepub fn as_take(&self) -> Option<&Take>
pub fn as_take(&self) -> Option<&Take>
Optionally returns references to the inner fields if this is a Transform::Take
, otherwise None
sourcepub fn into_take(self) -> Result<Take, Self>
pub fn into_take(self) -> Result<Take, Self>
Returns the inner fields if this is a Transform::Take
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_join_mut(
&mut self
) -> Option<(&mut JoinSide, &mut TableRef, &mut Expr)>
pub fn as_join_mut(
&mut self
) -> Option<(&mut JoinSide, &mut TableRef, &mut Expr)>
Optionally returns mutable references to the inner fields if this is a Transform::Join
, otherwise None
sourcepub fn as_join(&self) -> Option<(&JoinSide, &TableRef, &Expr)>
pub fn as_join(&self) -> Option<(&JoinSide, &TableRef, &Expr)>
Optionally returns references to the inner fields if this is a Transform::Join
, otherwise None
sourcepub fn into_join(self) -> Result<(JoinSide, TableRef, Expr), Self>
pub fn into_join(self) -> Result<(JoinSide, TableRef, Expr), Self>
Returns the inner fields if this is a Transform::Join
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_append_mut(&mut self) -> Option<&mut TableRef>
pub fn as_append_mut(&mut self) -> Option<&mut TableRef>
Optionally returns mutable references to the inner fields if this is a Transform::Append
, otherwise None
sourcepub fn as_append(&self) -> Option<&TableRef>
pub fn as_append(&self) -> Option<&TableRef>
Optionally returns references to the inner fields if this is a Transform::Append
, otherwise None
sourcepub fn into_append(self) -> Result<TableRef, Self>
pub fn into_append(self) -> Result<TableRef, Self>
Returns the inner fields if this is a Transform::Append
, otherwise returns back the enum in the Err
case of the result