pub struct RecursiveValue(/* private fields */);
Expand description

A Valueable that can hold a list/dict mapping to other values.

Because of recursion limits in Rust, Value can not be implemented over itself. RecursiveValue is, for all intents and purposes, a Value implemented over itself.

If the basic Value enum is enough for your purposes, you will want to use RecursiveValue.

§Example

Instead of doing this:

use wagon_value::Value;

Do this:

use wagon_value::RecursiveValue as Value;

Trait Implementations§

source§

impl Add<RecursiveValue> for Value<RecursiveValue>

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<'a> Add<Value<RecursiveValue>> for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Clone for RecursiveValue

source§

fn clone(&self) -> RecursiveValue

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 RecursiveValue

source§

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

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

impl Deref for RecursiveValue

§

type Target = Value<RecursiveValue>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Display for RecursiveValue

source§

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

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

impl Div<RecursiveValue> for Value<RecursiveValue>

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<'a> Div<Value<RecursiveValue>> for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl From<RecursiveValue> for Value<RecursiveValue>

source§

fn from(value: RecursiveValue) -> Self

Converts to this type from the input type.
source§

impl From<Value<RecursiveValue>> for RecursiveValue

source§

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

Converts to this type from the input type.
source§

impl Hash for RecursiveValue

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 Mul<RecursiveValue> for Value<RecursiveValue>

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<'a> Mul<Value<RecursiveValue>> for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl PartialEq for RecursiveValue

source§

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

source§

fn partial_cmp(&self, other: &RecursiveValue) -> 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 Pow<RecursiveValue> for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The result after applying the operator.
source§

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

Returns self to the power rhs. Read more
source§

impl Pow<RecursiveValue> for Value<RecursiveValue>

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The result after applying the operator.
source§

fn pow(self, rhs: RecursiveValue) -> Self::Output

Returns self to the power rhs. Read more
source§

impl<'a> Pow<Value<RecursiveValue>> for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The result after applying the operator.
source§

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

Returns self to the power rhs. Read more
source§

impl Rem<RecursiveValue> for Value<RecursiveValue>

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl<'a> Rem<Value<RecursiveValue>> for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Sub<RecursiveValue> for Value<RecursiveValue>

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<'a> Sub<Value<RecursiveValue>> for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub for RecursiveValue

§

type Output = Result<RecursiveValue, ValueError<RecursiveValue>>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl ToValue<RecursiveValue> for RecursiveValue

source§

fn to_value(&self) -> &Value<Self>

Return a reference to the Value that this type encompasses.
source§

impl Eq for RecursiveValue

source§

impl StructuralPartialEq for RecursiveValue

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

source§

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

§

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> Valueable for T
where T: ToValue<T> + From<Value<T>> + Clone + Eq + PartialEq + PartialOrd + Debug + Display + Hash + Add + Sub + Mul + Div + Rem + Pow<T>,

source§

fn is_truthy(&self) -> Result<bool, ValueError<T>>

Is this value seen as true or false? Read more
source§

fn to_int(&self) -> Result<i32, ValueError<T>>

Convert the value to a regular i32. Read more
source§

fn to_float(&self) -> Result<f32, ValueError<T>>

Convert the value to a regular f32. Read more
source§

fn display_numerical(&self) -> Result<String, ValueError<T>>

Get a string representation of the value, as if it were a number. Read more
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>,