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
sourceimpl Error
impl Error
sourcepub fn new<T>(class: ExceptionClass, msg: T) -> Self where
T: Into<Cow<'static, str>>,
pub fn new<T>(class: ExceptionClass, msg: T) -> Self where
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) -> Self where
T: Into<Cow<'static, str>>,
pub fn runtime_error<T>(msg: T) -> Self where
T: Into<Cow<'static, str>>,
Create a new RuntimeError
with msg
.
sourcepub fn iter_break<T>(val: Option<T>) -> Self where
T: Into<Value>,
pub fn iter_break<T>(val: Option<T>) -> Self where
T: Into<Value>,
Create a new error that will break from a loop when returned to Ruby.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more