Skip to main content

Sequence

Trait Sequence 

Source
pub trait Sequence {
    type Item;

    // Required method
    fn sequence_items(&self) -> Vec<&Self::Item>;
}
Expand description

An ordered run of items a collection matcher can inspect.

Implemented for [T], [T; N], Vec<T>, VecDeque<T>, BTreeSet<T>, HashSet<T>, and &S for any Sequence S. Items are borrowed, not cloned. A lazy iterator is not a Sequence (it cannot be inspected through a shared borrow); collect it into a Vec first.

Required Associated Types§

Source

type Item

The element type.

Required Methods§

Source

fn sequence_items(&self) -> Vec<&Self::Item>

Borrows every item, in order.

Implementations on Foreign Types§

Source§

impl<S> Sequence for &S
where S: Sequence + ?Sized,

Source§

type Item = <S as Sequence>::Item

Source§

fn sequence_items(&self) -> Vec<&<S as Sequence>::Item>

Source§

impl<T> Sequence for [T]

Source§

impl<T> Sequence for BTreeSet<T>

Source§

impl<T> Sequence for VecDeque<T>

Source§

impl<T> Sequence for Vec<T>

Source§

impl<T> Sequence for HashSet<T>

Source§

impl<T, const N: usize> Sequence for [T; N]

Implementors§

Source§

impl<T> Sequence for Items<T>

Source§

type Item = T