pub enum Sequence {
Empty(Empty),
One(One),
Many(Many),
Range(Range),
}
Variants§
Implementations§
Source§impl Sequence
impl Sequence
Sourcepub fn deep_equal(
&self,
other: &Sequence,
collation: &Collation,
default_offset: FixedOffset,
xot: &Xot,
) -> Result<bool, Error>
pub fn deep_equal( &self, other: &Sequence, collation: &Collation, default_offset: FixedOffset, xot: &Xot, ) -> Result<bool, Error>
Compare two sequences using XPath deep equal rules.
Source§impl Sequence
impl Sequence
Sourcepub fn one(self) -> Result<Item, Error>
pub fn one(self) -> Result<Item, Error>
Get a single item from the sequence, if it only contains one item
Otherwise you get a type error.
Sourcepub fn option(self) -> Result<Option<Item>, Error>
pub fn option(self) -> Result<Option<Item>, Error>
Get a optional item from the sequence
If it contains more than one item, you get a type error.
Sourcepub fn iter(&self) -> Box<dyn Iterator<Item = Item> + '_>
pub fn iter(&self) -> Box<dyn Iterator<Item = Item> + '_>
Get the items from the sequence as an iterator
Sourcepub fn effective_boolean_value(&self) -> Result<bool, Error>
pub fn effective_boolean_value(&self) -> Result<bool, Error>
Effective boolean value
Sourcepub fn nodes<'a>(&'a self) -> Box<dyn Iterator<Item = Result<Node, Error>> + 'a>
pub fn nodes<'a>(&'a self) -> Box<dyn Iterator<Item = Result<Node, Error>> + 'a>
Iterator over the nodes in the sequence
An error is returned for items that are not a node.
Sourcepub fn atomized<'a>(
&'a self,
xot: &'a Xot,
) -> Box<dyn Iterator<Item = Result<Atomic, Error>> + 'a>
pub fn atomized<'a>( &'a self, xot: &'a Xot, ) -> Box<dyn Iterator<Item = Result<Atomic, Error>> + 'a>
Iterator for the atomized values in the sequence
Sourcepub fn atomized_one(&self, xot: &Xot) -> Result<Atomic, Error>
pub fn atomized_one(&self, xot: &Xot) -> Result<Atomic, Error>
Get just one atomized value from the sequence
If there are less or more, you get a type error.
Sourcepub fn atomized_option(&self, xot: &Xot) -> Result<Option<Atomic>, Error>
pub fn atomized_option(&self, xot: &Xot) -> Result<Option<Atomic>, Error>
Get an optional atomized value from the sequence
If there are more than one, you get a type error.
Sourcepub fn map_iter<'a>(
&'a self,
) -> Box<dyn Iterator<Item = Result<Map, Error>> + 'a>
pub fn map_iter<'a>( &'a self, ) -> Box<dyn Iterator<Item = Result<Map, Error>> + 'a>
Iterator over the XPath maps in the sequence
An error is returned for items that are not a map.
Sourcepub fn array_iter<'a>(
&'a self,
) -> Box<dyn Iterator<Item = Result<Array, Error>> + 'a>
pub fn array_iter<'a>( &'a self, ) -> Box<dyn Iterator<Item = Result<Array, Error>> + 'a>
Iterator over the XPath arrays in the sequence
An error is returned for items that are not an array.
Source§impl Sequence
impl Sequence
Sourcepub fn concat(self, other: Sequence) -> Result<Sequence, Error>
pub fn concat(self, other: Sequence) -> Result<Sequence, Error>
Concatenate two sequences producing a new sequence.
pub fn sorted( &self, context: &DynamicContext<'_>, collation: Rc<Collation>, xot: &Xot, ) -> Result<Sequence, Error>
pub fn sorted_by_key<F>( &self, context: &DynamicContext<'_>, collation: Rc<Collation>, get: F, ) -> Result<Sequence, Error>
Sourcepub fn normalize(
&self,
item_separator: &str,
xot: &mut Xot,
) -> Result<Node, Error>
pub fn normalize( &self, item_separator: &str, xot: &mut Xot, ) -> Result<Node, Error>
Normalize this sequence into a document node, according to https://www.w3.org/TR/xslt-xquery-serialization-31/#serdm
Sourcepub fn serialize(
&self,
params: SerializationParameters,
xot: &mut Xot,
) -> Result<String, Error>
pub fn serialize( &self, params: SerializationParameters, xot: &mut Xot, ) -> Result<String, Error>
Serialize this sequence according to serialization parameters
Sourcepub fn display_representation(
&self,
xot: &Xot,
context: &DynamicContext<'_>,
) -> String
pub fn display_representation( &self, xot: &Xot, context: &DynamicContext<'_>, ) -> String
Display representation of the sequence
Trait Implementations§
Source§impl<'a> FromIterator<&'a Item> for Sequence
impl<'a> FromIterator<&'a Item> for Sequence
Source§impl FromIterator<Atomic> for Sequence
impl FromIterator<Atomic> for Sequence
Source§impl FromIterator<Item> for Sequence
impl FromIterator<Item> for Sequence
Source§impl FromIterator<Node> for Sequence
impl FromIterator<Node> for Sequence
impl StructuralPartialEq for Sequence
Auto Trait Implementations§
impl Freeze for Sequence
impl RefUnwindSafe for Sequence
impl !Send for Sequence
impl !Sync for Sequence
impl Unpin for Sequence
impl UnwindSafe for Sequence
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more