Skip to main content

NoReentry

Struct NoReentry 

Source
pub struct NoReentry;
Expand description

A Reentry for a caller that has no interpreter to reenter.

HostRegistry::call uses it, so a host that never runs a callback can still be driven from a test or a tool with no program behind it. An operation that does need one is told what is missing rather than being handed a closure it cannot run.

Trait Implementations§

Source§

impl Reentry for NoReentry

Source§

fn time_left(&self) -> Option<Duration>

A caller with no run behind it has no deadline to run out of, so a host driven from a test or a tool waits for as long as its own limits allow and no less.

Source§

fn task(&self) -> u64

A caller with no program behind it made the call the way an entry makes one: outside any spawned task.

Source§

fn call( &mut self, callee: &Value, _args: Vec<Value>, ) -> Result<Value, RuntimeError>

Calls callee with args and answers what it produced. Read more
Source§

fn call_until( &mut self, callee: &Value, args: Vec<Value>, _stop: &Cancellation, ) -> Result<Value, RuntimeError>

Calls callee with args, stopping it at its next safepoint if stop is raised while it runs. Read more
Source§

fn is_cancelled(&self) -> bool

Whether the work that made this host call has been asked to stop. Read more

Auto Trait Implementations§

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.