Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 14 variants BadPattern, Collate, CharClass, TrailingBackslash, BackRef, Unsupported, MissingBracket, MissingParen, MissingBrace, BadBrace, BadRange, Space, BadRepeat, BadMax,
}
Expand description

Why a pattern would not compile.

The names and the messages are TRE’s, from deps/tre/lib/regerror.c, because Redis puts the message straight into its error reply and a client that matches on the text should not be able to tell the two servers apart.

Variants§

§

BadPattern

REG_BADPAT, a pattern that is not one.

§

Collate

REG_ECOLLATE, a [. or [= bracket item.

§

CharClass

REG_ECTYPE, a [:name:] that is not a class.

§

TrailingBackslash

REG_EESCAPE, a backslash at the very end.

§

BackRef

REG_ESUBREG, a backreference to a group the pattern does not have.

§

Unsupported

A backreference to a group that does exist.

Not one of TRE’s codes. TRE compiles this and Redis refuses it a step later with a sentence of its own, so the message here is that sentence and a caller reporting it should not put “invalid regular expression” in front of it the way it would for the rest of these.

§

MissingBracket

REG_EBRACK, a bracket expression with no ].

§

MissingParen

REG_EPAREN, a group with no ).

§

MissingBrace

REG_EBRACE, a \x{ or a { with no }.

§

BadBrace

REG_BADBR, a {} whose contents are not a bound.

§

BadRange

REG_ERANGE, a bracket range that runs backwards.

§

Space

REG_ESPACE, a pattern that compiles to more than this engine will hold.

§

BadRepeat

REG_BADRPT, a repetition operator with nothing in front of it.

§

BadMax

REG_BADMAX, a {n,m} past DUP_MAX.

Implementations§

Source§

impl Error

Source

pub const fn as_str(self) -> &'static str

TRE’s message for this code, which is what the client sees.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Error

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Error

Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Error) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.