Skip to main content

Io

Struct Io 

Source
pub struct Io {
    pub value: Value,
    pub returned: Value,
}
Expand description

The built capability, plus the one thing about it a runner has to recognize.

Fields§

§value: Value

The IO module instance — what __main is applied to, and the whole of what the program is authorized to do.

§returned: Value

The iota IO.Proc.return raises with. Io::run compares an uncaught raise against it to tell “the program asked to exit with a status” from “the program failed”; nothing else can mint this value.

Implementations§

Source§

impl Io

Source

pub fn run(&self, instance: &Value, ctx: &Ctx) -> Run

Run instance’s __main: evaluate the body in the module’s own environment, apply the result to IO, and say how it ended.

Source

pub fn finish(&self, result: Result<Value, Raised>) -> Run

Say how a computation that was given IO ended. run uses it for __main; a host that hands IO to something else, such as the playground’s bare expression, uses it directly.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Io

§

impl !Send for Io

§

impl !Sync for Io

§

impl !UnwindSafe for Io

§

impl Freeze for Io

§

impl Unpin for Io

§

impl UnsafeUnpin for Io

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.