Skip to main content

RunError

Enum RunError 

Source
pub enum RunError<A: IVm> {
    Thrown(Any<A>),
    NoExport(String),
    NotCallable(Any<A>),
    Json(JsonError),
}
Expand description

Why a run produced no JSON.

A throw is the language’s own failure — 1n / 0n, a property read on a nullish base the compiler could not see — and the thrown value is an ordinary Any<A>, reported as the value it is rather than turned into a panic. NoExport and NotCallable are the caller’s mistakes, not the program’s, so neither is reported as a throw.

Debug and PartialEq are written out rather than derived: a derive would ask them of A itself, which no VM promises, where Any<A> has both for every VM.

Variants§

§

Thrown(Any<A>)

The module threw while evaluating, or the called export threw.

§

NoExport(String)

export is not an own property of the export object: the name as the caller passed it. It is the caller’s text, never a VM value, so it compares and prints without a VM.

§

NotCallable(Any<A>)

Action::Call on a value that is not a function: that value.

§

Json(JsonError)

The selected value or call result has no JSON.

Trait Implementations§

Source§

impl<A: IVm> Debug for RunError<A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: IVm> Display for RunError<A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: IVm> PartialEq for RunError<A>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<A> Freeze for RunError<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for RunError<A>
where A: RefUnwindSafe,

§

impl<A> Send for RunError<A>
where A: Send,

§

impl<A> Sync for RunError<A>
where A: Sync,

§

impl<A> Unpin for RunError<A>
where A: Unpin,

§

impl<A> UnsafeUnpin for RunError<A>
where A: UnsafeUnpin,

§

impl<A> UnwindSafe for RunError<A>
where A: UnwindSafe,

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> ToAny for T

Source§

fn to_any<A>(self) -> Any<A>
where A: IVm, Self: Into<Unpacked<A>>,

Source§

impl<T> ToArray for T

Source§

fn to_array<A>(self) -> Array<A>
where A: IVm, Self: Sized + IntoIterator<Item = Any<A>>,

Source§

impl<T> ToObject for T

Source§

fn to_object<A>(self) -> Object<A>
where A: IVm, Self: Sized + IntoIterator<Item = (String<A>, Any<A>)>,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToString for T

Source§

fn try_to_string<A>(self) -> Result<String<A>, Any<A>>
where A: IVm, Self: Sized + IntoIterator<Item = Result<u16, Any<A>>>,

Source§

fn to_string<A>(self) -> String<A>
where A: IVm, Self: Sized + IntoIterator<Item = u16>,

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.