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: ItemTypeThe item type
cardinality: XmlTypeCardinalityThe occurrence indicator
Implementations§
Source§impl SequenceType
impl SequenceType
Sourcepub fn new(item_type: ItemType, cardinality: XmlTypeCardinality) -> Self
pub fn new(item_type: ItemType, cardinality: XmlTypeCardinality) -> Self
Create a new sequence type
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create empty-sequence() type
This only matches empty sequences (zero items).
Sourcepub fn is_empty_sequence(&self) -> bool
pub fn is_empty_sequence(&self) -> bool
Check if this is the empty-sequence() type
Sourcepub fn string_optional() -> Self
pub fn string_optional() -> Self
xs:string?
Sourcepub fn integer_optional() -> Self
pub fn integer_optional() -> Self
xs:integer?
Sourcepub fn double_optional() -> Self
pub fn double_optional() -> Self
xs:double?
Sourcepub fn any_atomic() -> Self
pub fn any_atomic() -> Self
xs:anyAtomicType
Sourcepub fn any_atomic_optional() -> Self
pub fn any_atomic_optional() -> Self
xs:anyAtomicType?
Sourcepub fn any_atomic_star() -> Self
pub fn any_atomic_star() -> Self
xs:anyAtomicType*
Sourcepub fn type_code(&self) -> XmlTypeCode
pub fn type_code(&self) -> XmlTypeCode
Get the type code for the item type
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Check if this sequence type is numeric (decimal, float, double, integer types)
Sourcepub fn allows_empty(&self) -> bool
pub fn allows_empty(&self) -> bool
Check if this sequence type allows empty sequences
Sourcepub fn matches_sequence<N: DomNavigator>(
&self,
items: &[XmlItem<N>],
ctx: &XPathContext<'_>,
) -> bool
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
impl Clone for SequenceType
Source§fn clone(&self) -> SequenceType
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SequenceType
impl Debug for SequenceType
Source§impl Default for SequenceType
impl Default for SequenceType
Source§impl Display for SequenceType
impl Display for SequenceType
impl Eq for SequenceType
Source§impl PartialEq for SequenceType
impl PartialEq for SequenceType
Source§fn eq(&self, other: &SequenceType) -> bool
fn eq(&self, other: &SequenceType) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SequenceType
Auto Trait Implementations§
impl Freeze for SequenceType
impl RefUnwindSafe for SequenceType
impl Send for SequenceType
impl Sync for SequenceType
impl Unpin for SequenceType
impl UnsafeUnpin for SequenceType
impl UnwindSafe for SequenceType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more