Type packet

type packet<T: send> = {header: packet_header, mut payload: option<T>,}

Type packet_header

type packet_header = {mut state: state, mut blocked_task: option<*rust_task>,}

Type rust_task

type rust_task = libc::c_void

Enum state

Variants

Implementation private_methods for packet_header

Method mark_blocked

fn mark_blocked(this: *rust_task) -> state

Method unblock

fn unblock()

Function entangle

fn entangle<T: send>() -> (send_packet<T>, recv_packet<T>)

Function packet

fn packet<T: send>() -> *packet<T>

Function receiver_terminate

fn receiver_terminate<T: send>(p: *packet<T>)

Function recv

fn recv<T: send>(-p: recv_packet<T>) -> option<T>

Function select

fn select<T: send>(+endpoints: ~[recv_packet<T>]) ->
   (uint, option<T>, ~[recv_packet<T>])

Waits on a set of endpoints. Returns a message, its index, and a list of the remaining endpoints.

Function send

fn send<T: send>(-p: send_packet<T>, -payload: T)

Function sender_terminate

fn sender_terminate<T: send>(p: *packet<T>)

Function spawn_service

fn spawn_service<T: send>(init:
                              extern fn() -> (send_packet<T>, recv_packet<T>),
                          +service: fn~(+recv_packet<T>)) -> send_packet<T>

Function spawn_service_recv

fn spawn_service_recv<T: send>(init:
                                   extern fn()
                                       -> (recv_packet<T>, send_packet<T>),
                               +service: fn~(+send_packet<T>)) ->
   recv_packet<T>

Function swap_state_acq

fn swap_state_acq(&dst: state, src: state) -> state

Function swap_state_rel

fn swap_state_rel(&dst: state, src: state) -> state

Function uniquify

unsafe fn uniquify<T>(x: *T) -> ~T

Function wait_many

fn wait_many(pkts: ~[&a .packet_header]) -> uint

Returns when one of the packet headers reports data is available.