Skip to main content

BuiltinTypes

Struct BuiltinTypes 

Source
pub struct BuiltinTypes {
Show 57 fields pub any_type: ComplexTypeKey, pub any_simple_type: SimpleTypeKey, pub any_atomic_type: Option<SimpleTypeKey>, pub string: SimpleTypeKey, pub normalized_string: SimpleTypeKey, pub token: SimpleTypeKey, pub language: SimpleTypeKey, pub nmtoken: SimpleTypeKey, pub name: SimpleTypeKey, pub ncname: SimpleTypeKey, pub id: SimpleTypeKey, pub idref: SimpleTypeKey, pub entity: SimpleTypeKey, pub boolean: SimpleTypeKey, pub decimal: SimpleTypeKey, pub float: SimpleTypeKey, pub double: SimpleTypeKey, pub integer: SimpleTypeKey, pub non_positive_integer: SimpleTypeKey, pub negative_integer: SimpleTypeKey, pub long: SimpleTypeKey, pub int: SimpleTypeKey, pub short: SimpleTypeKey, pub byte: SimpleTypeKey, pub non_negative_integer: SimpleTypeKey, pub unsigned_long: SimpleTypeKey, pub unsigned_int: SimpleTypeKey, pub unsigned_short: SimpleTypeKey, pub unsigned_byte: SimpleTypeKey, pub positive_integer: SimpleTypeKey, pub duration: SimpleTypeKey, pub datetime: SimpleTypeKey, pub time: SimpleTypeKey, pub date: SimpleTypeKey, pub g_year_month: SimpleTypeKey, pub g_year: SimpleTypeKey, pub g_month_day: SimpleTypeKey, pub g_day: SimpleTypeKey, pub g_month: SimpleTypeKey, pub year_month_duration: Option<SimpleTypeKey>, pub day_time_duration: Option<SimpleTypeKey>, pub datetime_stamp: Option<SimpleTypeKey>, pub untyped_atomic: Option<SimpleTypeKey>, pub error: Option<SimpleTypeKey>, pub hex_binary: SimpleTypeKey, pub base64_binary: SimpleTypeKey, pub any_uri: SimpleTypeKey, pub xsi_schema_location_type: SimpleTypeKey, pub qname: SimpleTypeKey, pub notation: SimpleTypeKey, pub nmtokens: SimpleTypeKey, pub idrefs: SimpleTypeKey, pub entities: SimpleTypeKey, pub xsi_type_attr: AttributeKey, pub xsi_nil_attr: AttributeKey, pub xsi_schema_location_attr: AttributeKey, pub xsi_no_namespace_schema_location_attr: AttributeKey, /* private fields */
}
Expand description

Well-known built-in type IDs for fast access.

This struct contains SimpleTypeKey references for all 50 built-in XSD simple types. It is initialized when a SchemaSet is created.

Types are organized by category:

  • Abstract types (anySimpleType, anyAtomicType)
  • String types (string, normalizedString, token, etc.)
  • Numeric types (boolean, decimal, float, double, integer hierarchy)
  • Date/time types (duration, dateTime, date, time, gregorian types)
  • Binary types (hexBinary, base64Binary)
  • Other types (anyURI, QName, NOTATION)
  • List types (NMTOKENS, IDREFS, ENTITIES)

Fields§

§any_type: ComplexTypeKey

xs:anyType - the ur-type

§any_simple_type: SimpleTypeKey

xs:anySimpleType - base of all simple types

§any_atomic_type: Option<SimpleTypeKey>

xs:anyAtomicType - base of all atomic types (XSD 1.1)

§string: SimpleTypeKey

xs:string

§normalized_string: SimpleTypeKey

xs:normalizedString

§token: SimpleTypeKey

xs:token

§language: SimpleTypeKey

xs:language

§nmtoken: SimpleTypeKey

xs:NMTOKEN

§name: SimpleTypeKey

xs:Name

§ncname: SimpleTypeKey

xs:NCName

§id: SimpleTypeKey

xs:ID

§idref: SimpleTypeKey

xs:IDREF

§entity: SimpleTypeKey

xs:ENTITY

§boolean: SimpleTypeKey

xs:boolean

§decimal: SimpleTypeKey

xs:decimal

§float: SimpleTypeKey

xs:float

§double: SimpleTypeKey

xs:double

§integer: SimpleTypeKey

xs:integer

§non_positive_integer: SimpleTypeKey

xs:nonPositiveInteger

§negative_integer: SimpleTypeKey

xs:negativeInteger

§long: SimpleTypeKey

xs:long

§int: SimpleTypeKey

xs:int

§short: SimpleTypeKey

xs:short

§byte: SimpleTypeKey

xs:byte

§non_negative_integer: SimpleTypeKey

