Enum skyscraper::xpath::grammar::data_model::XpathItem
source · pub enum XpathItem<'tree> {
Node(Node<'tree>),
Function(Function),
AnyAtomicType(AnyAtomicType),
}
Expand description
https://www.w3.org/TR/xpath-datamodel-31/#dt-item
Variants§
Node(Node<'tree>)
A node in the XpathItemTree
.
https://www.w3.org/TR/xpath-datamodel-31/#dt-node
Function(Function)
A function item.
https://www.w3.org/TR/xpath-datamodel-31/#dt-function-item
AnyAtomicType(AnyAtomicType)
An atomic value.
https://www.w3.org/TR/xpath-datamodel-31/#dt-atomic-value
Implementations§
source§impl<'tree> XpathItem<'tree>
impl<'tree> XpathItem<'tree>
sourcepub fn as_node(&self) -> Result<&Node<'tree>, EnumExtractError>
pub fn as_node(&self) -> Result<&Node<'tree>, EnumExtractError>
Returns references to the inner fields if this is a XpathItem::Node
, otherwise an enum_extract_error::EnumExtractError
sourcepub fn as_node_mut(&mut self) -> Result<&mut Node<'tree>, EnumExtractError>
pub fn as_node_mut(&mut self) -> Result<&mut Node<'tree>, EnumExtractError>
Returns mutable references to the inner fields if this is a XpathItem::Node
, otherwise an enum_extract_error::EnumExtractError
.
sourcepub fn into_node(
self,
) -> Result<Node<'tree>, EnumExtractValueError<XpathItem<'tree>>>
pub fn into_node( self, ) -> Result<Node<'tree>, EnumExtractValueError<XpathItem<'tree>>>
Returns the inner fields if this is a XpathItem::Node
, otherwise otherwise an enum_extract_error::EnumExtractError
.
sourcepub fn extract_as_node(&self) -> &Node<'tree>
pub fn extract_as_node(&self) -> &Node<'tree>
Returns references to the inner fields if this is a XpathItem::Node
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::Node
.
Prefer using a match
or XpathItem::as_node
; only use this if you know this is a XpathItem::Node
,
or if panicking is ok, such as during testing.
sourcepub fn extract_as_node_mut(&mut self) -> &mut Node<'tree>
pub fn extract_as_node_mut(&mut self) -> &mut Node<'tree>
Returns mutable references to the inner fields if this is a XpathItem::Node
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::Node
.
Prefer using a match
or XpathItem::as_node_mut
; only use this if you know this is a XpathItem::Node
,
or if panicking is ok, such as during testing.
sourcepub fn extract_into_node(self) -> Node<'tree>
pub fn extract_into_node(self) -> Node<'tree>
Returns the inner fields if this is a XpathItem::Node
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::Node
.
Prefer using a match
or XpathItem::into_node
; only use this if you know this is a XpathItem::Node
,
or if panicking is ok, such as during testing.
sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Returns true if this is a XpathItem::Function
, otherwise false
sourcepub fn as_function(&self) -> Result<&Function, EnumExtractError>
pub fn as_function(&self) -> Result<&Function, EnumExtractError>
Returns references to the inner fields if this is a XpathItem::Function
, otherwise an enum_extract_error::EnumExtractError
sourcepub fn as_function_mut(&mut self) -> Result<&mut Function, EnumExtractError>
pub fn as_function_mut(&mut self) -> Result<&mut Function, EnumExtractError>
Returns mutable references to the inner fields if this is a XpathItem::Function
, otherwise an enum_extract_error::EnumExtractError
.
sourcepub fn into_function(
self,
) -> Result<Function, EnumExtractValueError<XpathItem<'tree>>>
pub fn into_function( self, ) -> Result<Function, EnumExtractValueError<XpathItem<'tree>>>
Returns the inner fields if this is a XpathItem::Function
, otherwise otherwise an enum_extract_error::EnumExtractError
.
sourcepub fn extract_as_function(&self) -> &Function
pub fn extract_as_function(&self) -> &Function
Returns references to the inner fields if this is a XpathItem::Function
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::Function
.
Prefer using a match
or XpathItem::as_function
; only use this if you know this is a XpathItem::Function
,
or if panicking is ok, such as during testing.
sourcepub fn extract_as_function_mut(&mut self) -> &mut Function
pub fn extract_as_function_mut(&mut self) -> &mut Function
Returns mutable references to the inner fields if this is a XpathItem::Function
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::Function
.
Prefer using a match
or XpathItem::as_function_mut
; only use this if you know this is a XpathItem::Function
,
or if panicking is ok, such as during testing.
sourcepub fn extract_into_function(self) -> Function
pub fn extract_into_function(self) -> Function
Returns the inner fields if this is a XpathItem::Function
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::Function
.
Prefer using a match
or XpathItem::into_function
; only use this if you know this is a XpathItem::Function
,
or if panicking is ok, such as during testing.
sourcepub fn is_any_atomic_type(&self) -> bool
pub fn is_any_atomic_type(&self) -> bool
Returns true if this is a XpathItem::AnyAtomicType
, otherwise false
sourcepub fn as_any_atomic_type(&self) -> Result<&AnyAtomicType, EnumExtractError>
pub fn as_any_atomic_type(&self) -> Result<&AnyAtomicType, EnumExtractError>
Returns references to the inner fields if this is a XpathItem::AnyAtomicType
, otherwise an enum_extract_error::EnumExtractError
sourcepub fn as_any_atomic_type_mut(
&mut self,
) -> Result<&mut AnyAtomicType, EnumExtractError>
pub fn as_any_atomic_type_mut( &mut self, ) -> Result<&mut AnyAtomicType, EnumExtractError>
Returns mutable references to the inner fields if this is a XpathItem::AnyAtomicType
, otherwise an enum_extract_error::EnumExtractError
.
sourcepub fn into_any_atomic_type(
self,
) -> Result<AnyAtomicType, EnumExtractValueError<XpathItem<'tree>>>
pub fn into_any_atomic_type( self, ) -> Result<AnyAtomicType, EnumExtractValueError<XpathItem<'tree>>>
Returns the inner fields if this is a XpathItem::AnyAtomicType
, otherwise otherwise an enum_extract_error::EnumExtractError
.
sourcepub fn extract_as_any_atomic_type(&self) -> &AnyAtomicType
pub fn extract_as_any_atomic_type(&self) -> &AnyAtomicType
Returns references to the inner fields if this is a XpathItem::AnyAtomicType
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::AnyAtomicType
.
Prefer using a match
or XpathItem::as_any_atomic_type
; only use this if you know this is a XpathItem::AnyAtomicType
,
or if panicking is ok, such as during testing.
sourcepub fn extract_as_any_atomic_type_mut(&mut self) -> &mut AnyAtomicType
pub fn extract_as_any_atomic_type_mut(&mut self) -> &mut AnyAtomicType
Returns mutable references to the inner fields if this is a XpathItem::AnyAtomicType
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::AnyAtomicType
.
Prefer using a match
or XpathItem::as_any_atomic_type_mut
; only use this if you know this is a XpathItem::AnyAtomicType
,
or if panicking is ok, such as during testing.
sourcepub fn extract_into_any_atomic_type(self) -> AnyAtomicType
pub fn extract_into_any_atomic_type(self) -> AnyAtomicType
Returns the inner fields if this is a XpathItem::AnyAtomicType
, otherwise panics.
§Panics
Panics when the value is not a XpathItem::AnyAtomicType
.
Prefer using a match
or XpathItem::into_any_atomic_type
; only use this if you know this is a XpathItem::AnyAtomicType
,
or if panicking is ok, such as during testing.
Trait Implementations§
source§impl<'tree> Extend<XpathItem<'tree>> for XpathItemSet<'tree>
impl<'tree> Extend<XpathItem<'tree>> for XpathItemSet<'tree>
source§fn extend<T: IntoIterator<Item = XpathItem<'tree>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = XpathItem<'tree>>>(&mut self, iter: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl<'tree> FromIterator<XpathItem<'tree>> for XpathItemSet<'tree>
impl<'tree> FromIterator<XpathItem<'tree>> for XpathItemSet<'tree>
source§impl<'tree> Ord for XpathItem<'tree>
impl<'tree> Ord for XpathItem<'tree>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<'tree> PartialEq for XpathItem<'tree>
impl<'tree> PartialEq for XpathItem<'tree>
source§impl<'tree> PartialOrd for XpathItem<'tree>
impl<'tree> PartialOrd for XpathItem<'tree>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl<'tree> Eq for XpathItem<'tree>
impl<'tree> StructuralPartialEq for XpathItem<'tree>
Auto Trait Implementations§
impl<'tree> Freeze for XpathItem<'tree>
impl<'tree> RefUnwindSafe for XpathItem<'tree>
impl<'tree> Send for XpathItem<'tree>
impl<'tree> Sync for XpathItem<'tree>
impl<'tree> Unpin for XpathItem<'tree>
impl<'tree> UnwindSafe for XpathItem<'tree>
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.