[−][src]Enum wlambda::threads::AVal
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
Bol(bool)Sym(String)Str(String)Int(i64)Flt(f64)Map(FnvHashMap<String, AVal>)Chan(AValChannel)Slot(AtomicAValSlot)Atom(AtomicAVal)Implementations
impl AVal[src]
pub fn set_at_path(&mut self, path_idx: usize, pth: &VVal, av: AVal)[src]
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.
pub fn to_vval(&self) -> VVal[src]
Converts the AVal back to a VVal.
use wlambda::*; assert_eq!(AVal::Sym(String::from("x")).to_vval().s(), ":x");
pub fn from_vval(v: &VVal) -> Self[src]
Converts a VVal to an AVal.
use wlambda::*; let av = AVal::from_vval(&VVal::new_sym("x")); if let AVal::Sym(s) = av { assert_eq!(s, "x"); } else { assert!(false); }
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for AVal
impl Send for AVal
impl Sync for AVal
impl Unpin for AVal
impl !UnwindSafe for AVal
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>,