pub enum Value {
    List(Arc<Vec<Value>>),
    Map(Map),
    Function(Arc<String>, Option<Box<Value>>),
    Int(i64),
    UInt(u64),
    Float(f64),
    String(Arc<String>),
    Bytes(Arc<Vec<u8>>),
    Bool(bool),
    Duration(Duration),
    Timestamp(DateTime<FixedOffset>),
    Null,
}

Variants§

§

List(Arc<Vec<Value>>)

§

Map(Map)

§

Function(Arc<String>, Option<Box<Value>>)

§

Int(i64)

§

UInt(u64)

§

Float(f64)

§

String(Arc<String>)

§

Bytes(Arc<Vec<u8>>)

§

Bool(bool)

§

Duration(Duration)

§

Timestamp(DateTime<FixedOffset>)

§

Null

Implementations§

source§

impl Value

source

pub fn type_of(&self) -> ValueType

source

pub fn error_expected_type(&self, expected: ValueType) -> ExecutionError

source§

impl<'a> Value

source

pub fn resolve_all(expr: &[Expression], ctx: &Context<'_>) -> ResolveResult

source

pub fn resolve(expr: &'a Expression, ctx: &Context<'_>) -> ResolveResult

Trait Implementations§

source§

impl Add for Value

§

type Output = Value

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
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 Debug for Value

source§

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

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

impl Div for Value

§

type Output = Value

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl From<&Atom> for Value

source§

fn from(atom: &Atom) -> Self

Converts to this type from the input type.
source§

impl From<&Key> for Value

source§

fn from(value: &Key) -> Self

Converts to this type from the input type.
source§

impl From<&Value> for Value

source§

fn from(value: &Value) -> Self

Converts to this type from the input type.
source§

impl From<&str> for Value

source§

fn from(v: &str) -> Self

Converts to this type from the input type.
source§

impl From<Arc<String>> for Value

source§

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

Converts to this type from the input type.
source§

impl From<Arc<Vec<Value>>> for Value

source§

fn from(value: Arc<Vec<Value>>) -> Self

Converts to this type from the input type.
source§

impl From<Arc<Vec<u8>>> for Value

source§

fn from(value: Arc<Vec<u8>>) -> Self

Converts to this type from the input type.
source§

impl From<DateTime<FixedOffset>> for Value

source§

fn from(value: DateTime<FixedOffset>) -> Self

Converts to this type from the input type.
source§

impl<K: Into<Key>, V: Into<Value>> From<HashMap<K, V>> for Value

source§

fn from(v: HashMap<K, V>) -> Self

Converts to this type from the input type.
source§

impl From<Key> for Value

source§

fn from(value: Key) -> Self

Converts to this type from the input type.
source§

impl<T: Into<Value>> From<Option<T>> for Value

source§

fn from(v: Option<T>) -> Self

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(v: String) -> Self

Converts to this type from the input type.
source§

impl From<TimeDelta> for Value

source§

fn from(value: Duration) -> Self

Converts to this type from the input type.
source§

impl From<Value> for ResolveResult

source§

fn from(value: Value) -> Self

Converts to this type from the input type.
source§

impl<T: Into<Value>> From<Vec<T>> for Value

source§

fn from(v: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Value

source§

fn from(v: Vec<u8>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl Mul for Value

§

type Output = Value

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl PartialEq for Value

source§

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

§

type Output = Value

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Serialize for Value

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: SerdeSerializer,

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

impl Sub for Value

§

type Output = Value

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl TryInto<Key> for Value

Implement conversions from Key into Value

§

type Error = Value

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

fn try_into(self) -> Result<Key, Self::Error>

Performs the conversion.
source§

impl Eq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

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 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> 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, 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> TryIntoValue for T
where T: Serialize,

§

type Error = SerializationError

source§

fn try_into_value(self) -> Result<Value, <T as TryIntoValue>::Error>

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,