verona_rt/lib.rs
1//! ```rust
2//! # use verona_rt::{
3//! # cown::CownPtr,
4//! # scheduler::with,
5//! # when::{when, when2},
6//! # };
7//!
8//! # with(|| {
9//! let string = CownPtr::new(String::new());
10//! let vec = CownPtr::new(Vec::new());
11//!
12//! when(&string, |mut s| {
13//! assert_eq!(&*s, "");
14//! s.push_str("foo");
15//! });
16//! when(&vec, |mut v| {
17//! assert_eq!(&*v, &[]);
18//! v.push(101);
19//! });
20//! when2(&string, &vec, |mut s, mut v| {
21//! assert_eq!(&*s, "foo");
22//! assert_eq!(&*v, &[101]);
23//! s.push_str("bar");
24//! v.push(666);
25//! });
26//!
27//! when(&string, |s| assert_eq!(&*s, "foobar"));
28//! when(&vec, |v| assert_eq!(&*v, &[101, 666]));
29//! # });
30//! ```
31//!
32//! ## Current Status
33//!
34//! This is a research project, and is at an early stage of development. It is not
35//! ready for use outside of research.
36//!
37//! ## Restrictions:
38//!
39//! 1. *Don't leak threads*: When the main thread finishes, all other threads
40//! shut down. If you've accessed verona-rt resources in other threads,
41//! you'll have a bad time.
42//!
43//!
44//! ## Current Status
45//!
46//! This is a research project, and is at an early stage of development. It is not
47//! ready for use outside of research.
48
49// It'd be nice, see #17, but we need mutex's
50// #![no_std]
51
52pub mod cown;
53pub mod log;
54pub mod scheduler;
55pub mod when;