Enum lovm2::value::Value [−][src]
Runtime representation of values
Variants
Bool(bool)
Int(i64)
Float(f64)
Str(String)
Dict(IndexMap<Value, Value, RandomState>)
Ref(Reference)
Implementations
impl Value
[src]
pub fn conv(self, ty: ValueType) -> Result<Value, Lovm2Error>
[src]
Try converting the value into given type.
pub fn cast_inplace(&mut self, ty: ValueType) -> Result<(), Lovm2Error>
[src]
Try converting the value into given type and update inplace.
pub fn as_bool(&self) -> Result<Value, Lovm2Error>
[src]
Try turning a value into Bool
.
pub fn as_float(&self) -> Result<Value, Lovm2Error>
[src]
Try turning a value into Float
.
pub fn as_integer(&self) -> Result<Value, Lovm2Error>
[src]
Try turning a value into Int
.
pub fn as_integer_round(&self) -> Result<Value, Lovm2Error>
[src]
Try turning a value into Int
while doing correct float rounding.
pub fn as_str(&self) -> Result<Value, Lovm2Error>
[src]
Try turning a value into Str
.
pub fn as_any_inner(&self) -> Result<Rc<RefCell<Handle>>, Lovm2Error>
[src]
Try getting the contained AnyRef
.
pub fn as_bool_inner(&self) -> Result<bool, Lovm2Error>
[src]
Try turning a value into a Rust bool
.
pub fn as_float_inner(&self) -> Result<f64, Lovm2Error>
[src]
Try turning a value into a Rust f64
.
pub fn as_integer_inner(&self) -> Result<i64, Lovm2Error>
[src]
Try turning a value into a Rust i64
.
pub fn as_integer_round_inner(&self) -> Result<i64, Lovm2Error>
[src]
Try turning a value into a Rust i64
while doing correct float rounding.
pub fn as_str_inner(&self) -> Result<String, Lovm2Error>
[src]
Try turning a value into a Rust String
.
pub fn type_id(&self) -> Result<ValueType, Lovm2Error>
[src]
Return the ValueType
of this value. Used for converting between values.
impl Value
[src]
pub fn create_any<T>(from: T) -> Value where
T: Any,
[src]
T: Any,
Create a Handle
to the given value.
pub fn clone_inner(&self) -> Result<Value, Lovm2Error>
[src]
If the current value is an instance of Ref
, this function
will return an owned clone of the innermost value. If the value
is not a reference, this is just a clone.
pub fn unref_inplace(&mut self) -> Result<(), Lovm2Error>
[src]
Ensure that the value is not wrapped in a reference. This is used for stack mutations as first operand.
pub fn is_ref(&self) -> bool
[src]
Returns true if the value is a reference.
pub fn iter(&self) -> Result<Iter, Lovm2Error>
[src]
Create an iterator from the value. This will return an error if the value does not support iteration.
pub fn deep_clone(&self) -> Value
[src]
Returns a completely independent version of the value.
This will recursively clone the items of List
and Dict
as well as Ref
.
pub fn delete(&mut self, key: &Value) -> Result<(), Lovm2Error>
[src]
Delete an item from a value by key.
pub fn get(&self, key: &Value) -> Result<Value, Lovm2Error>
[src]
Retrieve an item by key.
pub fn get_by_index(&self, idx: usize) -> Result<Value, Lovm2Error>
[src]
Get an item by a number. This is mainly used for iteration.
pub fn len(&self) -> Result<usize, Lovm2Error>
[src]
Retrieve the length of the value.
pub fn set(&mut self, key: &Value, val: Value) -> Result<(), Lovm2Error>
[src]
Insert a new item into the value.
impl Value
[src]
pub fn dict() -> Value
[src]
Create a new instance of Dict
.
pub fn list() -> Value
[src]
Create a new instance of List
.
impl Value
[src]
impl Value
[src]
pub fn add_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn sub_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn mul_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn div_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn rem_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn shl_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn shr_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn pow_inplace(&mut self, exp: Value) -> Result<(), Lovm2Error>
[src]
pub fn and_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn or_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn xor_inplace(&mut self, other: Value) -> Result<(), Lovm2Error>
[src]
pub fn not_inplace(&mut self) -> Result<(), Lovm2Error>
[src]
Trait Implementations
impl Add<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the +
operator.
pub fn add(self, other: Value) -> <Value as Add<Value>>::Output
[src]
impl BitAnd<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the &
operator.
pub fn bitand(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl BitOr<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the |
operator.
pub fn bitor(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl BitXor<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the ^
operator.
pub fn bitxor(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl Clone for Value
[src]
impl Debug for Value
[src]
impl<'de> Deserialize<'de> for Value
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Value, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Value, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Display for Value
[src]
impl Div<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the /
operator.
pub fn div(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl Eq for Value
[src]
impl<'_> From<&'_ str> for Value
[src]
impl From<()> for Value
[src]
impl From<Iter> for Value
[src]
impl From<String> for Value
[src]
impl From<Value> for Reference
[src]
impl<T> From<Vec<T, Global>> for Value where
T: Into<Value>,
[src]
T: Into<Value>,
impl From<bool> for Value
[src]
impl From<char> for Value
[src]
impl From<f64> for Value
[src]
impl From<i64> for Value
[src]
impl Hash for Value
[src]
pub fn hash<H>(&self, hasher: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<String> for Value
[src]
impl Into<bool> for Value
[src]
impl Into<f64> for Value
[src]
impl Into<i64> for Value
[src]
impl Mul<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the *
operator.
pub fn mul(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl Not for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the !
operator.
pub fn not(self) -> Result<Value, Lovm2Error>
[src]
impl Ord for Value
[src]
pub fn cmp(&self, other: &Value) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Value> for Reference
[src]
pub fn eq(&self, rhs: &Value) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Value> for Value
[src]
pub fn eq(&self, rhs: &Value) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Value> for Value
[src]
pub fn partial_cmp(&self, other: &Value) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Rem<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the %
operator.
pub fn rem(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl Serialize for Value
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl Shl<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the <<
operator.
pub fn shl(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl Shr<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the >>
operator.
pub fn shr(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl Sub<Value> for Value
[src]
type Output = Result<Value, Lovm2Error>
The resulting type after applying the -
operator.
pub fn sub(self, other: Value) -> Result<Value, Lovm2Error>
[src]
impl TryFrom<Value> for Iter
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Value
[src]
impl !Send for Value
[src]
impl !Sync for Value
[src]
impl Unpin for Value
[src]
impl !UnwindSafe for Value
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,