IntoIteratorAssertions

Trait IntoIteratorAssertions 

Source
pub trait IntoIteratorAssertions<T: Debug> {
    // Required methods
    fn into_iter_contains<E>(self, expected: E) -> Self
       where E: Debug,
             T: AssertrPartialEq<E>;
    fn into_iter_contains_exactly<E>(self, expected: impl AsRef<[E]>) -> Self
       where E: Debug,
             T: PartialEq<E> + AssertrPartialEq<E> + Debug;
    fn into_iter_iterator_is_empty(self) -> Self;
}
Expand description

Assertions for any type convertable to some Iterator using the IntoIterator trait. Assertions partly match the known assertions for slices, as an iterator can roughly be seen as a collection (simply without random access to it and only the possibility to iterate once).

Assertions are prefixed to distinguish these assertions from more concrete implementations on the actual type, like Vec for example.

Required Methods§

Source

fn into_iter_contains<E>(self, expected: E) -> Self
where E: Debug, T: AssertrPartialEq<E>,

Source

fn into_iter_contains_exactly<E>(self, expected: impl AsRef<[E]>) -> Self
where E: Debug, T: PartialEq<E> + AssertrPartialEq<E> + Debug,

Source

fn into_iter_iterator_is_empty(self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, I, M: Mode> IntoIteratorAssertions<T> for AssertThat<'_, I, M>
where T: Debug, for<'any> &'any I: IntoIterator<Item = &'any T>,