Crate hadean [] [src]

Bindings for Hadean. Requires the Hadean Rust compiler.

Macros

closure

Prepare a closure to be sent over a channel. Looks behaves like Rust closures, but argument types must always be specified, as well as captured variable names and their types.

mkprocess

Prepare a process to be spawned, with a function name and arguments.

Structs

Channel

Zero or more channels are given to spawn(). At least one of src and dst must be of type ChannelEndpoint::Sibling(), and they cannot be the same.

Connection

TCP duplex connection, not currently available on Hadean local - use normal Tcp connections.

Pid

Opaque "Process ID" – a reference to a process that can be sent around and ultimately handed to spawn.

Process

One or more Processs are given to spawn(). Each contains a function, and its arguments. The arguments are the only things copied over, i.e. global variables are not, unlike Linux's fork.

RawReceiver

Untyped receiving end of a channel, can be converted to a Receiver<T>. Either returned by spawn(), given to a newly-spawned worker in its arguments, or opened by the user to accept a newly-spawned ChannelEndpoint::Pid channel end.

RawSender

Untyped sending end of a channel, can be converted to a Sender<T>. Either returned by spawn(), given to a newly-spawned worker in its arguments, or opened by the user to accept a newly-spawned ChannelEndpoint::Pid channel end.

Receiver

Receiving end of a typed channel. Constructed with RawReceiver::downcast or RawReceiver::unchecked_downcast.

Sender

Sending end of a typed channel. Constructed with RawSender::downcast or RawSender::unchecked_downcast.

Enums

ChannelEndpoint

ChannelEndpoint enum.

Constants

DEFAULT_BUF_LEN

The default buffer size used for Senders and Receivers

Traits

FnSerialize

Trait to allow automatically generated closure structs to be sent over a channel, should be managed by the closure macro.

ProcessReceive

Can be received in a process from another.

ProcessSend

Can be sent from a process to another.

ProcessTransfer

Can be transferred between processes.

Functions

pid

Get the pid of this current process

sleep

sleep

spawn

Spawn one or more processes, and zero or more channels on those processes.