xs:nonNegativeInteger

§unsigned_long: SimpleTypeKey

xs:unsignedLong

§unsigned_int: SimpleTypeKey

xs:unsignedInt

§unsigned_short: SimpleTypeKey

xs:unsignedShort

§unsigned_byte: SimpleTypeKey

xs:unsignedByte

§positive_integer: SimpleTypeKey

xs:positiveInteger

§duration: SimpleTypeKey

xs:duration

§datetime: SimpleTypeKey

xs:dateTime

§time: SimpleTypeKey

xs:time

§date: SimpleTypeKey

xs:date

§g_year_month: SimpleTypeKey

xs:gYearMonth

§g_year: SimpleTypeKey

xs:gYear

§g_month_day: SimpleTypeKey

xs:gMonthDay

§g_day: SimpleTypeKey

xs:gDay

§g_month: SimpleTypeKey

xs:gMonth

§year_month_duration: Option<SimpleTypeKey>

xs:yearMonthDuration (XSD 1.1)

§day_time_duration: Option<SimpleTypeKey>

xs:dayTimeDuration (XSD 1.1)

§datetime_stamp: Option<SimpleTypeKey>

xs:dateTimeStamp (XSD 1.1)

§untyped_atomic: Option<SimpleTypeKey>

xs:untypedAtomic (XSD 1.1)

§error: Option<SimpleTypeKey>

xs:error - the bottom type (union of no members); has no valid values (XSD 1.1)

§hex_binary: SimpleTypeKey

xs:hexBinary

§base64_binary: SimpleTypeKey

xs:base64Binary

§any_uri: SimpleTypeKey

xs:anyURI

§xsi_schema_location_type: SimpleTypeKey

Anonymous list(xs:anyURI) — type of xsi:schemaLocation built-in attribute

§qname: SimpleTypeKey

xs:QName

§notation: SimpleTypeKey

xs:NOTATION

§nmtokens: SimpleTypeKey

xs:NMTOKENS

§idrefs: SimpleTypeKey

xs:IDREFS

§entities: SimpleTypeKey

xs:ENTITIES

§xsi_type_attr: AttributeKey

xsi:type built-in attribute declaration

§xsi_nil_attr: AttributeKey

xsi:nil built-in attribute declaration

§xsi_schema_location_attr: AttributeKey

xsi:schemaLocation built-in attribute declaration

§xsi_no_namespace_schema_location_attr: AttributeKey

xsi:noNamespaceSchemaLocation built-in attribute declaration

Implementations§

Source§

impl BuiltinTypes

Source

pub fn new(schema_set: &mut SchemaSet) -> Self

Initialize all built-in types and register them in the schema set.

This creates SimpleTypeDefData entries in the arenas for all 47 XSD 1.0 built-in types (plus 3 additional XSD 1.1 types if the version is XSD 1.1).

Source

pub fn get_by_type_code(&self, code: XmlTypeCode) -> Option<SimpleTypeKey>

Get a built-in type by its XmlTypeCode.

Returns None for node types, AnyType, and other non-simple type codes.

Source

pub fn get_by_local_name(&self, name: NameId) -> Option<SimpleTypeKey>

Get a built-in type by its local name (within the XS namespace).

The local name must be interned in the NameTable (passed as NameId).

Source

pub fn get_type_code(&self, key: SimpleTypeKey) -> Option<XmlTypeCode>

Get the XmlTypeCode for a built-in type key.

Returns None if the key is not a built-in type.

Source

pub fn is_builtin(&self, key: SimpleTypeKey) -> bool

Check if a type key is a built-in type.

Source

pub fn is_any_atomic_type(&self, key: SimpleTypeKey) -> bool

True when key is the xs:anyAtomicType built-in (XSD 1.1 only).

Source

pub fn get_base_type(&self, key: SimpleTypeKey) -> Option<SimpleTypeKey>

Get the base type for a built-in type (for derivation hierarchy).

Returns the immediate base type in the XSD type hierarchy. Returns None for anySimpleType (the root of simple types).

In XSD 1.1 mode, primitive atomic types derive from xs:anyAtomicType per §3.16.7.3; in XSD 1.0 they derive from xs:anySimpleType.

Source

pub fn derives_from(&self, derived: SimpleTypeKey, base: SimpleTypeKey) -> bool

Check if derived derives from base (transitively).

Returns true if:

  • derived == base, or
  • derived has base somewhere in its derivation chain
Source

pub fn count(&self) -> usize

Returns the number of registered built-in types.

This is 47 for XSD 1.0, or 50+ for XSD 1.1.

Trait Implementations§

Source§

impl Clone for BuiltinTypes

Source§

fn clone(&self) -> BuiltinTypes

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BuiltinTypes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.