#[non_exhaustive]pub enum EscapeError {
Show 23 variants
ZeroChars,
MoreThanOneChar,
LoneSlash,
InvalidEscape,
BareCarriageReturn,
BareCarriageReturnInRawString,
EscapeOnlyChar,
TooShortHexEscape,
InvalidCharInHexEscape,
OutOfRangeHexEscape,
NoBraceInUnicodeEscape,
InvalidCharInUnicodeEscape,
EmptyUnicodeEscape,
UnclosedUnicodeEscape,
LeadingUnderscoreUnicodeEscape,
OverlongUnicodeEscape,
LoneSurrogateUnicodeEscape,
OutOfRangeUnicodeEscape,
UnicodeEscapeInByte,
NonAsciiCharInByte,
NulInCStr,
UnskippedWhitespaceWarning,
MultipleSkippedLinesWarning,
}proc_macro_value #136652)Expand description
Mostly relating to malformed escape sequences, but also a few other problems.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ZeroChars
proc_macro_value #136652)Expected 1 char, but 0 were found.
MoreThanOneChar
proc_macro_value #136652)Expected 1 char, but more than 1 were found.
LoneSlash
proc_macro_value #136652)Escaped ’' character without continuation.
InvalidEscape
proc_macro_value #136652)Invalid escape character (e.g. ‘\z’).
BareCarriageReturn
proc_macro_value #136652)Raw ‘\r’ encountered.
BareCarriageReturnInRawString
proc_macro_value #136652)Raw ‘\r’ encountered in raw string.
EscapeOnlyChar
proc_macro_value #136652)Unescaped character that was expected to be escaped (e.g. raw ‘\t’).
TooShortHexEscape
proc_macro_value #136652)Numeric character escape is too short (e.g. ‘\x1’).
InvalidCharInHexEscape
proc_macro_value #136652)Invalid character in numeric escape (e.g. ‘\xz’)
OutOfRangeHexEscape
proc_macro_value #136652)Character code in numeric escape is non-ascii (e.g. ‘\xFF’).
NoBraceInUnicodeEscape
proc_macro_value #136652)‘\u’ not followed by ‘{’.
InvalidCharInUnicodeEscape
proc_macro_value #136652)Non-hexadecimal value in ‘\u{..}’.
EmptyUnicodeEscape
proc_macro_value #136652)‘\u{}’
UnclosedUnicodeEscape
proc_macro_value #136652)No closing brace in ‘\u{..}’, e.g. ‘\u{12’.
LeadingUnderscoreUnicodeEscape
proc_macro_value #136652)‘\u{_12}’
OverlongUnicodeEscape
proc_macro_value #136652)More than 6 characters in ‘\u{..}’, e.g. ‘\u{10FFFF_FF}’
LoneSurrogateUnicodeEscape
proc_macro_value #136652)Invalid in-bound unicode character code, e.g. ‘\u{DFFF}’.
OutOfRangeUnicodeEscape
proc_macro_value #136652)Out of bounds unicode character code, e.g. ‘\u{FFFFFF}’.
UnicodeEscapeInByte
proc_macro_value #136652)Unicode escape code in byte literal.
NonAsciiCharInByte
proc_macro_value #136652)Non-ascii character in byte literal, byte string literal, or raw byte string literal.
NulInCStr
proc_macro_value #136652)\0 in a C string literal.
UnskippedWhitespaceWarning
proc_macro_value #136652)After a line ending with ’', the next line contains whitespace characters that are not skipped.
MultipleSkippedLinesWarning
proc_macro_value #136652)After a line ending with ’', multiple lines are skipped.
Trait Implementations§
Source§impl Debug for EscapeError
impl Debug for EscapeError
Source§impl Display for EscapeError
impl Display for EscapeError
Source§impl Eq for EscapeError
impl Eq for EscapeError
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
derive_eq_internals)1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
implementation detail of #[derive(Eq)]
Source§impl Error for EscapeError
impl Error for EscapeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Source§#[doc(hidden)]fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
#[doc(hidden)]fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
error_type_id #60784)TypeId of self.1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<EscapeError> for EscapeError
impl From<EscapeError> for EscapeError
Source§fn from(value: EscapeError) -> Self
fn from(value: EscapeError) -> Self
Source§impl PartialEq for EscapeError
impl PartialEq for EscapeError
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§
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
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type #102070)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read more