artichoke_backend::error

Trait RubyException

Source
pub trait RubyException: Error + 'static {
    // Required methods
    fn message(&self) -> Cow<'_, [u8]>;
    fn name(&self) -> Cow<'_, str>;
    fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>;
    fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>;
}
Expand description

Polymorphic exception type that corresponds to Ruby’s Exception.

All types that implement RubyException can be raised with error::raise. Rust code can re-raise a trait object to propagate exceptions from native code back into the interpreter.

Required Methods§

Source

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

Message of the Exception.

This value is a byte slice since Ruby Strings are equivalent to Vec<u8>.

Source

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

Class name of the Exception.

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.

Trait Implementations§

Source§

impl Error for Box<dyn RubyException>

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<CaughtException> for Box<dyn RubyException>

Source§

fn from(exc: CaughtException) -> Self

Converts to this type from the input type.
Source§

impl RubyException for Box<dyn RubyException>

Source§

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

Message of the Exception. Read more
Source§

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

Class name of the Exception.
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.

Implementations on Foreign Types§

Source§

impl RubyException for SymbolOverflowError

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl RubyException for ConvertBytesError

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl RubyException for DomainError

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl RubyException for Box<dyn RubyException>

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl RubyException for IncrementLinenoError

Source§

impl RubyException for NotDefinedError

Source§

impl RubyException for NoBlockGiven

Source§

impl RubyException for BoxIntoRubyError

Source§

impl RubyException for UnboxRubyError

Source§

impl RubyException for ConstantNameError

Source§

impl RubyException for CaughtException

Source§

impl RubyException for InterpreterExtractError

Source§

impl RubyException for WriteError

Source§

impl RubyException for ArenaSavepointError

Source§

impl RubyException for ArgumentError

Source§

impl RubyException for EOFError

Source§

impl RubyException for EncodingError

Source§

impl RubyException for Exception

Source§

impl RubyException for Fatal

Source§

impl RubyException for FiberError

Source§

impl RubyException for FloatDomainError

Source§

impl RubyException for FrozenError

Source§

impl RubyException for IOError

Source§

impl RubyException for IndexError

Source§

impl RubyException for Interrupt

Source§

impl RubyException for KeyError

Source§

impl RubyException for LoadError

Source§

impl RubyException for LocalJumpError

Source§

impl RubyException for NameError

Source§

impl RubyException for NoMemoryError

Source§

impl RubyException for NoMethodError

Source§

impl RubyException for NotImplementedError

Source§

impl RubyException for RangeError

Source§

impl RubyException for RegexpError

Source§

impl RubyException for RuntimeError

Source§

impl RubyException for ScriptError

Source§

impl RubyException for SecurityError

Source§

impl RubyException for SignalException

Source§

impl RubyException for StandardError

Source§

impl RubyException for StopIteration

Source§

impl RubyException for SyntaxError

Source§

impl RubyException for SystemCallError

Source§

impl RubyException for SystemExit

Source§

impl RubyException for SystemStackError

Source§

impl RubyException for ThreadError

Source§

impl RubyException for TypeError

Source§

impl RubyException for UncaughtThrowError

Source§

impl RubyException for ZeroDivisionError

Source§

impl RubyException for ArgCountError

Source§

impl RubyException for Error