pub trait Sequence: Debug + PartialEq {
    type Element: Element + ?Sized;

    fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Self::Element> + 'a>;
    fn get(&self, i: usize) -> Option<&Self::Element>;
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
}
Expand description

Represents the value of sequences of Ion elements (i.e. list and sexp).

Required Associated Types

Required Methods

The children of the sequence.

Note that this uses a Box<dyn Iterator<...>> to capture the borrow cleanly without without generic associated types (GAT). In theory, when GAT lands, this could be replaced with static polymorphism.

Returns a reference to the element in the sequence at the given index or returns None if the index is out of the bounds.

Returns the length of the sequence

Returns true if the sequence is empty otherwise returns false

Implementors