pub trait IteratorSpecImpl: Iterator {
// Required methods
exec fn obeys_prophetic_iter_laws(&self) -> bool;
exec fn remaining(&self) -> Seq<Self::Item>;
exec fn produces(&self) -> Seq<bool>;
exec fn decrease(&self) -> Option<nat>;
exec fn peek(&self, index: int) -> Option<Self::Item>;
}Required Methods§
Sourceexec fn obeys_prophetic_iter_laws(&self) -> bool
exec fn obeys_prophetic_iter_laws(&self) -> bool
This iterator obeys the specifications below on next,
expressed in terms of prophetic spec functions.
Only finite iterators (i.e., those that eventually return None
and then continue to return None) or infinite iterators that
never return None should use this interface.
Sourceexec fn produces(&self) -> Seq<bool>
exec fn produces(&self) -> Seq<bool>
For each potential item in remaining(), does the item actually
get returned, or does the iterator get “stuck” trying to produce it,
e.g., because a client supplied a closure that diverges?
Sourceexec fn decrease(&self) -> Option<nat>
exec fn decrease(&self) -> Option<nat>
Value used by default for the decreases clause when no explicit decreases clause is provided (the user can override this with an explicit decreases clause). If there’s no appropriate metric to decrease, this can return None, and the user will have to provide an explicit decreases clause.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, K, V> IteratorSpecImpl for Iter<'a, K, V>
impl<'a, K, V> IteratorSpecImpl for Iter<'a, K, V>
Source§impl<'a, K, V> IteratorSpecImpl for Iter<'a, K, V>
impl<'a, K, V> IteratorSpecImpl for Iter<'a, K, V>
Source§impl<'a, K, V> IteratorSpecImpl for Keys<'a, K, V>
impl<'a, K, V> IteratorSpecImpl for Keys<'a, K, V>
Source§impl<'a, K, V> IteratorSpecImpl for Keys<'a, K, V>
impl<'a, K, V> IteratorSpecImpl for Keys<'a, K, V>
Source§impl<'a, K, V> IteratorSpecImpl for Values<'a, K, V>
impl<'a, K, V> IteratorSpecImpl for Values<'a, K, V>
Source§impl<'a, K, V> IteratorSpecImpl for Values<'a, K, V>
impl<'a, K, V> IteratorSpecImpl for Values<'a, K, V>
Source§impl<'a, K> IteratorSpecImpl for Iter<'a, K>
impl<'a, K> IteratorSpecImpl for Iter<'a, K>
Source§impl<'a, T: 'a> IteratorSpecImpl for Chunks<'a, T>
impl<'a, T: 'a> IteratorSpecImpl for Chunks<'a, T>
Source§impl<'a, T: 'a> IteratorSpecImpl for Iter<'a, T>
impl<'a, T: 'a> IteratorSpecImpl for Iter<'a, T>
Source§impl<'a, T: 'a> IteratorSpecImpl for Iter<'a, T>
impl<'a, T: 'a> IteratorSpecImpl for Iter<'a, T>
Source§impl<'a, T: 'a> IteratorSpecImpl for IterMut<'a, T>
impl<'a, T: 'a> IteratorSpecImpl for IterMut<'a, T>
Source§impl<'a, T> IteratorSpecImpl for Iter<'a, T>
impl<'a, T> IteratorSpecImpl for Iter<'a, T>
Source§impl<'a> IteratorSpecImpl for Chars<'a>
Available on verus_keep_ghost and crate feature alloc only.
impl<'a> IteratorSpecImpl for Chars<'a>
verus_keep_ghost and crate feature alloc only.Source§impl<A, B> IteratorSpecImpl for Zip<A, B>
impl<A, B> IteratorSpecImpl for Zip<A, B>
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{
&&& zip_iter_fst(*self).obeys_prophetic_iter_laws()
&&& zip_iter_snd(*self).obeys_prophetic_iter_laws()
}Source§impl<A: Step> IteratorSpecImpl for Range<A>
impl<A: Step> IteratorSpecImpl for Range<A>
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ obeys_range_step_spec::<A>() }Source§open spec fn remaining(&self) -> Seq<Self::Item>
open spec fn remaining(&self) -> Seq<Self::Item>
{
let steps = self.start.spec_steps_between_int(self.end);
let len = if steps > 0 { steps } else { 0 };
Seq::new(len as nat, |i: int| self.start.spec_forward_checked_int(i).unwrap())
}Source§open spec fn produces(&self) -> Seq<bool>
open spec fn produces(&self) -> Seq<bool>
{ Seq::new(IteratorSpec::remaining(self).len(), |i: int| true) }Source§impl<A: Step> IteratorSpecImpl for RangeInclusive<A>
impl<A: Step> IteratorSpecImpl for RangeInclusive<A>
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ obeys_range_step_spec::<A>() }Source§open spec fn remaining(&self) -> Seq<Self::Item>
open spec fn remaining(&self) -> Seq<Self::Item>
{
Seq::new(
spec_range_inclusive_len(self),
|i: int| self@.start.spec_forward_checked_int(i).unwrap(),
)
}Source§impl<B, I, F> IteratorSpecImpl for Map<I, F>
impl<B, I, F> IteratorSpecImpl for Map<I, F>
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ map_iter(*self).obeys_prophetic_iter_laws() }Source§impl<I, P> IteratorSpecImpl for Filter<I, P>
impl<I, P> IteratorSpecImpl for Filter<I, P>
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ filter_iter(*self).obeys_prophetic_iter_laws() }Source§impl<I> IteratorSpecImpl for &mut Iwhere
I: Iterator,
impl<I> IteratorSpecImpl for &mut Iwhere
I: Iterator,
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ <I as IteratorSpec>::obeys_prophetic_iter_laws(*self) }Source§impl<I> IteratorSpecImpl for Rev<I>where
I: DoubleEndedIterator + DoubleEndedIteratorSpec,
impl<I> IteratorSpecImpl for Rev<I>where
I: DoubleEndedIterator + DoubleEndedIteratorSpec,
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ rev_iter(*self).obeys_prophetic_iter_laws() }Source§impl<I> IteratorSpecImpl for Skip<I>where
I: Iterator,
impl<I> IteratorSpecImpl for Skip<I>where
I: Iterator,
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ skip_iter(*self).obeys_prophetic_iter_laws() }Source§impl<I> IteratorSpecImpl for Take<I>where
I: Iterator,
impl<I> IteratorSpecImpl for Take<I>where
I: Iterator,
Source§open spec fn obeys_prophetic_iter_laws(&self) -> bool
open spec fn obeys_prophetic_iter_laws(&self) -> bool
{ take_iter(*self).obeys_prophetic_iter_laws() }