[−][src]Enum ketos::value::Value
Represents a value.
Variants
()
Placeholder for missing optional values; should not be used to represent any real value.
Bool(bool)
Boolean -- true
or false
Float(f64)
Floating point number
Integer(Integer)
Signed arbitrary precision integer
Ratio(Ratio)
Arbitrary precision ratio
Struct value
Struct definition
Name(Name)
Literal name
Keyword(Name)
Keyword
Char(char)
Character
String(RcString)
String
Bytes(Bytes)
Byte string
Path(PathBuf)
Path
Quasiquoted value; quote depth MUST NEVER be zero.
Comma'd value; comma depth MUST NEVER be zero.
Comma-at'd value; quote depth MUST NEVER be zero.
Quoted value; quote depth MUST NEVER be zero.
Series of one or more values.
MUST NEVER be of length zero. Use Unit
to represent empty lists.
Function(Function)
Function implemented in Rust
Lambda(Lambda)
Compiled bytecode function
Foreign(Rc<dyn ForeignValue>)
Boxed value of a foreign type
Methods
impl Value
[src]
pub fn new_foreign<T: ForeignValue>(t: T) -> Value
[src]
Returns a value of a foreign type.
pub fn new_foreign_fn<F>(name: Name, f: F) -> Value where
F: Any + Fn(&Context, &mut [Value]) -> Result<Value, Error>,
[src]
F: Any + Fn(&Context, &mut [Value]) -> Result<Value, Error>,
Returns a value containing a foreign function.
pub fn compare(&self, rhs: &Value) -> Result<Ordering, ExecError>
[src]
Compares two values; returns an error if the values cannot be compared.
pub fn is_equal(&self, rhs: &Value) -> Result<bool, ExecError>
[src]
Tests two values for equality; returns an error if the values cannot be compared.
pub fn is_identical(&self, rhs: &Value) -> bool
[src]
Returns whether this value is identical to another.
The notable difference between this and eq
is that float NaN
values
will compare equal.
pub fn take(&mut self) -> Value
[src]
Replaces the value with Unit
and returns the old value.
pub fn quasiquote(self, n: u32) -> Value
[src]
pub fn comma(self, n: u32) -> Value
[src]
pub fn comma_at(self, n: u32) -> Value
[src]
pub fn quote(self, n: u32) -> Value
[src]
pub fn type_name(&self) -> &'static str
[src]
Returns a string describing the type of the value.
Trait Implementations
impl Clone for Value
[src]
impl Debug for Value
[src]
impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value
[src]
impl<'a> From<&'a OsStr> for Value
[src]
impl<'a> From<&'a Path> for Value
[src]
impl<'a, T: Clone + Into<Value>> From<&'a mut [T]> for Value
[src]
impl<'a> From<&'a str> for Value
[src]
impl From<()> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>, F: Into<Value>, G: Into<Value>, H: Into<Value>, I: Into<Value>, J: Into<Value>, K: Into<Value>, L: Into<Value>> From<(A, B, C, D, E, F, G, H, I, J, K, L)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>, F: Into<Value>, G: Into<Value>, H: Into<Value>, I: Into<Value>, J: Into<Value>, K: Into<Value>> From<(A, B, C, D, E, F, G, H, I, J, K)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>, F: Into<Value>, G: Into<Value>, H: Into<Value>, I: Into<Value>, J: Into<Value>> From<(A, B, C, D, E, F, G, H, I, J)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>, F: Into<Value>, G: Into<Value>, H: Into<Value>, I: Into<Value>> From<(A, B, C, D, E, F, G, H, I)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>, F: Into<Value>, G: Into<Value>, H: Into<Value>> From<(A, B, C, D, E, F, G, H)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>, F: Into<Value>, G: Into<Value>> From<(A, B, C, D, E, F, G)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>, F: Into<Value>> From<(A, B, C, D, E, F)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>, E: Into<Value>> From<(A, B, C, D, E)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>> From<(A, B, C, D)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>> From<(A, B, C)> for Value
[src]
impl<A: Into<Value>, B: Into<Value>> From<(A, B)> for Value
[src]
impl<A: Into<Value>> From<(A,)> for Value
[src]
impl From<Bytes> for Value
[src]
impl From<Integer> for Value
[src]
impl<T: Into<Value>> From<Option<T>> for Value
[src]
impl From<OsString> for Value
[src]
impl From<PathBuf> for Value
[src]
impl From<Ratio> for Value
[src]
impl From<RcString> for Value
[src]
impl From<RcVec<Value>> for Value
[src]
impl From<String> for Value
[src]
impl<T: Into<Value>> From<Vec<T>> for Value
[src]
impl From<bool> for Value
[src]
impl From<char> for Value
[src]
impl From<f32> for Value
[src]
impl From<f64> for Value
[src]
impl From<i16> for Value
[src]
impl From<i32> for Value
[src]
impl From<i64> for Value
[src]
impl From<i8> for Value
[src]
impl From<isize> for Value
[src]
impl From<u16> for Value
[src]
impl From<u32> for Value
[src]
impl From<u64> for Value
[src]
impl From<u8> for Value
[src]
impl From<usize> for Value
[src]
impl FromValue for Value
[src]
impl<'a> FromValueRef<'a> for &'a Value
[src]
impl NameDebug for Value
[src]
impl NameDisplay for Value
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl !UnwindSafe for Value
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,
fn borrow_mut(&mut self) -> &mut T
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,