Enum prqlc::ir::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),
    Loop(Vec<Transform>),
}
Expand description

Transformation of a table.

Variants§

§

From(TableRef)

§

Compute(Compute)

§

Select(Vec<CId>)

§

Filter(Expr)

§

Aggregate

Fields

§partition: Vec<CId>
§compute: Vec<CId>
§

Sort(Vec<ColumnSort<CId>>)

§

Take(Take)

§

Join

Fields

§filter: Expr
§

Append(TableRef)

§

Loop(Vec<Transform>)

Implementations§

source§

impl Transform

source

pub fn is_from(&self) -> bool

Returns true if this is a Transform::From, otherwise false

source

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

source

pub fn as_from(&self) -> Option<&TableRef>

Optionally returns references to the inner fields if this is a Transform::From, otherwise None

source

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

source

pub fn is_compute(&self) -> bool

Returns true if this is a Transform::Compute, otherwise false

source

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

source

pub fn as_compute(&self) -> Option<&Compute>

Optionally returns references to the inner fields if this is a Transform::Compute, otherwise None

source

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

source

pub fn is_select(&self) -> bool

Returns true if this is a Transform::Select, otherwise false

source

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

source

pub fn as_select(&self) -> Option<&Vec<CId>>

Optionally returns references to the inner fields if this is a Transform::Select, otherwise None

source

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

source

pub fn is_filter(&self) -> bool

Returns true if this is a Transform::Filter, otherwise false

source

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

source

pub fn as_filter(&self) -> Option<&Expr>

Optionally returns references to the inner fields if this is a Transform::Filter, otherwise None

source

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

source

pub fn is_aggregate(&self) -> bool

Returns true if this is a Transform::Aggregate, otherwise false

source

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

source

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

source

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

source

pub fn is_sort(&self) -> bool

Returns true if this is a Transform::Sort, otherwise false

source

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

source

pub fn as_sort(&self) -> Option<&Vec<ColumnSort<CId>>>

Optionally returns references to the inner fields if this is a Transform::Sort, otherwise None

source

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

source

pub fn is_take(&self) -> bool

Returns true if this is a Transform::Take, otherwise false

source

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

source

pub fn as_take(&self) -> Option<&Take>

Optionally returns references to the inner fields if this is a Transform::Take, otherwise None

source

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

source

pub fn is_join(&self) -> bool

Returns true if this is a Transform::Join, otherwise false

source

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

source

pub fn as_join(&self) -> Option<(&JoinSide, &TableRef, &Expr)>

Optionally returns references to the inner fields if this is a Transform::Join, otherwise None

source

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

source

pub fn is_append(&self) -> bool

Returns true if this is a Transform::Append, otherwise false

source

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

source

pub fn as_append(&self) -> Option<&TableRef>

Optionally returns references to the inner fields if this is a Transform::Append, otherwise None

source

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

source

pub fn is_loop(&self) -> bool

Returns true if this is a Transform::Loop, otherwise false

source

pub fn as_loop_mut(&mut self) -> Option<&mut Vec<Transform>>

Optionally returns mutable references to the inner fields if this is a Transform::Loop, otherwise None

source

pub fn as_loop(&self) -> Option<&Vec<Transform>>

Optionally returns references to the inner fields if this is a Transform::Loop, otherwise None

source

pub fn into_loop(self) -> Result<Vec<Transform>, Self>

Returns the inner fields if this is a Transform::Loop, otherwise returns back the enum in the Err case of the result

Trait Implementations§

source§

impl AsRef<str> for Transform

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Transform

source§

fn clone(&self) -> Transform

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transform

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Transform

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for Transform

source§

fn eq(&self, other: &Transform) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Transform

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Transform

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Chain<T> for T

§

fn len(&self) -> usize

The number of items that this chain link consists of.
§

fn append_to(self, v: &mut Vec<T>)

Append the elements in this link to the chain.
§

impl<T> Container<T> for T
where T: Clone,

§

type Iter = Once<T>

An iterator over the items within this container, by value.
§

fn get_iter(&self) -> <T as Container<T>>::Iter

Iterate over the elements of the container (using internal iteration because GATs are unstable).
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> OrderedContainer<T> for T
where T: Clone,