[−][src]Enum wlambda::vval::VVal
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
The none value, the default value of all non initialized data.
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(String)
Representation of a symbol or key.
This one might be interned at some point, so that it only contains
an Rc
Representation of a unicode/text string.
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.
A list (or vector) of VVals.
A mapping of strings to VVals.
A function, see also VValFun
A guarded VVal, that executes a given function when it is no longer referenced.
A (strong) reference to a VVal.
A (still strong) reference to a VVal, which becomes a weak reference if captured by a closure.
A (weak) reference to a VVal. Might turn VVal::Nul 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.
Methods
impl VVal
[src]
pub fn new_str(s: &str) -> VVal
[src]
pub fn new_str_mv(s: String) -> VVal
[src]
pub fn new_sym(s: &str) -> VVal
[src]
pub fn new_byt(v: Vec<u8>) -> VVal
[src]
pub fn err(v: VVal, pos: SynPos) -> VVal
[src]
pub fn err_msg(s: &str) -> VVal
[src]
pub fn vec() -> VVal
[src]
pub fn to_vec(&self) -> Vec<VVal>
[src]
pub fn vec_from(vl: &[VVal]) -> VVal
[src]
pub fn vec_mv(v: Vec<VVal>) -> VVal
[src]
pub fn call(&self, env: &mut Env, args: &[VVal]) -> Result<VVal, StackAction>
[src]
pub fn call_no_args(&self, env: &mut Env) -> Result<VVal, StackAction>
[src]
pub fn call_internal(
&self,
env: &mut Env,
argc: usize
) -> Result<VVal, StackAction>
[src]
&self,
env: &mut Env,
argc: usize
) -> Result<VVal, StackAction>
pub fn to_ref(&self) -> VVal
[src]
pub fn to_wref(&self) -> VVal
[src]
pub fn set_ref(&self, v: VVal) -> VVal
[src]
pub fn deref(&self) -> VVal
[src]
pub fn downgrade(self) -> VVal
[src]
pub fn map() -> VVal
[src]
pub fn sym(s: &str) -> VVal
[src]
pub fn ref_id(&self) -> Option<i64>
[src]
pub fn eqv(&self, v: &VVal) -> bool
[src]
pub fn map_ok_skip<T, R>(&self, op: T, skip: usize) -> Vec<R> where
T: FnMut(&VVal) -> R,
[src]
T: FnMut(&VVal) -> R,
pub fn map_skip<R, E, T>(&self, op: T, skip: usize) -> Result<Vec<R>, E> where
T: FnMut(&VVal) -> Result<R, E>,
[src]
T: FnMut(&VVal) -> Result<R, E>,
pub fn unshift(&self, val: VVal) -> &VVal
[src]
pub fn insert_at(&self, index: usize, val: VVal)
[src]
pub fn set_at(&self, index: usize, val: VVal)
[src]
pub fn at(&self, index: usize) -> Option<VVal>
[src]
pub fn get_key(&self, key: &str) -> Option<VVal>
[src]
pub fn set_map_key(&self, key: String, val: VVal)
[src]
pub fn set_key(&self, key: &VVal, val: VVal)
[src]
pub fn pop(&self) -> VVal
[src]
pub fn push(&self, val: VVal) -> &VVal
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn len(&self) -> usize
[src]
pub fn s_len(&self) -> usize
[src]
pub fn s_raw(&self) -> String
[src]
pub fn is_float(&self) -> bool
[src]
pub fn is_int(&self) -> bool
[src]
pub fn is_sym(&self) -> bool
[src]
pub fn is_syn(&self) -> bool
[src]
pub fn get_syn_pos(&self) -> SynPos
[src]
pub fn get_syn(&self) -> Syntax
[src]
pub fn to_compile_err(&self, msg: String) -> Result<EvalNode, CompileError>
[src]
pub fn is_ref(&self) -> bool
[src]
pub fn is_wref(&self) -> bool
[src]
pub fn is_bool(&self) -> bool
[src]
pub fn is_bytes(&self) -> bool
[src]
pub fn is_str(&self) -> bool
[src]
pub fn is_fun(&self) -> bool
[src]
pub fn is_vec(&self) -> bool
[src]
pub fn is_map(&self) -> bool
[src]
pub fn is_none(&self) -> bool
[src]
pub fn is_err(&self) -> bool
[src]
pub fn type_name(&self) -> String
[src]
pub fn f(&self) -> f64
[src]
pub fn i(&self) -> i64
[src]
pub fn b(&self) -> bool
[src]
pub fn s(&self) -> String
[src]
pub fn to_msgpack(&self) -> Result<Vec<u8>, String>
[src]
Serializes the VVal (non cyclic) structure to a msgpack byte vector.
pub fn from_msgpack(s: &[u8]) -> Result<VVal, String>
[src]
Creates a VVal structure from a msgpack byte vector.
pub fn to_json(&self, not_pretty: bool) -> Result<String, String>
[src]
Serializes the VVal (non cyclic) structure to a JSON string.
pub fn from_json(s: &str) -> Result<VVal, String>
[src]
Creates a VVal structure from a JSON string.
Trait Implementations
impl Clone for VVal
[src]
impl Debug for VVal
[src]
impl Serialize for VVal
[src]
impl<'de> Deserialize<'de> for VVal
[src]
fn deserialize<D>(deserializer: D) -> Result<VVal, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl !Send for VVal
impl !Sync for VVal
impl Unpin for VVal
impl !UnwindSafe for VVal
impl !RefUnwindSafe for VVal
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,