Struct spinoso_regexp::SyntaxError[][src]

pub struct SyntaxError(_);

Error that indicates a given Regexp pattern could not be parsed when given as a /.../ literal in Ruby source code.

This error is typically generated at parse-time.

This error corresponds to the Ruby SyntaxError Exception class.

Examples

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

let err = SyntaxError::with_message("premature end of char-class");
assert_eq!(err.message(), "premature end of char-class");

Implementations

impl SyntaxError[src]

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

Construct a new, default syntax error.

Examples

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

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

Construct a new syntax error with a message.

Examples

const ERR: SyntaxError = SyntaxError::with_message("premature end of char-class");
assert_eq!(ERR.message(), "premature end of char-class");

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

Retrieve the exception message associated with this syntax error.

Examples

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

let err = SyntaxError::with_message("premature end of char-class");
assert_eq!(err.message(), "premature end of char-class");

Trait Implementations

impl Clone for SyntaxError[src]

impl Debug for SyntaxError[src]

impl Display for SyntaxError[src]

impl Eq for SyntaxError[src]

impl Error for SyntaxError[src]

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

impl From<String> for SyntaxError[src]

impl From<SyntaxError> for Error[src]

impl Hash for SyntaxError[src]

impl Ord for SyntaxError[src]

impl PartialEq<SyntaxError> for SyntaxError[src]

impl PartialOrd<SyntaxError> for SyntaxError[src]

impl StructuralEq for SyntaxError[src]

impl StructuralPartialEq for SyntaxError[src]

Auto Trait Implementations

impl RefUnwindSafe for SyntaxError

impl Send for SyntaxError

impl Sync for SyntaxError

impl Unpin for SyntaxError

impl UnwindSafe for SyntaxError

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.