Skip to main content

Sequence

Type Alias Sequence 

Source
pub type Sequence<N> = Vec<Item<N>>;
Expand description

In XPath, the Sequence is the fundamental data structure. It is an ordered collection of Items. The Rust implementation is a Vector of reference counted Items.

See SequenceTrait for methods.

Aliased Type§

pub struct Sequence<N> { /* private fields */ }

Trait Implementations§

Source§

impl<N: Node> From<Item<N>> for Sequence<N>

Source§

fn from(i: Item<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: Node> From<Value> for Sequence<N>

Source§

fn from(v: Value) -> Self

Converts to this type from the input type.
Source§

impl<N: Node> SequenceTrait<N> for Sequence<N>

Source§

fn to_string(&self) -> String

Returns the string value of the Sequence.

Source§

fn to_xml(&self) -> String

Renders the Sequence as XML

Source§

fn to_xml_with_options(&self, od: &OutputDefinition) -> String

Renders the Sequence as XML

Source§

fn to_json(&self) -> String

Renders the Sequence as JSON

Source§

fn push_node(&mut self, n: &N)

Push a document’s Node on to the Sequence. This clones the node.

Source§

fn push_value(&mut self, v: &Rc<Value>)

Push a Value on to the Sequence.

Source§

fn push_item(&mut self, i: &Item<N>)

Push an Item on to the Sequence. This clones the Item.

Source§

fn to_bool(&self) -> bool

Calculate the effective boolean value of the Sequence

Source§

fn to_int(&self) -> Result<i64, Error>

Convenience routine for integer value of the Sequence. The Sequence must be a singleton; i.e. be a single item.