Struct RuntimeError

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

Implementations§

Source§

impl RuntimeError

Source

pub fn invalid_unary_operand(operand: &Variant) -> Box<Self>

Source

pub fn invalid_binary_operands(lhs: &Variant, rhs: &Variant) -> Box<Self>

Source

pub fn overflow_error() -> Box<Self>

Source

pub fn divide_by_zero() -> Box<Self>

Source

pub fn negative_shift_count() -> Box<Self>

Source

pub fn name_not_defined(name: StringSymbol) -> Box<Self>

Source

pub fn cant_assign_immutable(name: StringSymbol) -> Box<Self>

Source

pub fn unhashable_value(value: &Variant) -> Box<Self>

Source

pub fn assert_failed(message: Option<StringValue>) -> Box<Self>

Source

pub fn missing_arguments(signature: &Signature, nargs: usize) -> Box<Self>

Source

pub fn too_many_arguments(signature: &Signature, nargs: usize) -> Box<Self>

Source

pub fn metamethod_not_supported( receiver: &Variant, method: MethodTag, ) -> Box<Self>

Source

pub fn invalid_value(message: impl AsRef<str>) -> Box<Self>

Source

pub fn other(message: impl AsRef<str>) -> Box<Self>

Source§

impl RuntimeError

Source

pub fn new(kind: ErrorKind, message: StringValue) -> Self

Source

pub fn kind(&self) -> &ErrorKind

Source

pub fn traceback(&self) -> Traceback<'_>

Source§

impl RuntimeError

Source

pub fn caused_by(self: Box<Self>, cause: Box<RuntimeError>) -> Box<Self>

Source

pub fn extend_trace( self: Box<Self>, trace: impl Iterator<Item = TraceSite>, ) -> Box<Self>

Source

pub fn push_trace(self: Box<Self>, site: TraceSite) -> Box<Self>

Trait Implementations§

Source§

impl Clone for RuntimeError

Source§

fn clone(&self) -> RuntimeError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RuntimeError

Source§

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

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

impl Display for RuntimeError

Source§

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

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

impl Error for RuntimeError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl GcTrace for RuntimeError

Source§

fn trace(&self)

SAFETY: Must call Gc::mark_trace() on every reachable Gc handle
Source§

fn size_hint(&self) -> usize

If the GcTrace owns any allocations, this should return the extra allocated size. If the allocation can change size, like a Vec, then don’t include it in the size hint, or return a const estimate of the average size.
Source§

fn cleanup(&self)

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, 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.