pub struct UnexpectedCharacter {
pub position: usize,
pub character: CharOrByte,
pub expected: ExpectedCharacter,
}Expand description
The input string contains an unexpected character.
Fields§
§position: usizeThe byte offset within the input where the error occurs.
This points to the unexpected character in the input text.
character: CharOrByteThe unexpected character.
If the unexpected character is not a valid UTF-8 sequence, this will simply hold the value of the unexpected byte.
expected: ExpectedCharacterA human readable message about what was expected instead.
Trait Implementations§
Source§impl Clone for UnexpectedCharacter
impl Clone for UnexpectedCharacter
Source§fn clone(&self) -> UnexpectedCharacter
fn clone(&self) -> UnexpectedCharacter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnexpectedCharacter
impl Debug for UnexpectedCharacter
Source§impl Display for UnexpectedCharacter
impl Display for UnexpectedCharacter
Source§impl Error for UnexpectedCharacter
impl Error for UnexpectedCharacter
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 From<UnexpectedCharacter> for Error
impl From<UnexpectedCharacter> for Error
Source§fn from(other: UnexpectedCharacter) -> Self
fn from(other: UnexpectedCharacter) -> Self
Converts to this type from the input type.
Source§impl From<UnexpectedCharacter> for ParseError
impl From<UnexpectedCharacter> for ParseError
Source§fn from(other: UnexpectedCharacter) -> Self
fn from(other: UnexpectedCharacter) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for UnexpectedCharacter
impl RefUnwindSafe for UnexpectedCharacter
impl Send for UnexpectedCharacter
impl Sync for UnexpectedCharacter
impl Unpin for UnexpectedCharacter
impl UnwindSafe for UnexpectedCharacter
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