Struct spinoso_exception::RegexpError[][src]

pub struct RegexpError { /* fields omitted */ }

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.


impl RegexpError[src]

#[must_use]pub const fn new() -> Self[src]

Construct a new, default RegexpError Ruby exception.

This constructor sets the exception message to RegexpError.


let exception = RegexpError::new();
assert_eq!(exception.message(), b"RegexpError");

#[must_use]pub const fn with_message(message: &'static str) -> Self[src]

Construct a new, RegexpError Ruby exception with the given message.


let exception = RegexpError::with_message("an error occurred");
assert_eq!(exception.message(), b"an error occurred");

#[must_use]pub fn message(&self) -> &[u8][src]

Return the message this Ruby exception was constructed with.


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");

#[must_use]pub const fn name(&self) -> &'static str[src]

Return this Ruby exception’s class name.


let exception = RegexpError::new();
assert_eq!(, "RegexpError");

Trait Implementations

impl Clone for RegexpError[src]

impl Debug for RegexpError[src]

impl Default for RegexpError[src]

impl Display for RegexpError[src]

impl Eq for RegexpError[src]

impl Error for RegexpError[src]

impl From<&'static [u8]> for RegexpError[src]

impl From<&'static str> for RegexpError[src]

impl From<Cow<'static, [u8]>> for RegexpError[src]

impl From<Cow<'static, str>> for RegexpError[src]

impl From<String> for RegexpError[src]

impl From<Vec<u8, Global>> for RegexpError[src]

impl Hash for RegexpError[src]

impl Ord for RegexpError[src]

impl PartialEq<RegexpError> for RegexpError[src]

impl PartialOrd<RegexpError> for RegexpError[src]

impl RubyException for RegexpError[src]

impl StructuralEq for RegexpError[src]

impl StructuralPartialEq for RegexpError[src]

Auto Trait Implementations

impl RefUnwindSafe for RegexpError

impl Send for RegexpError

impl Sync for RegexpError

impl Unpin for RegexpError

impl UnwindSafe for RegexpError

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.