pub trait Mail: Send {
// Required methods
fn spawn(&mut self, thunk: Val) -> Result<Val, Val>;
fn send(&mut self, addr: &Val, msg: Val) -> Result<Val, Val>;
fn receive(&mut self) -> Option<Val>;
fn monitor(&mut self, addr: &Val) -> Result<Val, Val>;
fn limit(&mut self, addr: &Val, turns: i64) -> Result<Val, Val>;
}Expand description
The floor’s only route to the world. It knows nothing about tasks beyond an address being an s-expression; the scheduler supplies this.
Required Methods§
fn spawn(&mut self, thunk: Val) -> Result<Val, Val>
fn send(&mut self, addr: &Val, msg: Val) -> Result<Val, Val>
Sourcefn receive(&mut self) -> Option<Val>
fn receive(&mut self) -> Option<Val>
None means the mailbox is empty, which is the only reason
anything in this machine ever blocks.