[−][src]Struct wlambda::threads::AtomicAVal
WLambda:
!atom = std:sync:atom:new 10;
!channel = std:sync:mpsc:new[];
!thrd = std:spawn_thread $q{
!val = main.read;
main.write $[1,$[0,1],3];
main.read_at 0;
main.write_at $[1, 0] 320;
q.send $["done", 10];
} ${ main = atom, q = channel };
!item = queue.pop[];
.item = queue.pop_timeout 1000;
Wraps an AVal like this: Arc<RwLockstd:sync:atom:new
, std:sync:atom:read
or std:sync:atom:write
.
These containers are shared between the threads by passing them
to the threads at std:thread:spawn
.
Implementations
impl AtomicAVal
[src]
pub fn new() -> Self
[src]
Creates a new empty instance, containing AVal::None.
pub fn write(&self, vv: &VVal) -> VVal
[src]
Locks and stores the VVal.
pub fn swap(&self, vv: &VVal) -> VVal
[src]
Locks and stores the VVal.
pub fn read(&self) -> VVal
[src]
Locks and reads the AVal and converts it to a VVal.
pub fn store_at(&self, _keypath: &VVal, vv: &VVal)
[src]
Locks and stores the VVal at the given key path.
pub fn read_at(&self, _keypath: &VVal) -> VVal
[src]
Locks and reads the AVal at the given key path.
Trait Implementations
impl Clone for AtomicAVal
[src]
fn clone(&self) -> AtomicAVal
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AtomicAVal
[src]
impl Default for AtomicAVal
[src]
impl VValUserData for AtomicAVal
[src]
fn as_any(&mut self) -> &mut dyn Any
[src]
fn call_method(&self, key: &str, env: &mut Env) -> Result<VVal, StackAction>
[src]
fn clone_ud(&self) -> Box<dyn VValUserData>
[src]
fn s(&self) -> String
[src]
fn s_raw(&self) -> String
[src]
fn i(&self) -> i64
[src]
fn f(&self) -> f64
[src]
fn b(&self) -> bool
[src]
fn eqv(&self, _other: &Box<dyn VValUserData>) -> bool
[src]
fn set_key(&self, _key: &VVal, _val: VVal) -> Result<(), StackAction>
[src]
fn delete_key(&self, _key: &VVal) -> Result<VVal, StackAction>
[src]
fn get_key(&self, _key: &str) -> Option<VVal>
[src]
fn call(&self, _env: &mut Env) -> Result<VVal, StackAction>
[src]
Auto Trait Implementations
impl RefUnwindSafe for AtomicAVal
impl Send for AtomicAVal
impl Sync for AtomicAVal
impl Unpin for AtomicAVal
impl UnwindSafe for AtomicAVal
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>,