Skip to main content

ScalarValue

Enum ScalarValue 

Source
pub enum ScalarValue {
    Boolean(Option<bool>),
    Int8(Option<i8>),
    Int16(Option<i16>),
    Int32(Option<i32>),
    Int64(Option<i64>),
    UInt8(Option<u8>),
    UInt16(Option<u16>),
    UInt32(Option<u32>),
    UInt64(Option<u64>),
    Float32(Option<f32>),
    Float64(Option<f64>),
    Varchar(Option<String>),
}

Variants§

§

Boolean(Option<bool>)

§

Int8(Option<i8>)

§

Int16(Option<i16>)

§

Int32(Option<i32>)

§

Int64(Option<i64>)

§

UInt8(Option<u8>)

§

UInt16(Option<u16>)

§

UInt32(Option<u32>)

§

UInt64(Option<u64>)

§

Float32(Option<f32>)

§

Float64(Option<f64>)

§

Varchar(Option<String>)

Implementations§

Source§

impl ScalarValue

Source

pub fn new_empty(data_type: DataType) -> Self

Source

pub fn data_type(&self) -> DataType

Source

pub fn is_null(&self) -> bool

Source

pub fn cast_to(&self, data_type: &DataType) -> QuillSQLResult<Self>

Try to cast this value to a ScalarValue of type data_type

Source

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

Source

pub fn wrapping_add(&self, other: Self) -> QuillSQLResult<Self>

Source

pub fn wrapping_sub(&self, other: Self) -> QuillSQLResult<Self>

Source

pub fn wrapping_mul(&self, other: Self) -> QuillSQLResult<Self>

Source

pub fn wrapping_div(&self, other: Self) -> QuillSQLResult<Self>

Source

pub fn from_string(string: &str, data_type: DataType) -> QuillSQLResult<Self>

Trait Implementations§

Source§

impl Clone for ScalarValue

Source§

fn clone(&self) -> ScalarValue

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 ScalarValue

Source§

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

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

impl Display for ScalarValue

Source§

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

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

impl From<Option<String>> for ScalarValue

Source§

fn from(value: Option<String>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<bool>> for ScalarValue

Source§

fn from(value: Option<bool>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<f32>> for ScalarValue

Source§

fn from(value: Option<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<f64>> for ScalarValue

Source§

fn from(value: Option<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<i16>> for ScalarValue

Source§

fn from(value: Option<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<i32>> for ScalarValue

Source§

fn from(value: Option<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<i64>> for ScalarValue

Source§

fn from(value: Option<i64>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<i8>> for ScalarValue

Source§

fn from(value: Option<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<u16>> for ScalarValue

Source§

fn from(value: Option<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<u32>> for ScalarValue

Source§

fn from(value: Option<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<u64>> for ScalarValue

Source§

fn from(value: Option<u64>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<u8>> for ScalarValue

Source§

fn from(value: Option<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for ScalarValue

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for ScalarValue

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for ScalarValue

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for ScalarValue

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for ScalarValue

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for ScalarValue

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for ScalarValue

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for ScalarValue

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for ScalarValue

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for ScalarValue

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for ScalarValue

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for ScalarValue

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl Hash for ScalarValue

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ScalarValue

Source§

fn eq(&self, other: &Self) -> 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 PartialOrd for ScalarValue

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for ScalarValue

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> 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.