Trait std::rt::Runtime[src]
pub trait Runtime {
fn yield_now(~self, cur_task: Box<Task>);
fn maybe_yield(~self, cur_task: Box<Task>);
fn deschedule(~self, times: uint, cur_task: Box<Task>, f: |BlockedTask| -> Result<(), BlockedTask>);
fn reawaken(~self, to_wake: Box<Task>);
fn spawn_sibling(~self, cur_task: Box<Task>, opts: TaskOpts, f: proc(): Send);
fn local_io(&'a mut self) -> Option<LocalIo<'a>>;
fn stack_bounds(&self) -> (uint, uint);
fn can_block(&self) -> bool;
fn wrap(~self) -> Box<Any>;
}The interface to the current runtime.
This trait is used as the abstraction between 1:1 and M:N scheduling. The two independent crates, libnative and libgreen, both have objects which implement this trait. The goal of this trait is to encompass all the fundamental differences in functionality between the 1:1 and M:N runtime modes.
Required Methods
fn yield_now(~self, cur_task: Box<Task>)
fn maybe_yield(~self, cur_task: Box<Task>)
fn deschedule(~self, times: uint, cur_task: Box<Task>, f: |BlockedTask| -> Result<(), BlockedTask>)
fn reawaken(~self, to_wake: Box<Task>)
fn spawn_sibling(~self, cur_task: Box<Task>, opts: TaskOpts, f: proc(): Send)
fn local_io(&'a mut self) -> Option<LocalIo<'a>>
fn stack_bounds(&self) -> (uint, uint)
The (low, high) edges of the current stack.