pub enum StreamError {
Show 13 variants
UnexpectedEndOfStream,
InvalidName,
NonXmlChar(char, TextPos),
InvalidChar(u8, u8, TextPos),
InvalidCharMultiple(u8, &'static [u8], TextPos),
InvalidQuote(u8, TextPos),
InvalidSpace(u8, TextPos),
InvalidString(&'static str, TextPos),
InvalidReference,
InvalidExternalID,
InvalidCommentData,
InvalidCommentEnd,
InvalidCharacterData,
}Expand description
A stream parser errors.
Variants§
UnexpectedEndOfStream
The steam ended earlier than we expected.
Should only appear on invalid input data. Errors in a valid XML should be handled by errors below.
InvalidName
An invalid name.
NonXmlChar(char, TextPos)
A non-XML character has occurred.
Valid characters are: https://www.w3.org/TR/xml/#char32
InvalidChar(u8, u8, TextPos)
An invalid/unexpected character.
The first byte is an actual one, the second one is expected.
We are using a single value to reduce the struct size.
InvalidCharMultiple(u8, &'static [u8], TextPos)
An invalid/unexpected character.
Just like InvalidChar, but specifies multiple expected characters.
InvalidQuote(u8, TextPos)
An unexpected character instead of " or '.
InvalidSpace(u8, TextPos)
An unexpected character instead of an XML space.
Includes: ' ' \n \r \t   	 
 
.
InvalidString(&'static str, TextPos)
An unexpected string.
Contains what string was expected.
InvalidReference
An invalid reference.
InvalidExternalID
An invalid ExternalID in the DTD.
InvalidCommentData
Comment cannot contain --.
InvalidCommentEnd
Comment cannot end with -.
InvalidCharacterData
A Character Data node contains an invalid data.
Currently, only ]]> is not allowed.
Trait Implementations§
Source§impl Clone for StreamError
impl Clone for StreamError
Source§fn clone(&self) -> StreamError
fn clone(&self) -> StreamError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamError
impl Debug for StreamError
Source§impl Display for StreamError
impl Display for StreamError
Source§impl Error for StreamError
Available on crate feature std only.
impl Error for StreamError
std only.