Enum icu_pattern::ParserError
source · [−]pub enum ParserError<E> where
E: Debug, {
IllegalCharacter(char),
InvalidPlaceholder(E),
UnclosedPlaceholder,
UnclosedQuotedLiteral,
}
Expand description
An error returned when parsing a pattern.
Examples
use icu_pattern::{Parser, ParserOptions, ParserError};
let mut parser = Parser::<usize>::new("{0", ParserOptions {
allow_raw_letters: false,
});
assert_eq!(Err(ParserError::UnclosedPlaceholder), parser.try_next());
Type parameters
E
: An error of the replacement type which implementsFromStr
.
Variants
IllegalCharacter(char)
Encountered an illegal character.
InvalidPlaceholder(E)
Placeholder hould not be parsed from the given string slice.
UnclosedPlaceholder
The pattern contains an unclosed placeholder.
UnclosedQuotedLiteral
The pattern contains an unclosed quoted literal.
Trait Implementations
sourceimpl<E: Debug> Debug for ParserError<E> where
E: Debug,
impl<E: Debug> Debug for ParserError<E> where
E: Debug,
sourceimpl<E> Display for ParserError<E> where
E: Debug,
impl<E> Display for ParserError<E> where
E: Debug,
sourceimpl<E: Debug> Error for ParserError<E>
impl<E: Debug> Error for ParserError<E>
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl<E: PartialEq> PartialEq<ParserError<E>> for ParserError<E> where
E: Debug,
impl<E: PartialEq> PartialEq<ParserError<E>> for ParserError<E> where
E: Debug,
sourcefn eq(&self, other: &ParserError<E>) -> bool
fn eq(&self, other: &ParserError<E>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ParserError<E>) -> bool
fn ne(&self, other: &ParserError<E>) -> bool
This method tests for !=
.
impl<E> StructuralPartialEq for ParserError<E> where
E: Debug,
Auto Trait Implementations
impl<E> RefUnwindSafe for ParserError<E> where
E: RefUnwindSafe,
impl<E> Send for ParserError<E> where
E: Send,
impl<E> Sync for ParserError<E> where
E: Sync,
impl<E> Unpin for ParserError<E> where
E: Unpin,
impl<E> UnwindSafe for ParserError<E> where
E: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more