pub enum SchemaError {
XmlError {
message: String,
location: Option<SourceLocation>,
},
StructuralError {
constraint: &'static str,
message: String,
location: Option<SourceLocation>,
},
NamespaceError {
message: String,
location: Option<SourceLocation>,
},
FeatureError {
message: String,
location: Option<SourceLocation>,
},
ResolutionError {
message: String,
},
IoError(Error),
Internal(String),
}Expand description
XSD schema error with source location
Variants§
XmlError
XML parsing error from quick-xml
StructuralError
Structural error (invalid child element, wrong attributes, etc.)
NamespaceError
Namespace error (undefined prefix, invalid QName, etc.)
FeatureError
Feature gate error (XSD 1.1 feature used in 1.0 mode)
ResolutionError
Schema resolution error (include/import failed)
IoError(Error)
I/O error (file not found, permission denied, etc.)
Internal(String)
Internal error (should not happen, indicates a bug)
Implementations§
Source§impl SchemaError
impl SchemaError
Sourcepub fn structural(
constraint: &'static str,
message: impl Into<String>,
location: Option<SourceLocation>,
) -> Self
pub fn structural( constraint: &'static str, message: impl Into<String>, location: Option<SourceLocation>, ) -> Self
Create a structural error with constraint ID
Sourcepub fn namespace(
message: impl Into<String>,
location: Option<SourceLocation>,
) -> Self
pub fn namespace( message: impl Into<String>, location: Option<SourceLocation>, ) -> Self
Create a namespace error
Sourcepub fn feature(
message: impl Into<String>,
location: Option<SourceLocation>,
) -> Self
pub fn feature( message: impl Into<String>, location: Option<SourceLocation>, ) -> Self
Create a feature gate error
Sourcepub fn resolution(message: impl Into<String>) -> Self
pub fn resolution(message: impl Into<String>) -> Self
Create a resolution error
Sourcepub fn xml(message: impl Into<String>, location: Option<SourceLocation>) -> Self
pub fn xml(message: impl Into<String>, location: Option<SourceLocation>) -> Self
Create an XML parse error
Sourcepub fn with_location(self, location: SourceLocation) -> Self
pub fn with_location(self, location: SourceLocation) -> Self
Add source location to error if it doesn’t already have one
Sourcepub fn is_schema_content_error(&self) -> bool
pub fn is_schema_content_error(&self) -> bool
Returns true for errors that indicate the schema content is invalid
(structural, namespace, XML parse, feature-gate errors).
Returns false for resolution/IO errors, which mean the schema could
not be located — these are non-fatal during import processing because
xs:import schema locations are hints, not requirements.
Trait Implementations§
Source§impl Debug for SchemaError
impl Debug for SchemaError
Source§impl Display for SchemaError
impl Display for SchemaError
Source§impl Error for SchemaError
impl Error for SchemaError
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()