#[repr(u8)]
pub enum VVal {
Show 23 variants
None,
Err(Rc<RefCell<(VVal, SynPos)>>),
Bol(bool),
Sym(Symbol),
Chr(VValChr),
Str(Rc<String>),
Byt(Rc<Vec<u8>>),
Int(i64),
Flt(f64),
Syn(SynPos),
Pair(Rc<(VVal, VVal)>),
Opt(Option<Rc<VVal>>),
Iter(Rc<RefCell<VValIter>>),
Lst(Rc<RefCell<Vec<VVal>>>),
Map(Rc<RefCell<FnvHashMap<Symbol, VVal>>>),
Fun(Rc<VValFun>),
DropFun(Rc<DropFun>),
FVec(Box<NVec<f64>>),
IVec(Box<NVec<i64>>),
Ref(Rc<RefCell<VVal>>),
HRef(Rc<RefCell<VVal>>),
WWRef(Weak<RefCell<VVal>>),
Usr(Box<dyn VValUserData>),
}
Expand description
VVal aka. VariantValue is a data structure to represent all kinds of WLambda data structures.
It’s used for the AST, for internal data and for runtime data structures.
Variants
None
The none value, the default value of all non initialized data.
Err(Rc<RefCell<(VVal, SynPos)>>)
The err value is a special sentinel value for representing any kind of
application error condition. It’s created using the special $e
Bol(bool)
Representation of a boolean value.
Sym(Symbol)
Representation of an interned string aka symbol or key.
Chr(VValChr)
Representation of a single character (or byte)
Str(Rc<String>)
Representation of a unicode/text string.
Byt(Rc<Vec<u8>>)
Representation of a byte buffer.
Int(i64)
Integer value
Flt(f64)
Float value
Syn(SynPos)
A syntax node in the AST, records the position too.
Pair(Rc<(VVal, VVal)>)
A pair
Opt(Option<Rc<VVal>>)
An optional value. While VVal::None basically has the same meaning as “no value”, an optional value provides functions a way to say that they don’t even return none value but nothing. Yes, it sounds weird, and it is weird. But in case of iterator functions that iterate over an array you can find out whether the iterator is at the end or will provide more values.
Iter(Rc<RefCell<VValIter>>)
A special internal iterator type for built in VVal data structures.
Lst(Rc<RefCell<Vec<VVal>>>)
A list (or vector) of VVals.
Map(Rc<RefCell<FnvHashMap<Symbol, VVal>>>)
A mapping of strings to VVals.
Fun(Rc<VValFun>)
A function, see also VValFun
DropFun(Rc<DropFun>)
A guarded VVal, that executes a given function when it is no longer referenced.
FVec(Box<NVec<f64>>)
A numerical (mathematical) vector storing integers. See NVec for more information.
IVec(Box<NVec<i64>>)
A numerical (mathematical) vector storing floats. See NVec for more information.
Ref(Rc<RefCell<VVal>>)
A (strong) reference to a VVal.
HRef(Rc<RefCell<VVal>>)
A hidden strong reference to a VVal. Generated either explicitly by $&
or if a variable is captured by a closure.
WWRef(Weak<RefCell<VVal>>)
A (weak) reference to a VVal. Might turn VVal::None anytime.
Usr(Box<dyn VValUserData>)
A vval that can box some user data which can later be accessed from inside user supplied Rust functions via std::any::Any.
Implementations
sourceimpl VVal
impl VVal
pub fn new_str(s: &str) -> VVal
pub fn new_str_mv(s: String) -> VVal
pub fn new_char(c: char) -> VVal
pub fn new_byte(b: u8) -> VVal
pub fn new_sym(s: &str) -> VVal
pub fn new_sym_mv(s: String) -> VVal
pub fn new_byt(v: Vec<u8>) -> VVal
pub fn err(v: VVal, pos: SynPos) -> VVal
pub fn err_msg(s: &str) -> VVal
pub fn new_usr<T: VValUserData + 'static>(o: T) -> VVal
pub fn ivec2(x: i64, y: i64) -> VVal
pub fn ivec3(x: i64, y: i64, z: i64) -> VVal
pub fn ivec4(x: i64, y: i64, z: i64, w: i64) -> VVal
pub fn fvec2(x: f64, y: f64) -> VVal
pub fn fvec3(x: f64, y: f64, z: f64) -> VVal
pub fn fvec4(x: f64, y: f64, z: f64, w: f64) -> VVal
pub fn ivec_from_tpl2(tpl: (i64, i64)) -> VVal
pub fn ivec_from_tpl3(tpl: (i64, i64, i64)) -> VVal
pub fn ivec_from_tpl4(tpl: (i64, i64, i64, i64)) -> VVal
pub fn fvec_from_tpl2(tpl: (f64, f64)) -> VVal
pub fn fvec_from_tpl3(tpl: (f64, f64, f64)) -> VVal
pub fn fvec_from_tpl4(tpl: (f64, f64, f64, f64)) -> VVal
pub fn vec() -> VVal
pub fn vec1(a: VVal) -> VVal
pub fn vec2(a: VVal, b: VVal) -> VVal
pub fn vec3(a: VVal, b: VVal, c: VVal) -> VVal
pub fn vec4(a: VVal, b: VVal, c: VVal, d: VVal) -> VVal
pub fn opt(v: VVal) -> VVal
pub fn opt_none() -> VVal
pub fn unwrap_opt(&self) -> VVal
pub fn to_vec(&self) -> Vec<VVal>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn vec_from(vl: &[VVal]) -> VVal
pub fn vec_mv(v: Vec<VVal>) -> VVal
sourcepub fn new_fun<T>(
fun: T,
min_args: Option<usize>,
max_args: Option<usize>,
err_arg_ok: bool
) -> VVal where
T: 'static + Fn(&mut Env, usize) -> Result<VVal, StackAction>,
pub fn new_fun<T>(
fun: T,
min_args: Option<usize>,
max_args: Option<usize>,
err_arg_ok: bool
) -> VVal where
T: 'static + Fn(&mut Env, usize) -> Result<VVal, StackAction>,
Creates a new WLambda function that wraps the given Rust
closure. See also VValFun::new_fun
. For a more detailed
discussion of the parameters.
use wlambda::compiler::EvalContext;
use wlambda::vval::{VVal, VValFun, Env};
let mut ctx = wlambda::compiler::EvalContext::new_empty_global_env();
ctx.set_global_var("xyz",
&VVal::new_fun(
move |env: &mut Env, argc: usize| {
Ok(VVal::new_str("xyz"))
}, None, None, false));
assert_eq!(ctx.eval("xyz[]").unwrap().s_raw(), "xyz")
pub fn call(&self, env: &mut Env, args: &[VVal]) -> Result<VVal, StackAction>
pub fn compare_str(&self, b: &VVal) -> Ordering
pub fn shallow_clone(&self) -> VVal
pub fn compare_num(&self, b: &VVal) -> Ordering
pub fn sort<F>(&self, compare: F) where
F: FnMut(&VVal, &VVal) -> Ordering,
pub fn fisher_yates_shuffle<I>(&mut self, rand: I) where
I: FnMut() -> i64,
pub fn split(&self, pat: &VVal, max: usize, bytes: bool) -> VVal
pub fn find(&self, pat: &VVal, start_idx: usize, bytes: bool) -> VVal
pub fn bytes_replace(&self, pat: &VVal, repl: &VVal) -> Self
pub fn reverse(&self) -> VVal
pub fn keys(&self) -> VVal
pub fn values(&self) -> VVal
pub fn enumerate(&self) -> VVal
sourcepub fn iter_over_vvals(&self) -> bool
pub fn iter_over_vvals(&self) -> bool
Returns true if this vval is containing (multiple) other VVals. Usually true for: Maps, Vectors, Pairs and Opt.
Helpful if you want to iterate through a data structure by recursively iterating over a vval. Without getting iterations over individual string characters.
sourcepub fn iter(&self) -> VValIter
pub fn iter(&self) -> VValIter
This function returns you an iterator over the VVal. It will iterate over data such as VVal::Str, VVal::Sym, VVal::Lst, VVal::Map and VVal::Byt.
See also: VVal::with_iter which is the better option for iterating over a VVal, because it catches the special case when the VVal itself is an iterator already. This function will not return the same iterator again when called on an VVal iterator value!
This functionality provides the for
keyword/function in WLambda.
use wlambda::*;
let some_vec = VVal::vec();
some_vec.push(VVal::Int(10));
some_vec.push(VVal::Int(22));
some_vec.push(VVal::Int(36));
let mut sum = 0;
for (v, _) in some_vec.iter() {
sum += v.i();
}
assert_eq!(sum, 68);
sourcepub fn with_iter<F, R>(&self, f: F) -> R where
F: FnMut(&mut VValIter) -> R,
pub fn with_iter<F, R>(&self, f: F) -> R where
F: FnMut(&mut VValIter) -> R,
Calls the given callback with an iterator through the vval. It catches the special case when the VVal itself is an iterator.
use wlambda::VVal;
use std::rc::Rc;
use std::cell::RefCell;
let x = VVal::vec();
x.push(VVal::Int(10));
x.push(VVal::Int(20));
let it = x.as_iter();
let mut sum = 0;
it.with_iter(|iter| {
for (v, _) in iter {
sum += v.i();
}
});
assert_eq!(sum, 30);
pub fn with_value_or_iter_values<T>(self, f: T) where
T: FnMut(VVal, Option<VVal>) -> bool,
sourcepub fn disable_function_arity(&self) -> VVal
pub fn disable_function_arity(&self) -> VVal
This method will disable all arity checks of the function in the VVal. Does nothing if the VVal is not a function.
It is used for disabling checks of drop functions, as they are evaluated in their own environment and there is no proper way to report errors upwards.
sourcepub fn clone_and_rebind_upvalues<T>(&self, f: T) -> VVal where
T: FnOnce(&Vec<VarPos>, &mut Vec<VVal>),
pub fn clone_and_rebind_upvalues<T>(&self, f: T) -> VVal where
T: FnOnce(&Vec<VarPos>, &mut Vec<VVal>),
This function is an internal function that clones a function reference and assigns new upvalues to it for making a new closure instance.
pub fn call_no_args(&self, env: &mut Env) -> Result<VVal, StackAction>
pub fn to_ref(&self) -> VVal
pub fn assign_ref(&mut self, value: VVal)
pub fn set_ref(&self, v: VVal) -> VVal
pub fn hide_ref(self) -> VVal
pub fn upgrade(self) -> VVal
pub fn downgrade(self) -> VVal
pub fn map() -> VVal
pub fn map1(k: &str, v: VVal) -> VVal
pub fn map2(k: &str, v: VVal, k2: &str, v2: VVal) -> VVal
pub fn map3(k: &str, v: VVal, k2: &str, v2: VVal, k3: &str, v3: VVal) -> VVal
pub fn sym(s: &str) -> VVal
pub fn to_sym(&self) -> Symbol
pub fn ref_id(&self) -> Option<i64>
pub fn eqv(&self, v: &VVal) -> bool
pub fn map_ok_skip<T, R>(&self, op: T, skip: usize) -> Vec<R>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
T: FnMut(&VVal) -> R,
A: Allocator,
pub fn map_skip<R, E, T>(&self, op: T, skip: usize) -> Result<Vec<R>, E> where
T: FnMut(&VVal) -> Result<R, E>,
pub fn unshift(&self, val: VVal) -> &VVal
pub fn add(&self, vals: &[VVal], list_add: CollectionAdd) -> VVal
pub fn insert_at(&self, index: usize, val: VVal)
pub fn set(&self, index: usize, val: VVal)
pub fn set_at(&self, index: usize, val: VVal)
pub fn at(&self, index: usize) -> Option<VVal>
pub fn proto_data(&self) -> VVal
pub fn proto_lookup(&self, key: &str) -> Option<VVal>
pub fn get_key_sym(&self, key: &Symbol) -> Option<VVal>
pub fn get_key(&self, key: &str) -> Option<VVal>
pub fn set_map_key_fun<T>(
&self,
key: &str,
fun: T,
min_args: Option<usize>,
max_args: Option<usize>,
err_arg_ok: bool
) where
T: 'static + Fn(&mut Env, usize) -> Result<VVal, StackAction>,
pub fn deref(&self) -> VVal
pub fn with_deref<O, D, R>(&self, op: O, default: D) -> R where
O: FnOnce(&VVal) -> R,
D: FnOnce(Option<&VVal>) -> R,
pub fn list_operation<O, R>(&self, op: O) -> Result<R, StackAction> where
O: FnMut(&mut RefMut<'_, Vec<VVal>>) -> R,
pub fn delete_key(&self, key: &VVal) -> Result<VVal, StackAction>
pub fn set_key_str(&self, key: &str, val: VVal) -> Result<(), StackAction>
pub fn set_key_sym(&self, key: Symbol, val: VVal) -> Result<(), StackAction>
pub fn set_key(&self, key: &VVal, val: VVal) -> Result<(), StackAction>
pub fn pop(&self) -> VVal
pub fn accum(&mut self, val: &VVal)
pub fn push(&self, val: VVal) -> &VVal
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn s_len(&self) -> usize
sourcepub fn s_raw(&self) -> String
pub fn s_raw(&self) -> String
Returns the string data or converts the value to a string for displaying. The conversion format is not for reading the value in again via the WLambda parser, it’s for accessing the data as pure as possible.
Use this if you need the raw unescaped contents of VVal::Str, VVal::Sym, VVal::Byt and other VVals.
As this is used usually for generating output a VVal::None is turned into an empty string
There is also with_s_ref()
which allows you to work with a
reference to the string, in case you don’t need to own the copy!
use wlambda::VVal;
assert_eq!(VVal::None.s_raw(), "");
assert_eq!(VVal::new_str("Test").s_raw(), "Test");
sourcepub fn with_s_ref<T, R>(&self, f: T) -> R where
T: FnOnce(&str) -> R,
pub fn with_s_ref<T, R>(&self, f: T) -> R where
T: FnOnce(&str) -> R,
Like s_raw() but returns a reference to the string.
Use this if you need the raw unescaped contents of VVal::Str, VVal::Sym, VVal::Byt and other VVals.
As this is used usually for generating output a VVal::None is turned into an empty string
use wlambda::VVal;
VVal::None.with_s_ref(
|s: &str| assert_eq!(s, ""));
VVal::new_str("Test").with_s_ref(
|s: &str| assert_eq!(s, "Test"));
pub fn with_bv_ref<T, R>(&self, f: T) -> R where
T: FnOnce(&[u8]) -> R,
pub fn is_float(&self) -> bool
pub fn is_int(&self) -> bool
pub fn is_char(&self) -> bool
pub fn is_byte(&self) -> bool
pub fn is_sym(&self) -> bool
pub fn is_syn(&self) -> bool
pub fn get_syn_pos(&self) -> SynPos
pub fn syn(&self) -> Option<Syntax>
pub fn set_syn(&mut self, syn: Syntax)
pub fn set_syn_at(&self, idx: usize, syn: Syntax)
pub fn get_syn(&self) -> Syntax
pub fn compile_err(&self, msg: String) -> CompileError
pub fn to_compile_err(&self, msg: String) -> Result<EvalNode, CompileError>
pub fn is_pair(&self) -> bool
pub fn is_iter(&self) -> bool
pub fn is_optional(&self) -> bool
pub fn is_ref(&self) -> bool
pub fn is_wref(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_bytes(&self) -> bool
pub fn is_str(&self) -> bool
pub fn is_fun(&self) -> bool
pub fn is_vec(&self) -> bool
pub fn is_nvec(&self) -> bool
pub fn is_ivec(&self) -> bool
pub fn is_fvec(&self) -> bool
pub fn nvec_len(&self) -> usize
pub fn is_map(&self) -> bool
pub fn is_some(&self) -> bool
pub fn is_none(&self) -> bool
pub fn is_err(&self) -> bool
pub fn syntax_type(&self) -> &str
pub fn type_name(&self) -> &str
sourcepub fn with_usr_ref<T: 'static, F, X>(&mut self, f: F) -> Option<X> where
F: FnOnce(&mut T) -> X,
pub fn with_usr_ref<T: 'static, F, X>(&mut self, f: F) -> Option<X> where
F: FnOnce(&mut T) -> X,
Accesses the user data of type T directly.
If the user data is not of that type it returns None
.
sourcepub fn v_(&self, idx: usize) -> VVal
pub fn v_(&self, idx: usize) -> VVal
Quick access method for retrieving the VVal at index idx
.
Returns VVal::None if the VVal is not a VVal::Lst or no such index exists.
See also the shorthands v_i
, v_f
, v_s
and v_s_raw
.
use wlambda::VVal;
let v = VVal::vec();
v.push(VVal::Int(10));
v.push(VVal::Int(11));
assert_eq!(v.v_(1).i(), 11);
assert_eq!(v.v_i(1), 11);
sourcepub fn v_k(&self, key: &str) -> VVal
pub fn v_k(&self, key: &str) -> VVal
Quick access method for retrieving the VVal at key idx
.
Returns VVal::None if the VVal is not a VVal::Map or no such index exists.
See also the shorthands v_ik
, v_fk
, v_sk
, v_bk
and v_s_rawk
.
use wlambda::VVal;
let v = VVal::map();
v.set_key_str("aaa", VVal::Int(12));
v.set_key_str("abc", VVal::Int(13));
v.set_key_str("zyy", VVal::Int(14));
assert_eq!(v.v_k("abc").i(), 13);
assert_eq!(v.v_ik("aaa"), 12);
assert_eq!(v.v_ik("zyy"), 14);
sourcepub fn v_i(&self, idx: usize) -> i64
pub fn v_i(&self, idx: usize) -> i64
Quick access of an integer at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::Int(11));
assert_eq!(v.v_i(0), 11);
sourcepub fn v_ik(&self, key: &str) -> i64
pub fn v_ik(&self, key: &str) -> i64
Quick access of the integer at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::new_str("10"));
assert_eq!(v.v_ik("aaa"), 10);
sourcepub fn v_b(&self, idx: usize) -> bool
pub fn v_b(&self, idx: usize) -> bool
Quick access of an bool at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::Bol(true));
assert_eq!(v.v_b(0), true);
sourcepub fn v_bk(&self, key: &str) -> bool
pub fn v_bk(&self, key: &str) -> bool
Quick access of the integer at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::Bol(true));
assert_eq!(v.v_bk("aaa"), true);
sourcepub fn v_c(&self, idx: usize) -> char
pub fn v_c(&self, idx: usize) -> char
Quick access of a character at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::Int(11));
assert_eq!(v.v_c(0), '\u{0b}');
sourcepub fn v_ck(&self, key: &str) -> char
pub fn v_ck(&self, key: &str) -> char
Quick access of the character at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::new_char('@'));
assert_eq!(v.v_ck("aaa"), '@');
sourcepub fn v_byte(&self, idx: usize) -> u8
pub fn v_byte(&self, idx: usize) -> u8
Quick access of a byte at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::Int(11));
assert_eq!(v.v_byte(0), b'\x0b');
sourcepub fn v_bytek(&self, key: &str) -> u8
pub fn v_bytek(&self, key: &str) -> u8
Quick access of the byte at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::new_byte(b'@'));
assert_eq!(v.v_bytek("aaa"), b'@');
sourcepub fn v_s_raw(&self, idx: usize) -> String
pub fn v_s_raw(&self, idx: usize) -> String
Quick access of a raw string at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::Int(12));
assert_eq!(v.v_s_raw(0), "12");
sourcepub fn v_with_s_ref<T, R>(&self, idx: usize, f: T) -> R where
T: FnOnce(&str) -> R,
pub fn v_with_s_ref<T, R>(&self, idx: usize, f: T) -> R where
T: FnOnce(&str) -> R,
Quick access of a raw string as reference at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::new_str("12"));
assert_eq!(v.v_with_s_ref(0, |s: &str| s.chars().nth(0).unwrap()), '1');
sourcepub fn v_s_rawk(&self, key: &str) -> String
pub fn v_s_rawk(&self, key: &str) -> String
Quick access of the string at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::new_str("XYX"));
assert_eq!(v.v_s_rawk("aaa"), "XYX");
sourcepub fn v_with_s_refk<T, R>(&self, key: &str, f: T) -> R where
T: FnOnce(&str) -> R,
pub fn v_with_s_refk<T, R>(&self, key: &str, f: T) -> R where
T: FnOnce(&str) -> R,
Quick access of the string as reference at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::new_str("XYX"));
assert!(v.v_with_s_refk("aaa", |s: &str| s == "XYX"));
sourcepub fn v_s(&self, idx: usize) -> String
pub fn v_s(&self, idx: usize) -> String
Quick access of the string representation at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::Int(13));
assert_eq!(v.v_s(0), "13");
sourcepub fn v_sk(&self, key: &str) -> String
pub fn v_sk(&self, key: &str) -> String
Quick access of the string represenation at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::Flt(12.2));
assert_eq!(v.v_sk("aaa"), "12.2");
sourcepub fn v_f(&self, idx: usize) -> f64
pub fn v_f(&self, idx: usize) -> f64
Quick access of the float at the given idx
.
See also v_
.
let v = wlambda::VVal::vec();
v.push(wlambda::VVal::Flt(13.2));
assert_eq!(v.v_f(0), 13.2);
sourcepub fn v_fk(&self, key: &str) -> f64
pub fn v_fk(&self, key: &str) -> f64
Quick access of the float at the given key
.
See also v_k
.
let v = wlambda::VVal::map();
v.set_key_str("aaa", wlambda::VVal::Flt(12.2));
assert_eq!(v.v_fk("aaa"), 12.2);
pub fn for_each<T>(&self, op: T) where
T: FnMut(&VVal),
pub fn for_eachk<T>(&self, op: T) where
T: FnMut(&str, &VVal),
pub fn f(&self) -> f64
pub fn i(&self) -> i64
pub fn byte(&self) -> u8
pub fn c(&self) -> char
pub fn b(&self) -> bool
pub fn nvec<N: NVecNum>(&self) -> NVec<N>
pub fn as_bytes(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn to_duration(&self) -> Result<Duration, VVal>
sourcepub fn s(&self) -> String
pub fn s(&self) -> String
Returns a string representation of the VVal data structure.
It handles cyclic data structures fine.
The purpose is to return an unambigous represenation of the data
structure. That means strings are quoted and VVal::None becomes $n
for instance.
If you need strings in pure form, use the s_raw()
method.
use wlambda::VVal;
let v = VVal::None;
assert_eq!(v.s(), "$n");
assert_eq!(VVal::new_str("Foo").s(), "\"Foo\"");
sourcepub fn to_msgpack(&self) -> Result<Vec<u8>, String>
pub fn to_msgpack(&self) -> Result<Vec<u8>, String>
Serializes the VVal (non cyclic) structure to a msgpack byte vector.
sourcepub fn from_msgpack(s: &[u8]) -> Result<VVal, String>
pub fn from_msgpack(s: &[u8]) -> Result<VVal, String>
Creates a VVal structure from a msgpack byte vector.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for VVal
impl<'de> Deserialize<'de> for VVal
sourcefn deserialize<D>(deserializer: D) -> Result<VVal, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<VVal, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<VVal> for StackAction
impl From<VVal> for StackAction
sourcefn from(v: VVal) -> StackAction
fn from(v: VVal) -> StackAction
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for VVal
impl !Send for VVal
impl !Sync for VVal
impl Unpin for VVal
impl !UnwindSafe for VVal
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more