Skip to main content

AstLiteral

Enum AstLiteral 

Source
pub enum AstLiteral {
    Null,
    Integer(i128),
    Date(Date),
    DateAndTime(DateAndTime),
    TimeOfDay(TimeOfDay),
    Time(Time),
    Real(String),
    Bool(bool),
    String(StringValue),
    Array(Array),
}

Variants§

§

Null

a null literal used to initialize pointers

§

Integer(i128)

a literal that represents a whole number (e.g. 7)

§

Date(Date)

a literal that represents a date

§

DateAndTime(DateAndTime)

a literal that represents a date and time

§

TimeOfDay(TimeOfDay)

a literal that represents the time of day

§

Time(Time)

a literal that represents a time period

§

Real(String)

a literal that represents a real number (e.g. 7.0)

§

Bool(bool)

a literal that represents a boolean value (true, false)

§

String(StringValue)

a literal that represents a string

§

Array(Array)

a literal that represents an array

Implementations§

Source§

impl AstLiteral

Source

pub fn new_array(elements: Option<Box<AstNode>>) -> Self

Creates a new literal array

Source

pub fn new_integer(value: i128) -> Self

Creates a new literal integer

Source

pub fn new_real(value: String) -> Self

Creates a new literal real

Source

pub fn new_bool(value: bool) -> Self

Creates a new literal bool

Source

pub fn new_string(value: String, is_wide: bool) -> Self

Creates a new literal string

Source

pub fn new_date(year: i32, month: u32, day: u32) -> Self

Creates a new literal date

Source

pub fn new_date_with_long_flag( year: i32, month: u32, day: u32, is_long: bool, ) -> Self

Creates a new literal date with explicit width flavor

Source

pub fn new_date_and_time( year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, nano: u32, ) -> Self

Creates a new literal date and time

Source

pub fn new_long_date_and_time( year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, nano: u32, ) -> Self

Creates a new long literal date and time

Source

pub fn new_time_of_day(hour: u32, min: u32, sec: u32, nano: u32) -> Self

Creates a new literal time of day

Source

pub fn new_time_of_day_with_long_flag( hour: u32, min: u32, sec: u32, nano: u32, is_long: bool, ) -> Self

Creates a new literal time of day with explicit width flavor

Source

pub fn new_null() -> Self

Creates a new literal null

Source

pub fn get_literal_value(&self) -> String

Source

pub fn is_cast_prefix_eligible(&self) -> bool

Source

pub fn is_numerical(&self) -> bool

Source

pub fn is_zero(&self) -> bool

Source

pub fn get_literal_integer_value(&self) -> Option<i128>

Trait Implementations§

Source§

impl Clone for AstLiteral

Source§

fn clone(&self) -> AstLiteral

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AstLiteral

Source§

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

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

impl<'de> Deserialize<'de> for AstLiteral
where 'de: 'static,

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 AstLiteral

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AstLiteral

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<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime Array

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime Date

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime DateAndTime

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime String

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime StringValue

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime Time

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime TimeOfDay

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime bool

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for &'__deriveMoreLifetime i128

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstLiteral> for ()

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstLiteral>

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

fn try_from( value: &'__deriveMoreLifetime AstLiteral, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime AstStatement> for &'__deriveMoreLifetime AstLiteral

Source§

type Error = TryIntoError<&'__deriveMoreLifetime AstStatement>

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

fn try_from( value: &'__deriveMoreLifetime AstStatement, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut AstStatement> for &'__deriveMoreLifetime mut AstLiteral

Source§

type Error = TryIntoError<&'__deriveMoreLifetime mut AstStatement>

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

fn try_from( value: &'__deriveMoreLifetime mut AstStatement, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for ()

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for Array

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for Date

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for DateAndTime

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for String

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for StringValue

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for Time

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for TimeOfDay

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for bool

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstLiteral> for i128

Source§

type Error = TryIntoError<AstLiteral>

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

fn try_from(value: AstLiteral) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstStatement> for AstLiteral

Source§

type Error = TryIntoError<AstStatement>

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

fn try_from(value: AstStatement) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Walker for AstLiteral

Source§

fn walk<V>(&self, _visitor: &mut V)
where V: AstVisitor,

Source§

impl WalkerMut for AstLiteral

Source§

fn walk<V>(&mut self, _visitor: &mut V)
where V: AstVisitorMut,

Source§

impl StructuralPartialEq for AstLiteral

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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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,

Source§

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>,

Source§

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>,

Source§

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>,