Struct spinoso_regexp::RegexpError[][src]

pub struct RegexpError(_);

Error that indicates a Regexp was malformed at runtime.

This error is typically generated by Regexp::compile.

This error corresponds to the Ruby RegexpError Exception class.

Examples

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

let err = RegexpError::with_message(r"invalid multibyte character: /\xFF\xFE/");
assert_eq!(err.message(), r"invalid multibyte character: /\xFF\xFE/");

Implementations

impl RegexpError[src]

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

Construct a new, default regexp error.

Examples

const ERR: RegexpError = RegexpError::new();
assert_eq!(ERR.message(), "RegexpError");

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

Construct a new regexp error with a message.

Examples

const ERR: RegexpError = RegexpError::with_message(r"invalid multibyte character: /\xFF\xFE/");
assert_eq!(ERR.message(), r"invalid multibyte character: /\xFF\xFE/");

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

Retrieve the exception message associated with this regexp error.

Examples

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

let err = RegexpError::with_message(r"invalid multibyte character: /\xFF\xFE/");
assert_eq!(err.message(), r"invalid multibyte character: /\xFF\xFE/");

Trait Implementations

impl Clone for RegexpError[src]

impl Debug for RegexpError[src]

impl Display for RegexpError[src]

impl Eq for RegexpError[src]

impl Error for RegexpError[src]

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

impl From<RegexpError> for Error[src]

impl From<String> 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 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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.