Enum prql_compiler::ast::pl::types::Ty

source ·
pub enum Ty {
    Empty,
    Literal(TyLit),
    Named(String),
    Parameterized(Box<Ty>, Box<Ty>),
    AnyOf(Vec<Ty>),
    Function(TyFunc),
    Table(Frame),
    Infer,
}

Variants§

§

Empty

§

Literal(TyLit)

§

Named(String)

§

Parameterized(Box<Ty>, Box<Ty>)

§

AnyOf(Vec<Ty>)

§

Function(TyFunc)

§

Table(Frame)

§

Infer

Means that we have no information about the type of the variable and that it should be inferred from other usages.

Implementations§

Returns true if this is a Ty::Empty, otherwise false

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

Optionally returns references to the inner fields if this is a Ty::Literal, otherwise None

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

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

Optionally returns references to the inner fields if this is a Ty::Named, otherwise None

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

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

Optionally returns references to the inner fields if this is a Ty::Parameterized, otherwise None

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

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

Optionally returns references to the inner fields if this is a Ty::AnyOf, otherwise None

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

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

Optionally returns references to the inner fields if this is a Ty::Function, otherwise None

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

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

Optionally returns references to the inner fields if this is a Ty::Table, otherwise None

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

Returns true if this is a Ty::Infer, otherwise false

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Implements a partial ordering or types:

  • higher up are types that include many others (AnyOf, Any) and
  • on the bottom are the atomic types (bool, string).
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
The number of items that this chain link consists of.
Append the elements in this link to the chain.
An iterator over the items within this container, by value.
Iterate over the elements of the container (using internal iteration because GATs are unstable).
Give this value the specified foreground colour
Give this value the specified background colour

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.