Expand description
This crate aims at providing safe representations of XSD built-in data types.
§Usage
For each XSD datatype, this library provides two families of types:
one representing the lexical space of the datatype (see the lexical
module), and one representing the value space of the datatype (see the
value module).
For instance, assume we wish to store the lexical representation of an
XSD decimal datatype value. We can use the
lexical::Decimal type (or its owned variant, lexical::DecimalBuf)
let string = "3.141592653589793";
// Parse the lexical representation (lexical domain).
let lexical_repr = xsd_types::lexical::Decimal::new(string).unwrap();
// Interprets the lexical representation (value domain).
use xsd_types::lexical::LexicalFormOf;
let value_repr: xsd_types::Decimal = lexical_repr.try_as_value().unwrap();Of course it is possible to parse the value directly into the value domain
using FromStr:
let value_repr: xsd_types::Decimal = "3.141592653589793".parse().unwrap();§Any value
The Value type provides a simple way to represent any XSD value.
use xsd_types::{XSD_DATE, Datatype, Value};
let dt = Datatype::from_iri(XSD_DATE).unwrap();
let value: Value = dt.parse("1758-12-25").unwrap(); // Halley is back!Re-exports§
pub use value::*;
Modules§
- Lexical domain types.
- Value domain types.
Structs§
- XSD value parse error.
Enums§
- XSD datatype (primitive or not).
DateTimedatatype variants.- Any specialized
DateTimevalue. Decimaldatatype variants.- Any specialized
Decimalvalue. - Any specialized
Decimalvalue reference. Durationdatatype variants.- Any specialized
Durationvalue. Intdatatype variants.- Any specialized
Intvalue. Integerdatatype variants.- Any specialized
Integervalue. - Any specialized
Integervalue reference. Longdatatype variants.- Any specialized
Longvalue. NCNamedatatype variants.- Any specialized
NCNamevalue. - Any specialized
NCNamevalue reference. Namedatatype variants.- Any specialized
Namevalue. - Any specialized
Namevalue reference. NonNegativeIntegerdatatype variants.- Any specialized
NonNegativeIntegervalue. - Any specialized
NonNegativeIntegervalue reference. NonPositiveIntegerdatatype variants.- Any specialized
NonPositiveIntegervalue. - Any specialized
NonPositiveIntegervalue reference. NormalizedStrdatatype variants.- Any specialized
NormalizedStrvalue. - Any specialized
NormalizedStrvalue reference. - XSD lexical parse error.
- XSD primitive datatype.
Shortdatatype variants.- Any specialized
Shortvalue. strdatatype variants.- Any specialized
strvalue. - Any specialized
strvalue reference. Tokendatatype variants.- Any specialized
Tokenvalue. - Any specialized
Tokenvalue reference. UnsignedIntdatatype variants.- Any specialized
UnsignedIntvalue. UnsignedLongdatatype variants.- Any specialized
UnsignedLongvalue. UnsignedShortdatatype variants.- Any specialized
UnsignedShortvalue. - Any XSD value.
- Any XSD value reference.
Constants§
- http://www.w3.org/2001/XMLSchema#anyURI datatype IRI.
- http://www.w3.org/2001/XMLSchema#base64Binary datatype IRI.
- http://www.w3.org/2001/XMLSchema#boolean datatype IRI.
- http://www.w3.org/2001/XMLSchema#byte datatype IRI.
- http://www.w3.org/2001/XMLSchema#date datatype IRI.
- http://www.w3.org/2001/XMLSchema#dateTime datatype IRI.
- http://www.w3.org/2001/XMLSchema#dateTimeStamp datatype IRI.
- http://www.w3.org/2001/XMLSchema#dayTimeDuration datatype IRI.
- http://www.w3.org/2001/XMLSchema#decimal datatype IRI.
- http://www.w3.org/2001/XMLSchema#double datatype IRI.
- http://www.w3.org/2001/XMLSchema#duration datatype IRI.
- http://www.w3.org/2001/XMLSchema#ENTITIES datatype IRI.
- http://www.w3.org/2001/XMLSchema#ENTITY datatype IRI.
- http://www.w3.org/2001/XMLSchema#float datatype IRI.
- http://www.w3.org/2001/XMLSchema#gDay datatype IRI.
- http://www.w3.org/2001/XMLSchema#gMonth datatype IRI.
- http://www.w3.org/2001/XMLSchema#gMonthDay datatype IRI.
- http://www.w3.org/2001/XMLSchema#gYear datatype IRI.
- http://www.w3.org/2001/XMLSchema#gYearMonth datatype IRI.
- http://www.w3.org/2001/XMLSchema#hexBinary datatype IRI.
- http://www.w3.org/2001/XMLSchema#ID datatype IRI.
- http://www.w3.org/2001/XMLSchema#IDREF datatype IRI.
- http://www.w3.org/2001/XMLSchema#IDREFS datatype IRI.
- http://www.w3.org/2001/XMLSchema#int datatype IRI.
- http://www.w3.org/2001/XMLSchema#integer datatype IRI.
- http://www.w3.org/2001/XMLSchema#language datatype IRI.
- http://www.w3.org/2001/XMLSchema#long datatype IRI.
- http://www.w3.org/2001/XMLSchema#Name datatype IRI.
- http://www.w3.org/2001/XMLSchema#NCName datatype IRI.
- http://www.w3.org/2001/XMLSchema#negativeInteger datatype IRI.
- http://www.w3.org/2001/XMLSchema#NMTOKEN datatype IRI.
- http://www.w3.org/2001/XMLSchema#NMTOKENS datatype IRI.
- http://www.w3.org/2001/XMLSchema#nonNegativeInteger datatype IRI.
- http://www.w3.org/2001/XMLSchema#nonPositiveInteger datatype IRI.
- http://www.w3.org/2001/XMLSchema#normalizedString datatype IRI.
- http://www.w3.org/2001/XMLSchema#NOTATION datatype IRI.
- http://www.w3.org/2001/XMLSchema#positiveInteger datatype IRI.
- http://www.w3.org/2001/XMLSchema#QName datatype IRI.
- http://www.w3.org/2001/XMLSchema#short datatype IRI.
- http://www.w3.org/2001/XMLSchema#string datatype IRI.
- http://www.w3.org/2001/XMLSchema#time datatype IRI.
- http://www.w3.org/2001/XMLSchema#token datatype IRI.
- http://www.w3.org/2001/XMLSchema#unsignedByte datatype IRI.
- http://www.w3.org/2001/XMLSchema#unsignedInt datatype IRI.
- http://www.w3.org/2001/XMLSchema#unsignedLong datatype IRI.
- http://www.w3.org/2001/XMLSchema#unsignedShort datatype IRI.
- http://www.w3.org/2001/XMLSchema#yearMonthDuration datatype IRI.
Traits§
- Parse a value directly from its XSD lexical form.
Type Aliases§
- XSD lexical parse result.