Enum icu::pattern::ParserError
source · #[non_exhaustive]pub enum ParserError<E>where
E: Debug,{
IllegalCharacter(char),
InvalidPlaceholder(E),
UnclosedPlaceholder,
UnclosedQuotedLiteral,
}
Expand description
An error returned when parsing a pattern.
✨ Enabled with the alloc
Cargo feature.
§Examples
use icu_pattern::{Parser, ParserError, ParserOptions};
let mut parser = Parser::<usize>::new("{0", ParserOptions::default());
assert_eq!(Err(ParserError::UnclosedPlaceholder), parser.try_next());
§Type parameters
E
: An error of the replacement type which implementsFromStr
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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> Debug for ParserError<E>where
E: Debug,
impl<E> Debug for ParserError<E>where
E: Debug,
source§impl<E> Display for ParserError<E>where
E: Debug,
impl<E> Display for ParserError<E>where
E: Debug,
source§impl<E> Error for ParserError<E>where
E: Debug,
impl<E> Error for ParserError<E>where
E: Debug,
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 for ParserError<E>
impl<E> PartialEq for ParserError<E>
impl<E> StructuralPartialEq for ParserError<E>where
E: Debug,
Auto Trait Implementations§
impl<E> Freeze for ParserError<E>where
E: Freeze,
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more