Skip to main content

SequenceType

Struct SequenceType 

Source
pub struct SequenceType {
    pub item_type: ItemType,
    pub cardinality: XmlTypeCardinality,
}
Expand description

XPath2 sequence type

Describes the expected type of a sequence of items. Used for type checking, type matching, and conversions.

Fields§

§item_type: ItemType

The item type

§cardinality: XmlTypeCardinality

The occurrence indicator

Implementations§

Source§

impl SequenceType

Source

pub fn new(item_type: ItemType, cardinality: XmlTypeCardinality) -> Self

Create a new sequence type

Source

pub fn one(item_type: ItemType) -> Self

Create a sequence type for exactly one item

Source

pub fn optional(item_type: ItemType) -> Self

Create a sequence type for zero or one items

Source

pub fn plus(item_type: ItemType) -> Self

Create a sequence type for one or more items

Source

pub fn star(item_type: ItemType) -> Self

Create a sequence type for zero or more items

Source

pub fn empty() -> Self

Create empty-sequence() type

This only matches empty sequences (zero items).

Source

pub fn is_empty_sequence(&self) -> bool

Check if this is the empty-sequence() type

Source

pub fn any() -> Self

Create item()* - any sequence

Source

pub fn item() -> Self

Create item() - exactly one item

Source

pub fn node() -> Self

Create node() - exactly one node

Source

pub fn nodes() -> Self

Create node()* - sequence of nodes

Source

pub fn string() -> Self

xs:string

Source

pub fn string_optional() -> Self

xs:string?

Source

pub fn boolean() -> Self

xs:boolean

Source

pub fn integer() -> Self

xs:integer

Source

pub fn integer_optional() -> Self

xs:integer?

Source

pub fn decimal() -> Self

xs:decimal

Source

pub fn double() -> Self

xs:double

Source

pub fn double_optional() -> Self

xs:double?

Source

pub fn any_atomic() -> Self

xs:anyAtomicType

Source

pub fn any_atomic_optional() -> Self

xs:anyAtomicType?

Source

pub fn any_atomic_star() -> Self

xs:anyAtomicType*

Source

pub fn datetime() -> Self

xs:dateTime

Source

pub fn date() -> Self

xs:date

Source

pub fn time() -> Self

xs:time

Source

pub fn duration() -> Self

xs:duration

Source

pub fn qname() -> Self

xs:QName

Source

pub fn any_uri() -> Self

xs:anyURI

Source

pub fn type_code(&self) -> XmlTypeCode

Get the type code for the item type

Source

pub fn is_node(&self) -> bool

Check if this sequence type matches nodes

Source

pub fn is_atomic(&self) -> bool

Check if this sequence type matches atomic values

Source

pub fn is_numeric(&self) -> bool

Check if this sequence type is numeric (decimal, float, double, integer types)

Source

pub fn allows_empty(&self) -> bool

Check if this sequence type allows empty sequences

Source

pub fn matches_sequence<N: DomNavigator>( &self, items: &[XmlItem<N>], ctx: &XPathContext<'_>, ) -> bool

Check if a sequence of items matches this sequence type.

Validates both cardinality and item type for each item in the sequence.

Trait Implementations§

Source§

impl Clone for SequenceType

Source§

fn clone(&self) -> SequenceType

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 SequenceType

Source§

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

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

impl Default for SequenceType

Source§

fn default() -> Self

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

impl Display for SequenceType

Source§

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

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

impl Eq for SequenceType

Source§

impl PartialEq for SequenceType

Source§

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

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.