Enum wagon_value::Value
source · pub enum Value<T: Valueable> {
Bool(bool),
String(String),
Natural(i32),
Float(NotNan<f32>),
Dict(BTreeMap<String, T>),
Array(Vec<T>),
}
Expand description
The most basic types that a value can ever be.
For recursion reasons, this type is generic over any other type that can be seen as a Value (see Valueable
).
Variants§
Bool(bool)
A bool.
String(String)
A string.
Natural(i32)
A whole number.
Float(NotNan<f32>)
A float.
Dict(BTreeMap<String, T>)
A dictionary.
Array(Vec<T>)
A list.
Trait Implementations§
source§impl Add<RecursiveValue> for Value<RecursiveValue>
impl Add<RecursiveValue> for Value<RecursiveValue>
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
+
operator.source§impl<'a> Add<Value<RecursiveValue>> for RecursiveValue
impl<'a> Add<Value<RecursiveValue>> for RecursiveValue
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
+
operator.source§impl Div<RecursiveValue> for Value<RecursiveValue>
impl Div<RecursiveValue> for Value<RecursiveValue>
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
/
operator.source§impl<'a> Div<Value<RecursiveValue>> for RecursiveValue
impl<'a> Div<Value<RecursiveValue>> for RecursiveValue
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
/
operator.source§impl From<RecursiveValue> for Value<RecursiveValue>
impl From<RecursiveValue> for Value<RecursiveValue>
source§fn from(value: RecursiveValue) -> Self
fn from(value: RecursiveValue) -> Self
Converts to this type from the input type.
source§impl From<Value<RecursiveValue>> for RecursiveValue
impl From<Value<RecursiveValue>> for RecursiveValue
source§impl Mul<RecursiveValue> for Value<RecursiveValue>
impl Mul<RecursiveValue> for Value<RecursiveValue>
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
*
operator.source§impl<'a> Mul<Value<RecursiveValue>> for RecursiveValue
impl<'a> Mul<Value<RecursiveValue>> for RecursiveValue
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
*
operator.source§impl<T: PartialEq + Valueable> PartialEq for Value<T>
impl<T: PartialEq + Valueable> PartialEq for Value<T>
source§impl<T: Valueable> PartialOrd for Value<T>
impl<T: Valueable> PartialOrd for Value<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl Pow<RecursiveValue> for Value<RecursiveValue>
impl Pow<RecursiveValue> for Value<RecursiveValue>
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The result after applying the operator.
source§impl<'a> Pow<Value<RecursiveValue>> for RecursiveValue
impl<'a> Pow<Value<RecursiveValue>> for RecursiveValue
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The result after applying the operator.
source§impl Rem<RecursiveValue> for Value<RecursiveValue>
impl Rem<RecursiveValue> for Value<RecursiveValue>
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
%
operator.source§impl<'a> Rem<Value<RecursiveValue>> for RecursiveValue
impl<'a> Rem<Value<RecursiveValue>> for RecursiveValue
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
%
operator.source§impl Sub<RecursiveValue> for Value<RecursiveValue>
impl Sub<RecursiveValue> for Value<RecursiveValue>
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
-
operator.source§impl<'a> Sub<Value<RecursiveValue>> for RecursiveValue
impl<'a> Sub<Value<RecursiveValue>> for RecursiveValue
§type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
type Output = Result<RecursiveValue, ValueError<RecursiveValue>>
The resulting type after applying the
-
operator.source§impl<T: Valueable> Valueable for Value<T>
impl<T: Valueable> Valueable for Value<T>
source§fn display_numerical(&self) -> ValueResult<String, Self>
fn display_numerical(&self) -> ValueResult<String, Self>
Get a string representation of the value, as if it were a number. Read more
impl<T: Eq + Valueable> Eq for Value<T>
impl<T: Valueable> StructuralPartialEq for Value<T>
Auto Trait Implementations§
impl<T> Freeze for Value<T>
impl<T> RefUnwindSafe for Value<T>where
T: RefUnwindSafe,
impl<T> Send for Value<T>where
T: Send,
impl<T> Sync for Value<T>where
T: Sync,
impl<T> Unpin for Value<T>where
T: Unpin,
impl<T> UnwindSafe for Value<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more