Enum xmlparser::StreamError
source · 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
impl Error for StreamError
source§fn description(&self) -> &str
fn description(&self) -> &str
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
source§impl Hash for StreamError
impl Hash for StreamError
source§impl PartialEq for StreamError
impl PartialEq for StreamError
impl Copy for StreamError
impl Eq for StreamError
impl StructuralPartialEq for StreamError
Auto Trait Implementations§
impl Freeze for StreamError
impl RefUnwindSafe for StreamError
impl Send for StreamError
impl Sync for StreamError
impl Unpin for StreamError
impl UnwindSafe for StreamError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)