Enum EscapeError
#[non_exhaustive]
pub enum EscapeError
Mostly relating to malformed escape sequences, but also a few other problems.
Variants
-
ZeroChars Expected 1 char, but 0 were found.
-
MoreThanOneChar Expected 1 char, but more than 1 were found.
-
LoneSlash Escaped '' character without continuation.
-
InvalidEscape Invalid escape character (e.g. '\z').
-
BareCarriageReturn Raw '\r' encountered.
-
BareCarriageReturnInRawString Raw '\r' encountered in raw string.
-
EscapeOnlyChar Unescaped character that was expected to be escaped (e.g. raw '\t').
-
TooShortHexEscape Numeric character escape is too short (e.g. '\x1').
-
InvalidCharInHexEscape Invalid character in numeric escape (e.g. '\xz')
-
OutOfRangeHexEscape Character code in numeric escape is non-ascii (e.g. '\xFF').
-
NoBraceInUnicodeEscape '\u' not followed by '{'.
-
InvalidCharInUnicodeEscape Non-hexadecimal value in '\u{..}'.
-
EmptyUnicodeEscape '\u{}'
-
UnclosedUnicodeEscape No closing brace in '\u{..}', e.g. '\u{12'.
-
LeadingUnderscoreUnicodeEscape '\u{_12}'
-
OverlongUnicodeEscape More than 6 characters in '\u{..}', e.g. '\u{10FFFF_FF}'
-
LoneSurrogateUnicodeEscape Invalid in-bound unicode character code, e.g. '\u{DFFF}'.
-
OutOfRangeUnicodeEscape Out of bounds unicode character code, e.g. '\u{FFFFFF}'.
-
UnicodeEscapeInByte Unicode escape code in byte literal.
-
NonAsciiCharInByte Non-ascii character in byte literal, byte string literal, or raw byte string literal.
-
NulInCStr \0in a C string literal.-
UnskippedWhitespaceWarning After a line ending with '', the next line contains whitespace characters that are not skipped.
-
MultipleSkippedLinesWarning After a line ending with '', multiple lines are skipped.
Trait Implementations
impl Debug for EscapeError
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for EscapeError
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for EscapeError
fn assert_fields_are_eq(&self)
impl Error for EscapeError
impl From<EscapeError> for EscapeError
fn from(value: EscapeError) -> Self
impl PartialEq for EscapeError
fn eq(&self, other: &EscapeError) -> bool
impl StructuralPartialEq for EscapeError
Auto Trait Implementations
impl Freeze for EscapeError
impl RefUnwindSafe for EscapeError
impl Send for EscapeError
impl Sync for EscapeError
impl Unpin for EscapeError
impl UnsafeUnpin for EscapeError
impl UnwindSafe for EscapeError
Blanket Implementations
impl<T> Any for EscapeError
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for EscapeError
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for EscapeError
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for EscapeError
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for EscapeError
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for EscapeError
impl<T> ToString for EscapeError
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for EscapeError
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for EscapeError
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for EscapeError
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>