pub enum AVal {
Show 18 variants
None,
Err(Box<AVal>, String),
Bol(bool),
Sym(String),
Str(String),
Byt(Vec<u8>),
Int(i64),
Flt(f64),
Lst(Vec<AVal>),
Opt(Option<Box<AVal>>),
FVec(NVec<f64>),
IVec(NVec<i64>),
Pair(Box<(AVal, AVal)>),
Map(FnvHashMap<String, AVal>),
Chan(AValChannel),
Slot(AtomicAValSlot),
Atom(AtomicAVal),
Usr(Box<dyn ThreadSafeUsr>),
}Expand description
AVal is a copy-by-value structure for storing the most important data of VVals inside an atomic container (AtomicAVal).
You can create an AVal from a VVal like this:
use wlambda::*;
let av = {
let v = VVal::vec();
v.push(VVal::Int(1));
v.push(VVal::Int(2));
v.push(VVal::Int(3));
AVal::from_vval(&v)
};
/// You get back the VVal like this:
assert_eq!(av.to_vval().s(), "$[1,2,3]");And get back the VVal like this:
Variants§
None
Err(Box<AVal>, String)
Bol(bool)
Sym(String)
Str(String)
Byt(Vec<u8>)
Int(i64)
Flt(f64)
Lst(Vec<AVal>)
Opt(Option<Box<AVal>>)
FVec(NVec<f64>)
IVec(NVec<i64>)
Pair(Box<(AVal, AVal)>)
Map(FnvHashMap<String, AVal>)
Chan(AValChannel)
Slot(AtomicAValSlot)
Atom(AtomicAVal)
Usr(Box<dyn ThreadSafeUsr>)
Implementations§
Source§impl AVal
impl AVal
Sourcepub fn set_at_path(&mut self, path_idx: usize, pth: &VVal, av: AVal)
pub fn set_at_path(&mut self, path_idx: usize, pth: &VVal, av: AVal)
Takes a path of indices and the start index of that path,
and sets the addressed slot to the given AVal.
This is used by std:sync:atom:write_at.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AVal
impl !RefUnwindSafe for AVal
impl Send for AVal
impl Sync for AVal
impl Unpin for AVal
impl !UnwindSafe for AVal
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