pub enum PrimitiveTypeCode {
Show 19 variants
String,
Boolean,
Decimal,
Float,
Double,
Duration,
DateTime,
Time,
Date,
GYearMonth,
GYear,
GMonthDay,
GDay,
GMonth,
HexBinary,
Base64Binary,
AnyUri,
QName,
Notation,
}Expand description
Primitive type codes identifying the fundamental XSD types.
Used for validator dispatch and value space identification. These are the 19 primitive types from which all other simple types derive. See XSD_TYPE_DESIGN.md §3.3 for specification.
Variants§
String
xs:string - character sequences
Boolean
xs:boolean - true/false values
Decimal
xs:decimal - arbitrary precision decimal numbers
Float
xs:float - IEEE 754 single-precision float
Double
xs:double - IEEE 754 double-precision float
Duration
xs:duration - time duration (PnYnMnDTnHnMnS)
DateTime
xs:dateTime - date and time
Time
xs:time - time of day
Date
xs:date - calendar date
GYearMonth
xs:gYearMonth - Gregorian year and month
GYear
xs:gYear - Gregorian year
GMonthDay
xs:gMonthDay - Gregorian month and day
GDay
xs:gDay - Gregorian day
GMonth
xs:gMonth - Gregorian month
HexBinary
xs:hexBinary - hex-encoded binary data
Base64Binary
xs:base64Binary - base64-encoded binary data
AnyUri
xs:anyURI - URI reference
QName
xs:QName - qualified name (namespace + local name)
Notation
xs:NOTATION - notation reference
Implementations§
Source§impl PrimitiveTypeCode
impl PrimitiveTypeCode
Sourcepub fn from_type_code(code: XmlTypeCode) -> Option<Self>
pub fn from_type_code(code: XmlTypeCode) -> Option<Self>
Get the primitive type code for any XmlTypeCode.
Returns the primitive type from which the given type derives,
or None for non-atomic types (nodes, lists, ur-types).
Sourcepub fn to_type_code(&self) -> XmlTypeCode
pub fn to_type_code(&self) -> XmlTypeCode
Get the XmlTypeCode for this primitive type.
Sourcepub fn local_name(&self) -> &'static str
pub fn local_name(&self) -> &'static str
Get the local name of this primitive type.
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Returns true if this is a numeric primitive type.
Sourcepub fn all() -> impl Iterator<Item = PrimitiveTypeCode>
pub fn all() -> impl Iterator<Item = PrimitiveTypeCode>
Returns an iterator over all primitive type codes.
Trait Implementations§
Source§impl Clone for PrimitiveTypeCode
impl Clone for PrimitiveTypeCode
Source§fn clone(&self) -> PrimitiveTypeCode
fn clone(&self) -> PrimitiveTypeCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PrimitiveTypeCode
Source§impl Debug for PrimitiveTypeCode
impl Debug for PrimitiveTypeCode
impl Eq for PrimitiveTypeCode
Source§impl Hash for PrimitiveTypeCode
impl Hash for PrimitiveTypeCode
Source§impl PartialEq for PrimitiveTypeCode
impl PartialEq for PrimitiveTypeCode
Source§fn eq(&self, other: &PrimitiveTypeCode) -> bool
fn eq(&self, other: &PrimitiveTypeCode) -> bool
self and other values to be equal, and is used by ==.