Enum Value

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

Source

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

Source

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

Trait Implementations§

Source§

impl Add for Value

Source§

type Output = Result<Value, ExecutionError>

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

Source§

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

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

impl Div for Value

Source§

type Output = Result<Value, ExecutionError>

The resulting type after applying the / operator.
Source§

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

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

Source§

fn from(val: Val) -> 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

Source§

type Output = Result<Value, ExecutionError>

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

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

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

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

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

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

impl Rem for Value

Source§

type Output = Result<Value, ExecutionError>

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl Sub for Value

Source§

type Output = Result<Value, ExecutionError>

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

Source§

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

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> AnyExt for T
where T: Any + ?Sized,

Source§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
Source§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
Source§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
Source§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
Source§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
Source§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
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, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

Source§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

Source§

fn coerce_box_to(self: Box<X>) -> Box<T>

Source§

fn coerce_ref_to(&self) -> &T

Source§

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

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