pub enum Error {
Jump(Tag),
Error(ExceptionClass, Cow<'static, str>),
Exception(Exception),
}
Expand description
A Rust representation of a Ruby Exception
or other interrupt.
Variants§
Jump(Tag)
An interrupt, such as break
or throw
.
Error(ExceptionClass, Cow<'static, str>)
An error generated in Rust code that will raise an exception when returned to Ruby.
Exception(Exception)
A Ruby Exception
captured from Ruby as an Error.
Implementations§
source§impl Error
impl Error
sourcepub fn new<T>(class: ExceptionClass, msg: T) -> Selfwhere
T: Into<Cow<'static, str>>,
pub fn new<T>(class: ExceptionClass, msg: T) -> Selfwhere
T: Into<Cow<'static, str>>,
Create a new Error
that can be raised as a Ruby Exception
with msg
.
sourcepub fn runtime_error<T>(msg: T) -> Selfwhere
T: Into<Cow<'static, str>>,
pub fn runtime_error<T>(msg: T) -> Selfwhere
T: Into<Cow<'static, str>>,
Create a new RuntimeError
with msg
.
sourcepub fn iter_break<T>(val: Option<T>) -> Selfwhere
T: Into<Value>,
pub fn iter_break<T>(val: Option<T>) -> Selfwhere
T: Into<Value>,
Create a new error that will break from a loop when returned to Ruby.