Skip to main content

BuiltInType

Enum BuiltInType 

Source
pub enum BuiltInType {
Show 51 variants AnySimpleType, AnyAtomicType, UntypedAtomic, String, Boolean, Decimal, Float, Double, Duration, DateTime, Time, Date, GYearMonth, GYear, GMonthDay, GDay, GMonth, HexBinary, Base64Binary, AnyURI, QName, NOTATION, NormalizedString, Token, Language, NMTOKEN, NMTOKENS, Name, NCName, ID, IDREF, IDREFS, ENTITY, ENTITIES, Integer, NonPositiveInteger, NegativeInteger, Long, Int, Short, Byte, NonNegativeInteger, UnsignedLong, UnsignedInt, UnsignedShort, UnsignedByte, PositiveInteger, YearMonthDuration, DayTimeDuration, DateTimeStamp, XsError,
}
Expand description

Built-in XSD simple types

This enum represents all built-in simple types in XSD 1.0 and 1.1. Use XmlTypeCode for a more comprehensive type code enumeration that includes node types and complex types.

Variants§

§

AnySimpleType

xs:anySimpleType - base of all simple types

§

AnyAtomicType

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

§

UntypedAtomic

xs:untypedAtomic - untyped atomic value (XSD 1.1)

§

String

xs:string

§

Boolean

xs:boolean

§

Decimal

xs:decimal

§

Float

xs:float

§

Double

xs:double

§

Duration

xs:duration

§

DateTime

xs:dateTime

§

Time

xs:time

§

Date

xs:date

§

GYearMonth

xs:gYearMonth

§

GYear

xs:gYear

§

GMonthDay

xs:gMonthDay

§

GDay

xs:gDay

§

GMonth

xs:gMonth

§

HexBinary

xs:hexBinary

§

Base64Binary

xs:base64Binary

§

AnyURI

xs:anyURI

§

QName

xs:QName

§

NOTATION

xs:NOTATION

§

NormalizedString

xs:normalizedString

§

Token

xs:token

§

Language

xs:language

§

NMTOKEN

xs:NMTOKEN

§

NMTOKENS

xs:NMTOKENS (list type)

§

Name

xs:Name

§

NCName

xs:NCName

§

ID

xs:ID

§

IDREF

xs:IDREF

§

IDREFS

xs:IDREFS (list type)

§

ENTITY

xs:ENTITY

§

ENTITIES

xs:ENTITIES (list type)

§

Integer

xs:integer

§

NonPositiveInteger

xs:nonPositiveInteger

§

NegativeInteger

xs:negativeInteger

§

Long

xs:long

§

Int

xs:int

§

Short

xs:short

§

Byte

xs:byte

§

NonNegativeInteger

xs:nonNegativeInteger

§

UnsignedLong

xs:unsignedLong

§

UnsignedInt

xs:unsignedInt

§

UnsignedShort

xs:unsignedShort

§

UnsignedByte

xs:unsignedByte

§

PositiveInteger

xs:positiveInteger

§

YearMonthDuration

xs:yearMonthDuration (XSD 1.1)

§

DayTimeDuration

xs:dayTimeDuration (XSD 1.1)

§

DateTimeStamp

xs:dateTimeStamp (XSD 1.1)

§

XsError

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

Implementations§

Source§

impl BuiltInType

Source

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

Get the local name of this built-in type.

Delegates to XmlTypeCode::local_name for consistency.

Source

pub fn type_code(&self) -> XmlTypeCode

Get the corresponding XmlTypeCode for this built-in type.

Source

pub fn primitive_type_code(&self) -> Option<PrimitiveTypeCode>

Get the primitive type code for this built-in type.

Returns None for abstract types (AnySimpleType, AnyAtomicType) and list types (NMTOKENS, IDREFS, ENTITIES).

Source

pub fn is_primitive(&self) -> bool

Check if this is a primitive type (one of the 19 fundamental types).

Source

pub fn is_list(&self) -> bool

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

Source

pub fn is_xsd11(&self) -> bool

Check if this is an XSD 1.1 type.

Source

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

Parse a built-in type from its local name.

Delegates to XmlTypeCode::from_local_name for consistency.

Source

pub fn all() -> impl Iterator<Item = BuiltInType>

Returns an iterator over all built-in types.

Trait Implementations§

Source§

impl Clone for BuiltInType

Source§

fn clone(&self) -> BuiltInType

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 BuiltInType

Source§

impl Debug for BuiltInType

Source§

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

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

impl Eq for BuiltInType

Source§

impl From<BuiltInType> for XmlTypeCode

Source§

fn from(builtin: BuiltInType) -> Self

Converts to this type from the input type.
Source§

impl Hash for BuiltInType

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 BuiltInType

Source§

fn eq(&self, other: &BuiltInType) -> 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 BuiltInType

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.