2 releases
Uses old Rust 2015
0.0.2 | Nov 3, 2016 |
---|---|
0.0.1 | Nov 3, 2016 |
#57 in #coroutine
590KB
187 lines
Contains (WOFF font, 120KB) docs/Heuristica-Italic.woff, (WOFF font, 90KB) docs/FiraSans-Medium.woff, (WOFF font, 92KB) docs/FiraSans-Regular.woff, (WOFF font, 56KB) docs/SourceCodePro-Regular.woff, (WOFF font, 56KB) docs/SourceCodePro-Semibold.woff, (WOFF font, 49KB) docs/SourceSerifPro-Bold.woff and 1 more.
context_bind
Binds I want out of context-rs
These are simple bindings to context lib. The goal is to make a more object orriented runtime. With a free return function, that can be more easily embedded within external libraries (the goal is to make it easier to embed async-mio functionality).
use context_bind::{Routine,StackSize,swap};
let lambda = Box::new(||{
for i in 0usize.. {
swap(i*2);
}
});
let lambda2 = Box::new(||{
for i in 0usize.. {
swap(i*4);
}
});
let mut dut0 = Routine::new(lambda,1,StackSize::KiB8).unwrap();
let mut dut1 = Routine::new(lambda2,2,StackSize::KiB8).unwrap();
for x in 0..10 {
let a = dut0.exec(0);
let b = dut1.exec(0);
assert_eq!(a,x*2);
assert_eq!(b,x*4);
}
To integrate use the following in your Cargo.toml
file.
[dependencies]
context_bindings = "0.0.1"
A special thanks to the authors of context-rs without this library would not exist.