Enum partiql_value::Value

source ·
pub enum Value {
    Null,
    Missing,
    Boolean(bool),
    Integer(i64),
    Real(OrderedFloat<f64>),
    Decimal(RustDecimal),
    String(Box<String>),
    Blob(Box<Vec<u8>>),
    DateTime(Box<DateTime>),
    List(Box<List>),
    Bag(Box<Bag>),
    Tuple(Box<Tuple>),
}

Variants§

§

Null

§

Missing

§

Boolean(bool)

§

Integer(i64)

§

Real(OrderedFloat<f64>)

§

Decimal(RustDecimal)

§

String(Box<String>)

§

Blob(Box<Vec<u8>>)

§

DateTime(Box<DateTime>)

§

List(Box<List>)

§

Bag(Box<Bag>)

§

Tuple(Box<Tuple>)

Implementations§

source§

impl Value

source

pub fn is_tuple(&self) -> bool

source

pub fn is_list(&self) -> bool

source

pub fn is_bag(&self) -> bool

source

pub fn is_number(&self) -> bool

Returns true if and only if Value is an integer, real, or decimal

source

pub fn is_null_or_missing(&self) -> bool

Returns true if and only if Value is null or missing

source

pub fn is_ordered(&self) -> bool

source

pub fn coerce_to_tuple(self) -> Tuple

source

pub fn as_tuple_ref(&self) -> Cow<'_, Tuple>

source

pub fn coerce_to_bag(self) -> Bag

source

pub fn as_bag_ref(&self) -> Cow<'_, Bag>

source

pub fn coerce_to_list(self) -> List

source

pub fn as_list_ref(&self) -> Cow<'_, List>

source

pub fn iter(&self) -> ValueIter<'_>

Trait Implementations§

source§

impl Add<&Value> for &Value

§

type Output = Value

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl BinaryAnd for Value

§

type Output = Value

source§

fn and(&self, rhs: &Self) -> Self::Output

source§

impl BinaryOr for Value

§

type Output = Value

source§

fn or(&self, rhs: &Self) -> Self::Output

source§

impl Clone for Value

source§

fn clone(&self) -> Value

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

impl Comparable for Value

source§

fn is_comparable_to(&self, rhs: &Self) -> bool

Returns true if and only if self is comparable to rhs

source§

impl Debug for Value

source§

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

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

impl Default for Value

source§

fn default() -> Value

Returns the “default value” for a type. Read more
source§

impl Div<&Value> for &Value

§

type Output = Value

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl Extend<Value> for Bag

source§

fn extend<Iter: IntoIterator<Item = Value>>(&mut self, iter: Iter)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Extend<Value> for List

source§

fn extend<Iter: IntoIterator<Item = Value>>(&mut self, iter: Iter)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T> From<&T> for Valuewhere T: Copy, Value: From<T>,

source§

fn from(t: &T) -> Self

Converts to this type from the input type.
source§

impl From<&str> for Value

source§

fn from(s: &str) -> Self

Converts to this type from the input type.
source§

impl From<Bag> for Value

source§

fn from(v: Bag) -> Self

Converts to this type from the input type.
source§

impl From<DateTime> for Value

source§

fn from(t: DateTime) -> Self

Converts to this type from the input type.
source§

impl From<Decimal> for Value

source§

fn from(d: RustDecimal) -> Self

Converts to this type from the input type.
source§

impl From<List> for Value

source§

fn from(v: List) -> Self

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(s: String) -> Self

Converts to this type from the input type.
source§

impl From<Tuple> for Value

source§

fn from(v: Tuple) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(b: bool) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(f: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(n: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(n: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(n: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(n: i8) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Value

source§

fn from(n: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for Value

source§

fn from(n: usize) -> Self

Converts to this type from the input type.
source§

impl Hash for Value

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 IntoIterator for Value

§

type Item = Value

The type of the elements being iterated over.
§

type IntoIter = ValueIntoIterator

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> ValueIntoIterator

Creates an iterator from a value. Read more
source§

impl Mul<&Value> for &Value

§

type Output = Value

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
source§

impl Neg for &Value

§

type Output = Value

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Neg for Value

§

type Output = Value

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Not for &Value

§

type Output = Value

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Not for Value

§

type Output = Value

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl NullableEq for Value

§

type Output = Value

source§

fn eq(&self, rhs: &Self) -> Self::Output

source§

fn neq(&self, rhs: &Self) -> Self::Output

source§

impl NullableOrd for Value

§

type Output = Value

source§

fn lt(&self, rhs: &Self) -> Self::Output

source§

fn gt(&self, rhs: &Self) -> Self::Output

source§

fn lteq(&self, rhs: &Self) -> Self::Output

source§

fn gteq(&self, rhs: &Self) -> Self::Output

source§

impl Ord for Value

Implementation of Spec’s order-by less-than

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Value> for Value

source§

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

impl PartialOrd<Value> for Value

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 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem<&Value> for &Value

§

type Output = Value

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
source§

impl Sub<&Value> for &Value

§

type Output = Value

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl UnaryPlus for Value

§

type Output = Value

source§

fn positive(self) -> Self::Output

source§

impl Eq for Value

source§

impl StructuralEq for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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 Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.