pub struct Heap { /* private fields */ }Implementations§
Source§impl Heap
impl Heap
pub fn new(budget: usize) -> Heap
Sourcepub fn spawn(&mut self, thunk: Val) -> Id
pub fn spawn(&mut self, thunk: Val) -> Id
Seed a task from outside. The thunk is applied to nil.
Sourcepub fn idle(&self) -> bool
pub fn idle(&self) -> bool
A heap with live tasks and an empty queue is waiting on a message from outside; a heap with none is finished.
Sourcepub fn post(&mut self, to: &Val, msg: Val)
pub fn post(&mut self, to: &Val, msg: Val)
Waking it if it was parked. An address for anything else is dropped, exactly as a send to a task that has ended is.
pub fn alive(&self, id: Id) -> bool
Sourcepub fn take_exits(&mut self) -> Vec<(Id, Val)>
pub fn take_exits(&mut self) -> Vec<(Id, Val)>
Tasks that have ended since this was last called, in the order they ended.
Sourcepub fn take_away(&mut self) -> Vec<(Val, Val)>
pub fn take_away(&mut self) -> Vec<(Val, Val)>
Routing these is the executor’s job: another heap, another machine and a
host adapter are all just the far end of a channel, which is what lets a
syscall be an ordinary send rather than a floor verb.
Sourcepub fn take_watches(&mut self) -> Vec<(Id, Val)>
pub fn take_watches(&mut self) -> Vec<(Id, Val)>
As (watcher, address). Whether such a thing is alive is not a question
this heap can put, so the answer is owed by whoever holds link or peer.
Auto Trait Implementations§
impl Freeze for Heap
impl !RefUnwindSafe for Heap
impl Send for Heap
impl Sync for Heap
impl Unpin for Heap
impl !UnwindSafe for Heap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more