Heap

Struct Heap 

Source
pub struct Heap { /* private fields */ }

Implementations§

Source§

impl Heap

Source

pub fn new(budget: usize) -> Heap

Source

pub fn spawn(&mut self, thunk: Val) -> Id

Seed a task from outside. The thunk is applied to nil.

Source

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.

Source

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.

Source

pub fn alive(&self, id: Id) -> bool

Source

pub fn take_exits(&mut self) -> Vec<(Id, Val)>

Tasks that have ended since this was last called, in the order they ended.

Source

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.

Source

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.

Source

pub fn run(&mut self) -> Result<(), Fault>

Until the queue empties - every task finished or parked on an empty mailbox.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.