Skip to main content

XmlTypeCode

Enum XmlTypeCode 

Source
#[repr(u8)]
pub enum XmlTypeCode {
Show 62 variants None = 0, Item = 1, Node = 2, Document = 3, Element = 4, Attribute = 5, Namespace = 6, ProcessingInstruction = 7, Comment = 8, Text = 9, AnyType = 10, AnySimpleType = 11, AnyAtomicType = 12, UntypedAtomic = 13, String = 14, NormalizedString = 15, Token = 16, Language = 17, NmToken = 18, Name = 19, NCName = 20, Id = 21, IdRef = 22, Entity = 23, Boolean = 24, Decimal = 25, Float = 26, Double = 27, Integer = 28, NonPositiveInteger = 29, NegativeInteger = 30, Long = 31, Int = 32, Short = 33, Byte = 34, NonNegativeInteger = 35, UnsignedLong = 36, UnsignedInt = 37, UnsignedShort = 38, UnsignedByte = 39, PositiveInteger = 40, Duration = 41, DateTime = 42, Time = 43, Date = 44, GYearMonth = 45, GYear = 46, GMonthDay = 47, GDay = 48, GMonth = 49, YearMonthDuration = 50, DayTimeDuration = 51, DateTimeStamp = 52, HexBinary = 53, Base64Binary = 54, AnyUri = 55, QName = 56, Notation = 57, NmTokens = 58, IdRefs = 59, Entities = 60, Error = 61,
}
Expand description

XSD type codes for type identification and dispatch.

Ordered to match .NET XmlTypeCode for interoperability. See XSD_TYPE_DESIGN.md §3.2 for full specification.

Variants§

§

None = 0

No type information

§

Item = 1

Any item (XPath2)

§

Node = 2

Any node

§

Document = 3

Document node

§

Element = 4

Element node

§

Attribute = 5

Attribute node

§

Namespace = 6

Namespace node

§

ProcessingInstruction = 7

Processing instruction node

§

Comment = 8

Comment node

§

Text = 9

Text node

§

AnyType = 10

xs:anyType - the ur-type

§

AnySimpleType = 11

xs:anySimpleType - base of all simple types

§

AnyAtomicType = 12

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

§

UntypedAtomic = 13

xs:untypedAtomic - untyped atomic value

§

String = 14

xs:string

§

NormalizedString = 15

xs:normalizedString

§

Token = 16

xs:token

§

Language = 17

xs:language

§

NmToken = 18

xs:NMTOKEN

§

Name = 19

xs:Name

§

NCName = 20

xs:NCName

§

Id = 21

xs:ID

§

IdRef = 22

xs:IDREF

§

Entity = 23

xs:ENTITY

§

Boolean = 24

xs:boolean

§

Decimal = 25

xs:decimal

§

Float = 26

xs:float

§

Double = 27

xs:double

§

Integer = 28

xs:integer

§

NonPositiveInteger = 29

xs:nonPositiveInteger

§

NegativeInteger = 30

xs:negativeInteger

§

Long = 31

xs:long

§

Int = 32

xs:int

§

Short = 33

xs:short

§

Byte = 34

xs:byte

§

NonNegativeInteger = 35

xs:nonNegativeInteger

§

UnsignedLong = 36

xs:unsignedLong

§

UnsignedInt = 37

xs:unsignedInt

§

UnsignedShort = 38

xs:unsignedShort

§

UnsignedByte = 39

xs:unsignedByte

§

PositiveInteger = 40

xs:positiveInteger

§

Duration = 41

xs:duration

§

DateTime = 42

xs:dateTime

§

Time = 43

xs:time

§

Date = 44

xs:date

§

GYearMonth = 45

xs:gYearMonth

§

GYear = 46

xs:gYear

§

GMonthDay = 47

xs:gMonthDay

§

GDay = 48

xs:gDay

§

GMonth = 49

xs:gMonth

§

YearMonthDuration = 50

xs:yearMonthDuration (XSD 1.1)

§

DayTimeDuration = 51

xs:dayTimeDuration (XSD 1.1)

§

DateTimeStamp = 52

xs:dateTimeStamp (XSD 1.1)

§

HexBinary = 53

xs:hexBinary

§

Base64Binary = 54

xs:base64Binary

§

AnyUri = 55

xs:anyURI

§

QName = 56

xs:QName

§

Notation = 57

xs:NOTATION

§

NmTokens = 58

xs:NMTOKENS (list of NMTOKEN)

§

IdRefs = 59

xs:IDREFS (list of IDREF)

§

Entities = 60

xs:ENTITIES (list of ENTITY)

§

Error = 61

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

Implementations§

Source§

impl XmlTypeCode

Source

pub fn is_node(&self) -> bool

Returns true if this is a node type code.

Source

pub fn is_atomic(&self) -> bool

Returns true if this is an atomic type (not node, not list, not ur-type).

Source

pub fn is_list(&self) -> bool

Returns true if this is a list type (NMTOKENS, IDREFS, ENTITIES).

Source

pub fn is_primitive_atomic(&self) -> bool

Returns true if this is one of the 19 XSD primitive atomic types that derive from xs:anyAtomicType in XSD 1.1 (§3.16.7.3).

Source

pub fn is_numeric(&self) -> bool

Returns true if this is a numeric type.

Source

pub fn is_date_time(&self) -> bool

Returns true if this is a date/time type.

Source

pub fn is_string_derived(&self) -> bool

Returns true if this is a string-derived type.

Source

pub fn is_xsd11(&self) -> bool

Returns true if this is an XSD 1.1 type.

Source

pub fn list_item_type(&self) -> Option<XmlTypeCode>

Returns the item type for list types, or None for non-list types.

Source

pub fn local_name(&self) -> Option<&'static str>

Get the local name of this type code (XSD type name).

Source

pub fn from_local_name(name: &str) -> Option<XmlTypeCode>

Parse type code from XSD local name.

Trait Implementations§

Source§

impl Clone for XmlTypeCode

Source§

fn clone(&self) -> XmlTypeCode

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 Copy for XmlTypeCode

Source§

impl Debug for XmlTypeCode

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for XmlTypeCode

Source§

fn default() -> XmlTypeCode

Returns the “default value” for a type. Read more
Source§

impl Eq for XmlTypeCode

Source§

impl From<BuiltInType> for XmlTypeCode

Source§

fn from(builtin: BuiltInType) -> Self

Converts to this type from the input type.
Source§

impl Hash for XmlTypeCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for XmlTypeCode

Source§

fn eq(&self, other: &XmlTypeCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for XmlTypeCode

Source§

impl TryFrom<XmlTypeCode> for BuiltInType

Source§

fn try_from(code: XmlTypeCode) -> Result<Self, Self::Error>

Convert from XmlTypeCode to BuiltInType.

Returns Err(()) for node types, AnyType, and other non-simple type codes.

Source§

type Error = ()

The type returned in the event of a conversion error.

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.