pub enum XPathError {
Show 42 variants
XPST0003 {
message: String,
},
XPST0008 {
qname: String,
},
XPST0051 {
type_name: String,
},
XPST0017 {
name: String,
arity: usize,
namespace: String,
},
XPST0081 {
prefix: String,
},
XPDY0002 {
message: String,
},
XPDY0050,
XPTY0004 {
expected: String,
found: String,
},
XPTY0004Cast {
target_type: String,
},
XPTY0018,
XPTY0019,
XPTY0020,
XQTY0030,
XQST0076 {
collation: String,
},
FORG0001 {
value: String,
target_type: String,
},
FORG0003,
FORG0004,
FORG0005,
FORG0006Named {
function: String,
arg_type: String,
},
FORG0006 {
message: String,
},
FORG0008,
FOCH0001 {
codepoint: String,
},
FOCH0002 {
collation: String,
},
FOCH0003 {
normalization_form: String,
},
FOAR0001,
FOAR0002,
FOCA0002 {
qname: String,
},
FOCA0003 {
message: String,
},
FOCA0005,
FODT0001,
FODT0002,
FODT0003 {
value: String,
},
FOTY0012,
FONS0005,
FORG0009 {
uri: String,
},
FORX0001 {
flags: String,
},
FORX0002 {
pattern: String,
},
FORX0003 {
pattern: String,
},
FORX0004 {
replacement: String,
},
BinaryOperatorNotDefined {
operator: String,
left_type: String,
right_type: String,
},
UnaryOperatorNotDefined {
operator: String,
arg_type: String,
},
Internal(String),
}Expand description
XPath-specific error type with W3C specification error codes.
Variants§
XPST0003
XPST0003: Syntax error in expression.
XPST0008
XPST0008: QName is not defined (undefined variable or type).
XPST0051
XPST0051: Unknown atomic type in sequence type.
XPST0017
XPST0017: Function not found.
XPST0081
XPST0081: Prefix cannot be expanded to namespace URI.
XPDY0002
XPDY0002: Context item is undefined (with message).
XPDY0050
XPDY0050: More than one item where singleton expected.
XPTY0004
XPTY0004: Type mismatch.
XPTY0004Cast
XPTY0004 variant: Only string literals can be cast to certain types.
XPTY0018
XPTY0018: Path expression result contains both nodes and atomic values.
XPTY0019
XPTY0019: Step result must not be atomic value in path expression.
XPTY0020
XPTY0020: Context item in axis step is not a node.
XQTY0030
XQTY0030: Validate expression argument must be single document or element.
XQST0076
XQST0076: Invalid collation URI.
FORG0001
FORG0001: Invalid value for cast/constructor.
FORG0003
FORG0003: fn:zero-or-one called with sequence > 1 item.
FORG0004
FORG0004: fn:one-or-more called with empty sequence.
FORG0005
FORG0005: fn:exactly-one called with wrong cardinality.
FORG0006Named
FORG0006: Invalid argument type for function.
FORG0006
FORG0006: General effective boolean value error.
FORG0008
FORG0008: Both arguments to fn:dateTime have a timezone
FOCH0001
FOCH0001: Invalid codepoint.
FOCH0002
FOCH0002: Unsupported collation.
FOCH0003
FOCH0003: Unsupported normalization form.
FOAR0001
FOAR0001: Division by zero.
FOAR0002
FOAR0002: Numeric overflow or underflow.
FOCA0002
FOCA0002: QName has null namespace but non-empty prefix.
FOCA0003
FOCA0003: Input value too large for integer.
FOCA0005
FOCA0005: NaN supplied as float/double value.
FODT0001
FODT0001: Overflow/underflow in date/time operation.
FODT0002
FODT0002: Overflow/underflow in duration operation.
FODT0003
FODT0003: Invalid timezone value.
FOTY0012
FOTY0012: Argument node does not have a typed value.
FONS0005
FONS0005: Base-uri not defined in static context.
FORG0009
FORG0009: Error in resolving a relative URI.
FORX0001
FORX0001: Invalid regular expression flags.
FORX0002
FORX0002: Invalid regular expression.
FORX0003
FORX0003: Regular expression matches zero-length string.
FORX0004
FORX0004: Invalid replacement string.
BinaryOperatorNotDefined
Binary operator not defined for argument types.
UnaryOperatorNotDefined
Unary operator not defined for argument type.
Internal(String)
Internal error for unexpected failures.
Implementations§
Source§impl XPathError
impl XPathError
Sourcepub fn syntax_error(message: impl Into<String>) -> Self
pub fn syntax_error(message: impl Into<String>) -> Self
Create XPST0003 syntax error.
Sourcepub fn undefined_qname(qname: impl Into<String>) -> Self
pub fn undefined_qname(qname: impl Into<String>) -> Self
Create XPST0008 undefined QName error.
Sourcepub fn unknown_type(type_name: impl Into<String>) -> Self
pub fn unknown_type(type_name: impl Into<String>) -> Self
Create XPST0051 unknown type error.
Sourcepub fn function_not_found(
name: impl Into<String>,
arity: usize,
namespace: impl Into<String>,
) -> Self
pub fn function_not_found( name: impl Into<String>, arity: usize, namespace: impl Into<String>, ) -> Self
Create XPST0017 function not found error.
Sourcepub fn undefined_prefix(prefix: impl Into<String>) -> Self
pub fn undefined_prefix(prefix: impl Into<String>) -> Self
Create XPST0081 undefined prefix error.
Sourcepub fn context_undefined() -> Self
pub fn context_undefined() -> Self
Create XPDY0002 context undefined error.
Sourcepub fn more_than_one_item() -> Self
pub fn more_than_one_item() -> Self
Create XPDY0050 more than one item error.
Sourcepub fn type_mismatch(
expected: impl Into<String>,
found: impl Into<String>,
) -> Self
pub fn type_mismatch( expected: impl Into<String>, found: impl Into<String>, ) -> Self
Create XPTY0004 type mismatch error.
Sourcepub fn cast_requires_string_literal(target_type: impl Into<String>) -> Self
pub fn cast_requires_string_literal(target_type: impl Into<String>) -> Self
Create XPTY0004 cast-only-from-string error.
Sourcepub fn context_not_a_node() -> Self
pub fn context_not_a_node() -> Self
Create XPTY0020 context item not a node error.
Sourcepub fn invalid_cast_value(
value: impl Into<String>,
target_type: impl Into<String>,
) -> Self
pub fn invalid_cast_value( value: impl Into<String>, target_type: impl Into<String>, ) -> Self
Create FORG0001 invalid cast value error.
Sourcepub fn invalid_argument_type(
function: impl Into<String>,
arg_type: impl Into<String>,
) -> Self
pub fn invalid_argument_type( function: impl Into<String>, arg_type: impl Into<String>, ) -> Self
Create FORG0006 invalid argument type error.
Sourcepub fn not_implemented(message: impl Into<String>) -> Self
pub fn not_implemented(message: impl Into<String>) -> Self
Create a not implemented error.
Sourcepub fn wrong_number_of_arguments(
function: &str,
expected: usize,
actual: usize,
) -> Self
pub fn wrong_number_of_arguments( function: &str, expected: usize, actual: usize, ) -> Self
Create XPST0017 wrong number of arguments error.
Sourcepub fn binary_operator_not_defined(
operator: impl Into<String>,
left_type: impl Into<String>,
right_type: impl Into<String>,
) -> Self
pub fn binary_operator_not_defined( operator: impl Into<String>, left_type: impl Into<String>, right_type: impl Into<String>, ) -> Self
Create binary operator not defined error.
Sourcepub fn unary_operator_not_defined(
operator: impl Into<String>,
arg_type: impl Into<String>,
) -> Self
pub fn unary_operator_not_defined( operator: impl Into<String>, arg_type: impl Into<String>, ) -> Self
Create unary operator not defined error.
Sourcepub fn no_typed_value() -> Self
pub fn no_typed_value() -> Self
Create FOTY0012 no typed value error.
Sourcepub fn base_uri_not_defined() -> Self
pub fn base_uri_not_defined() -> Self
Create FONS0005 base-uri not defined error.
Sourcepub fn uri_resolution_error(uri: impl Into<String>) -> Self
pub fn uri_resolution_error(uri: impl Into<String>) -> Self
Create FORG0009 URI resolution error.
Sourcepub fn invalid_regex_flags(flags: impl Into<String>) -> Self
pub fn invalid_regex_flags(flags: impl Into<String>) -> Self
Create FORX0001 invalid regex flags error.
Sourcepub fn invalid_regex_pattern(pattern: impl Into<String>) -> Self
pub fn invalid_regex_pattern(pattern: impl Into<String>) -> Self
Create FORX0002 invalid regex pattern error.
Sourcepub fn regex_matches_zero_length(pattern: impl Into<String>) -> Self
pub fn regex_matches_zero_length(pattern: impl Into<String>) -> Self
Create FORX0003 regex matches zero-length string error.
Sourcepub fn invalid_replacement_string(replacement: impl Into<String>) -> Self
pub fn invalid_replacement_string(replacement: impl Into<String>) -> Self
Create FORX0004 invalid replacement string error.
Sourcepub fn unsupported_collation(collation: impl Into<String>) -> Self
pub fn unsupported_collation(collation: impl Into<String>) -> Self
Create XQST0076 unsupported collation error.
Sourcepub fn unknown_collation(collation: impl Into<String>) -> Self
pub fn unknown_collation(collation: impl Into<String>) -> Self
Create FOCH0002 unsupported collation error.
Sourcepub fn error_code(&self) -> Option<&'static str>
pub fn error_code(&self) -> Option<&'static str>
Get the error code (e.g., “XPTY0004”) if this is a spec-defined error.
Trait Implementations§
Source§impl Clone for XPathError
impl Clone for XPathError
Source§fn clone(&self) -> XPathError
fn clone(&self) -> XPathError
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 XPathError
impl Debug for XPathError
Source§impl Display for XPathError
impl Display for XPathError
Source§impl Error for XPathError
impl Error for XPathError
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()