artichoke_backend::error

Struct Error

Source
pub struct Error(/* private fields */);
Expand description

The Error type, a wrapper around a dynamic exception type.

Error works a lot like Box<dyn std::error::Error>, but with these differences:

  • Error requires that the error is 'static.
  • Error requires that the error implement RubyException.
  • Error can convert itself to a backtrace on the underlying Ruby VM.

All types that implement RubyException are able to be converted to Error.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

1.30.0 · 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 From<ArenaSavepointError> for Error

Source§

fn from(exception: ArenaSavepointError) -> Self

Converts to this type from the input type.
Source§

impl From<ArgCountError> for Error

Source§

fn from(exception: ArgCountError) -> Self

Converts to this type from the input type.
Source§

impl From<ArgumentError> for Error

Source§

fn from(err: EnvArgumentError) -> Self

Converts to this type from the input type.
Source§

impl From<ArgumentError> for Error

Source§

fn from(exception: ArgumentError) -> Error

Converts to this type from the input type.
Source§

impl From<ArgumentError> for Error

Source§

fn from(err: ArgumentError) -> Self

Converts to this type from the input type.
Source§

impl From<ArgumentError> for Error

Source§

fn from(err: ArgumentError) -> Self

Converts to this type from the input type.
Source§

impl From<Box<dyn RubyException>> for Error

Source§

fn from(exc: Box<dyn RubyException>) -> Self

Converts to this type from the input type.
Source§

impl From<BoxIntoRubyError> for Error

Source§

fn from(exception: BoxIntoRubyError) -> Self

Converts to this type from the input type.
Source§

impl From<CaughtException> for Error

Source§

fn from(exc: CaughtException) -> Self

Converts to this type from the input type.
Source§

impl From<ConstantNameError> for Error

Source§

fn from(exception: ConstantNameError) -> Self

Converts to this type from the input type.
Source§

impl From<ConvertBytesError> for Error

Source§

fn from(exception: ConvertBytesError) -> Self

Converts to this type from the input type.
Source§

impl From<DomainError> for Error

Source§

fn from(exception: DomainError) -> Self

Converts to this type from the input type.
Source§

impl From<DomainError> for Error

Source§

fn from(err: DomainError) -> Self

Converts to this type from the input type.
Source§

impl From<EOFError> for Error

Source§

fn from(exception: EOFError) -> Error

Converts to this type from the input type.
Source§

impl From<EncodingError> for Error

Source§

fn from(exception: EncodingError) -> Error

Converts to this type from the input type.
Source§

impl<'a> From<Error<'a>> for Error

Source§

