pub struct RegexpError { /* private fields */ }
Expand description
Ruby RegexpError
error type.
Descendants of class Exception
are used to communicate between
Kernel#raise
and rescue
statements in begin ... end
blocks.
Exception objects carry information about the exception – its type (the
exception’s class name), an optional descriptive string, and optional
traceback information. Exception
subclasses may add additional information
like NameError#name
.
Implementations§
Source§impl RegexpError
impl RegexpError
Sourcepub const fn new() -> RegexpError
pub const fn new() -> RegexpError
Construct a new, default RegexpError
Ruby exception.
This constructor sets the exception message to RegexpError
.
§Examples
let exception = RegexpError::new();
assert_eq!(exception.message(), b"RegexpError");
Sourcepub const fn with_message(message: &'static str) -> RegexpError
pub const fn with_message(message: &'static str) -> RegexpError
Construct a new, RegexpError
Ruby exception with the given
message.
§Examples
let exception = RegexpError::with_message("an error occurred");
assert_eq!(exception.message(), b"an error occurred");
Sourcepub fn message(&self) -> &[u8] ⓘ
pub fn message(&self) -> &[u8] ⓘ
Return the message this Ruby exception was constructed with.
§Examples
let exception = RegexpError::new();
assert_eq!(exception.message(), b"RegexpError");
let exception = RegexpError::from("something went wrong");
assert_eq!(exception.message(), b"something went wrong");
Trait Implementations§
Source§impl Clone for RegexpError
impl Clone for RegexpError
Source§fn clone(&self) -> RegexpError
fn clone(&self) -> RegexpError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RegexpError
impl Debug for RegexpError
Source§impl Default for RegexpError
impl Default for RegexpError
Source§fn default() -> RegexpError
fn default() -> RegexpError
Returns the “default value” for a type. Read more
Source§impl Display for RegexpError
impl Display for RegexpError
Source§impl Error for RegexpError
impl Error for RegexpError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<&'static [u8]> for RegexpError
impl From<&'static [u8]> for RegexpError
Source§fn from(message: &'static [u8]) -> RegexpError
fn from(message: &'static [u8]) -> RegexpError
Converts to this type from the input type.
Source§impl From<&'static str> for RegexpError
impl From<&'static str> for RegexpError
Source§fn from(message: &'static str) -> RegexpError
fn from(message: &'static str) -> RegexpError
Converts to this type from the input type.
Source§impl From<RegexpError> for Error
impl From<RegexpError> for Error
Source§fn from(exception: RegexpError) -> Error
fn from(exception: RegexpError) -> Error
Converts to this type from the input type.
Source§impl From<String> for RegexpError
impl From<String> for RegexpError
Source§fn from(message: String) -> RegexpError
fn from(message: String) -> RegexpError
Converts to this type from the input type.
Source§impl Hash for RegexpError
impl Hash for RegexpError
Source§impl Ord for RegexpError
impl Ord for RegexpError
Source§fn cmp(&self, other: &RegexpError) -> Ordering
fn cmp(&self, other: &RegexpError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RegexpError
impl PartialEq for RegexpError
Source§impl PartialOrd for RegexpError
impl PartialOrd for RegexpError
Source§impl RubyException for RegexpError
impl RubyException for RegexpError
Source§impl RubyException for RegexpError
impl RubyException for RegexpError
Source§fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>
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>
fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>
Return a raise-able
sys::mrb_value
.impl Eq for RegexpError
impl StructuralPartialEq for RegexpError
Auto Trait Implementations§
impl Freeze for RegexpError
impl RefUnwindSafe for RegexpError
impl Send for RegexpError
impl Sync for RegexpError
impl Unpin for RegexpError
impl UnwindSafe for RegexpError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more