Struct context_bind::Routine [] [src]

pub struct Routine {
    pub data: usize,
    // some fields omitted
}

Encapsulate the state of a co-routine

This holds the entire state of a co-routine. Some fields are public to allow for eaiser inspection.

Fields

data: usize

Methods

impl Routine
[src]

fn new<F>(stack: StackSize, b: F) -> Result<Routineusize> where F: Fn() + 'static

Build a new routine.

This function will return an error if the stack created is too large. The maximum stack size your process may allocate will be listed in the Err field if that occurs.

fn no_func_alloc<F>(stack: StackSize, b: Box<F>) -> Result<Routineusize> where F: Fn() + 'static

If you don't want to allocate internally at all

fn exec(&mut self, data: usize) -> usize

Run the Routine.

This behaves identical to swap, except it is attached to an object.