Enum Literal

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

Variants§

§

Null

§

Integer(i64)

§

Float(f64)

§

Boolean(bool)

§

String(String)

§

RawString(String)

§

Date(String)

§

Time(String)

§

Timestamp(String)

§

ValueAndUnit(ValueAndUnit)

Implementations§

Source§

impl Literal

Source

pub fn is_null(&self) -> bool

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

Source

pub fn is_integer(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Source

pub fn is_float(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Source

pub fn is_boolean(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Source

pub fn is_string(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Source

pub fn is_raw_string(&self) -> bool

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

Source

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

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

Source

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

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

Source

pub fn into_raw_string(self) -> Result<String, Self>

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

Source

pub fn is_date(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Source

pub fn is_time(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Source

pub fn is_timestamp(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Source

pub fn is_value_and_unit(&self) -> bool

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

Source

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

Source

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

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

Source

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

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

Trait Implementations§

Source§

impl AsRef<str> for Literal

Source§

fn as_ref(&self) -> &str

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

impl Clone for Literal

Source§

fn clone(&self) -> Literal

Returns a duplicate 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 Literal

Source§

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

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

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

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 Display for Literal

Source§

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

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

impl From<Literal> for ExprKind

Source§

fn from(value: Literal) -> Self

Converts to this type from the input type.
Source§

impl JsonSchema for Literal

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Literal

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Literal

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

impl<T> Chain<T> for T

Source§

fn len(&self) -> usize

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

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

Append the elements in this link to the chain.
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> Container<T> for T
where T: Clone,

Source§

type Iter = Once<T>

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

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

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

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

Source§

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