Enum prql_compiler::ir::pl::Literal

pub enum Literal {
    Null,
    Integer(i64),
    Float(f64),
    Boolean(bool),
    String(String),
    Date(String),
    Time(String),
    Timestamp(String),
    ValueAndUnit(ValueAndUnit),
}

Variants§

§

Null

§

Integer(i64)

§

Float(f64)

§

Boolean(bool)

§

String(String)

§

Date(String)

§

Time(String)

§

Timestamp(String)

§

ValueAndUnit(ValueAndUnit)

Implementations§

§

impl Literal

pub fn is_null(&self) -> bool

Returns true if this is a Literal::Null, otherwise false

pub fn is_integer(&self) -> bool

Returns true if this is a Literal::Integer, otherwise false

pub fn as_integer_mut(&mut self) -> Option<&mut i64>

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

pub fn as_integer(&self) -> Option<&i64>

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

pub fn into_integer(self) -> Result<i64, Literal>

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

pub fn is_float(&self) -> bool

Returns true if this is a Literal::Float, otherwise false

pub fn as_float_mut(&mut self) -> Option<&mut f64>

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

pub fn as_float(&self) -> Option<&f64>

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

pub fn into_float(self) -> Result<f64, Literal>

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

pub fn is_boolean(&self) -> bool

Returns true if this is a Literal::Boolean, otherwise false

pub fn as_boolean_mut(&mut self) -> Option<&mut bool>

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

pub fn as_boolean(&self) -> Option<&bool>

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

pub fn into_boolean(self) -> Result<bool, Literal>

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

pub fn is_string(&self) -> bool

Returns true if this is a Literal::String, otherwise false

pub fn as_string_mut(&mut self) -> Option<&mut String>

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

pub fn as_string(&self) -> Option<&String>

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

pub fn into_string(self) -> Result<String, Literal>

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

pub fn is_date(&self) -> bool

Returns true if this is a Literal::Date, otherwise false

pub fn as_date_mut(&mut self) -> Option<&mut String>

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

pub fn as_date(&self) -> Option<&String>

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

pub fn into_date(self) -> Result<String, Literal>

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

pub fn is_time(&self) -> bool

Returns true if this is a Literal::Time, otherwise false

pub fn as_time_mut(&mut self) -> Option<&mut String>

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

pub fn as_time(&self) -> Option<&String>

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

pub fn into_time(self) -> Result<String, Literal>

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

pub fn is_timestamp(&self) -> bool

Returns true if this is a Literal::Timestamp, otherwise false

pub fn as_timestamp_mut(&mut self) -> Option<&mut String>

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

pub fn as_timestamp(&self) -> Option<&String>

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

pub fn into_timestamp(self) -> Result<String, Literal>

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

pub fn is_value_and_unit(&self) -> bool

Returns true if this is a Literal::ValueAndUnit, otherwise false

pub fn as_value_and_unit_mut(&mut self) -> Option<&mut ValueAndUnit>

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

pub fn as_value_and_unit(&self) -> Option<&ValueAndUnit>

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

pub fn into_value_and_unit(self) -> Result<ValueAndUnit, Literal>

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

Trait Implementations§

§

impl AsRef<str> for Literal

§

fn as_ref(&self) -> &str

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

impl Clone for Literal

§

fn clone(&self) -> Literal

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
§

impl Debug for Literal

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Literal

§

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

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

impl Display for Literal

§

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

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

impl From<Literal> for ExprKind

source§

fn from(value: Literal) -> ExprKind

Converts to this type from the input type.
§

impl From<Literal> for ExprKind

§

fn from(value: Literal) -> ExprKind

Converts to this type from the input type.
§

impl From<Literal> for TyKind

§

fn from(value: Literal) -> TyKind

Converts to this type from the input type.
§

impl PartialEq for Literal

§

fn eq(&self, other: &Literal) -> 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.
§

impl Serialize for Literal

§

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

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

impl StructuralPartialEq for Literal

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).
§

impl<T> Fmt for T
where T: Display,

§

fn fg<C>(self, color: C) -> Foreground<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified foreground colour.
§

fn bg<C>(self, color: C) -> Background<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified background colour.
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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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,