fn from(err: Error<'a>) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(err: EnvError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(err: MathError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(err: SecureRandomError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Exception> for Error

Source§

fn from(exception: Exception) -> Error

Converts to this type from the input type.
Source§

impl From<Fatal> for Error

Source§

fn from(exception: Fatal) -> Error

Converts to this type from the input type.
Source§

impl From<FiberError> for Error

Source§

fn from(exception: FiberError) -> Error

Converts to this type from the input type.
Source§

impl From<FloatDomainError> for Error

Source§

fn from(exception: FloatDomainError) -> Error

Converts to this type from the input type.
Source§

impl From<FrozenError> for Error

Source§

fn from(exception: FrozenError) -> Error

Converts to this type from the input type.
Source§

impl From<IOError> for Error

Source§

fn from(exception: IOError) -> Error

Converts to this type from the input type.
Source§

impl From<IncrementLinenoError> for Error

Source§

fn from(exception: IncrementLinenoError) -> Self

Converts to this type from the input type.
Source§

impl From<IndexError> for Error

Source§

fn from(exception: IndexError) -> Error

Converts to this type from the input type.
Source§

impl From<InitializeError> for Error

Source§

fn from(err: InitializeError) -> Self

Converts to this type from the input type.
Source§

impl From<InterpreterExtractError> for Error

Source§

fn from(exception: InterpreterExtractError) -> Self

Converts to this type from the input type.
Source§

impl From<Interrupt> for Error

Source§

fn from(exception: Interrupt) -> Error

Converts to this type from the input type.
Source§

impl From<InvalidError> for Error

Source§

fn from(err: InvalidError) -> Self

Converts to this type from the input type.
Source§

impl From<KeyError> for Error

Source§

fn from(exception: KeyError) -> Error

Converts to this type from the input type.
Source§

impl From<LoadError> for Error

Source§

fn from(exception: LoadError) -> Error

Converts to this type from the input type.
Source§

impl From<LocalJumpError> for Error

Source§

fn from(exception: LocalJumpError) -> Error

Converts to this type from the input type.
Source§

impl From<NameError> for Error

Source§

fn from(exception: NameError) -> Error

Converts to this type from the input type.
Source§

impl From<NewSeedError> for Error

Source§

fn from(err: NewSeedError) -> Self

Converts to this type from the input type.
Source§

impl From<NoBlockGiven> for Error

Source§

fn from(exception: NoBlockGiven) -> Self

Converts to this type from the input type.
Source§

impl From<NoMemoryError> for Error

Source§

fn from(exception: NoMemoryError) -> Error

Converts to this type from the input type.
Source§

impl From<NoMethodError> for Error

Source§

fn from(exception: NoMethodError) -> Error

Converts to this type from the input type.
Source§

impl From<NotDefinedError> for Error

Source§

fn from(exception: NotDefinedError) -> Self

Converts to this type from the input type.
Source§

impl From<NotImplementedError> for Error

Source§

fn from(exception: NotImplementedError) -> Error

Converts to this type from the input type.
Source§

impl From<NotImplementedError> for Error

Source§

fn from(err: MathNotImplementedError) -> Self

Converts to this type from the input type.
Source§

impl From<RandomBytesError> for Error

Source§

fn from(err: RandomBytesError) -> Self

Converts to this type from the input type.
Source§

impl From<RangeError> for Error

Source§

fn from(exception: RangeError) -> Error

Converts to this type from the input type.
Source§

impl From<RegexpError> for Error

Source§

fn from(exception: RegexpError) -> Error

Converts to this type from the input type.
Source§

impl From<RuntimeError> for Error

Source§

fn from(exception: RuntimeError) -> Error

Converts to this type from the input type.
Source§

impl From<ScriptError> for Error

Source§

fn from(exception: ScriptError) -> Error

Converts to this type from the input type.
Source§

impl From<SecurityError> for Error

Source§

fn from(exception: SecurityError) -> Error

Converts to this type from the input type.
Source§

impl From<SignalException> for Error

Source§

fn from(exception: SignalException) -> Error

Converts to this type from the input type.
Source§

impl From<StandardError> for Error

Source§

fn from(exception: StandardError) -> Error

Converts to this type from the input type.
Source§

impl From<StopIteration> for Error

Source§

fn from(exception: StopIteration) -> Error

Converts to this type from the input type.
Source§

impl From<SymbolOverflowError> for Error

Source§

fn from(exception: SymbolOverflowError) -> Self

Converts to this type from the input type.
Source§

impl From<SyntaxError> for Error

Source§

fn from(exception: SyntaxError) -> Error

Converts to this type from the input type.
Source§

impl From<SystemCallError> for Error

Source§

fn from(exception: SystemCallError) -> Error

Converts to this type from the input type.
Source§

impl From<SystemExit> for Error

Source§

fn from(exception: SystemExit) -> Error

Converts to this type from the input type.
Source§

impl From<SystemStackError> for Error

Source§

fn from(exception: SystemStackError) -> Error

Converts to this type from the input type.
Source§

impl From<ThreadError> for Error

Source§

fn from(exception: ThreadError) -> Error

Converts to this type from the input type.
Source§

impl From<TimeError> for Error

Source§

fn from(error: TimeError) -> Error

Converts to this type from the input type.
Source§

impl From<TypeError> for Error

Source§

fn from(exception: TypeError) -> Error

Converts to this type from the input type.
Source§

impl From<UnboxRubyError> for Error

Source§

fn from(exception: UnboxRubyError) -> Self

Converts to this type from the input type.
Source§

impl From<UncaughtThrowError> for Error

Source§

fn from(exception: UncaughtThrowError) -> Error

Converts to this type from the input type.
Source§

impl From<UrandomError> for Error

Source§

fn from(err: UrandomError) -> Self

Converts to this type from the input type.
Source§

impl From<WriteError> for Error

Source§

fn from(exception: WriteError) -> Self

Converts to this type from the input type.
Source§

impl From<ZeroDivisionError> for Error

Source§

fn from(exception: ZeroDivisionError) -> Error

Converts to this type from the input type.
Source§

impl RubyException for Error

Source§

fn name(&self) -> Cow<'_, str>

Class name of the Exception.

Source§

fn message(&self) -> Cow<'_, [u8]>

Message of the Exception. Read more
Source§

fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>

Optional backtrace specified by a Vec of frames.
Source§

fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>

Return a raise-able sys::mrb_value.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl !Send for Error

§

impl !Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

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> 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.