Enum ruru::result::Error
[−]
[src]
pub enum Error { ArgumentError(String), TypeError(String), }
Variants
ArgumentError(String)
TypeError(String)
Methods
impl Error
[src]
fn to_exception(&self) -> Class
Converts error to an exception class.
Examples
use ruru::result::Error; use ruru::{Class, VM}; let argument_error = Error::ArgumentError("Argument is missing".to_string()); let type_error = Error::TypeError("Wrong type".to_string()); assert_eq!(argument_error.to_exception(), Class::from_existing("ArgumentError")); assert_eq!(type_error.to_exception(), Class::from_existing("TypeError"));
Trait Implementations
impl Debug for Error
[src]
impl PartialEq for Error
[src]
fn eq(&self, __arg_0: &Error) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Error) -> bool
This method tests for !=
.