pub enum NamespaceError {
UnknownPrefix(String),
InvalidXmlPrefixBind(String),
InvalidXmlnsPrefixBind(String),
InvalidPrefixForXml(String),
InvalidPrefixForXmlns(String),
TooManyBindings(usize),
TooDeeplyNested(usize),
}Expand description
Some namespace was invalid
Variants§
UnknownPrefix(String)
Specified namespace prefix is unknown, cannot resolve namespace for it
InvalidXmlPrefixBind(String)
Attempts to bind the xml prefix to something other than http://www.w3.org/XML/1998/namespace.
xml prefix can be bound only to http://www.w3.org/XML/1998/namespace.
Contains the namespace to which xml tried to be bound.
InvalidXmlnsPrefixBind(String)
Attempts to bind the xmlns prefix.
xmlns prefix is always bound to http://www.w3.org/2000/xmlns/ and cannot be bound
to any other namespace or even to http://www.w3.org/2000/xmlns/.
Contains the namespace to which xmlns tried to be bound.
InvalidPrefixForXml(String)
Attempts to bind some prefix (except xml) to http://www.w3.org/XML/1998/namespace.
Only xml prefix can be bound to http://www.w3.org/XML/1998/namespace.
Contains the prefix that is tried to be bound.
InvalidPrefixForXmlns(String)
Attempts to bind some prefix to http://www.w3.org/2000/xmlns/.
http://www.w3.org/2000/xmlns/ cannot be bound to any prefix, even to xmlns.
Contains the prefix that is tried to be bound.
TooManyBindings(usize)
The total number of xmlns / xmlns:* namespace bindings in scope exceeded
the configured NamespaceResolver::max_namespace_bindings limit. Contains
the configured limit.
This bounds the work done by NamespaceResolver (and hence by NsReader)
on untrusted input by capping both the heap allocated and the cost of prefix
resolution (which scans the binding stack).
TooDeeplyNested(usize)
The document nested elements more deeply than the namespace resolver’s
depth counter (a u16) can track. This bounds stack / scope-bookkeeping
work on untrusted input. Contains the depth limit that was exceeded.
Trait Implementations§
Source§impl Clone for NamespaceError
impl Clone for NamespaceError
Source§fn clone(&self) -> NamespaceError
fn clone(&self) -> NamespaceError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NamespaceError
impl Debug for NamespaceError
Source§impl Display for NamespaceError
impl Display for NamespaceError
impl Eq for NamespaceError
Source§impl Error for NamespaceError
impl Error for NamespaceError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<NamespaceError> for Error
impl From<NamespaceError> for Error
Source§fn from(error: NamespaceError) -> Self
fn from(error: NamespaceError) -> Self
Source§impl From<NamespaceError> for DeError
Available on crate feature serialize only.
impl From<NamespaceError> for DeError
serialize only.