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, ParserError, ParserOptions};
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§
source§impl<E> Display for ParserError<E>where
E: Debug,
impl<E> Display for ParserError<E>where E: Debug,
source§impl<E: Debug> Error for ParserError<E>
impl<E: Debug> Error for ParserError<E>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<E> PartialEq<ParserError<E>> for ParserError<E>where
E: Debug + PartialEq,
impl<E> PartialEq<ParserError<E>> for ParserError<E>where E: Debug + PartialEq,
source§fn 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 ==
.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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more