artichoke::prelude

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

Source§

impl RubyException for IncrementLinenoError

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 ArgCountError

Source§

impl RubyException for Error

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