Struct vstd::std_specs::range::RangeGhostIterator
source · pub struct RangeGhostIterator<A> {
pub start: A,
pub cur: A,
pub end: A,
}
Fields§
§start: A
§cur: A
§end: A
Trait Implementations§
source§impl<A: StepSpec + Step> ForLoopGhostIterator for RangeGhostIterator<A>
impl<A: StepSpec + Step> ForLoopGhostIterator for RangeGhostIterator<A>
source§open spec fn exec_invariant(&self, exec_iter: &Range<A>) -> bool
open spec fn exec_invariant(&self, exec_iter: &Range<A>) -> bool
{
&&& self.cur == exec_iter.start
&&& self.end == exec_iter.end
}
source§open spec fn ghost_invariant(&self, init: Option<&Self>) -> bool
open spec fn ghost_invariant(&self, init: Option<&Self>) -> bool
{
&&& self.start.spec_is_lt(self.cur) || self.start == self.cur
&&& self.cur.spec_is_lt(self.end) || self.cur == self.end
&&& if let Some(init) = init {
&&& init.start == init.cur
&&& init.start == self.start
&&& init.end == self.end
} else {
true
}
}
source§open spec fn ghost_ensures(&self) -> bool
open spec fn ghost_ensures(&self) -> bool
{ !self.cur.spec_is_lt(self.end) }
source§open spec fn ghost_decrease(&self) -> Option<int>
open spec fn ghost_decrease(&self) -> Option<int>
{ Some(self.cur.spec_steps_between_int(self.end)) }
source§open spec fn ghost_peek_next(&self) -> Option<A>
open spec fn ghost_peek_next(&self) -> Option<A>
{ Some(self.cur) }
source§open spec fn ghost_advance(&self, _exec_iter: &Range<A>) -> RangeGhostIterator<A>
open spec fn ghost_advance(&self, _exec_iter: &Range<A>) -> RangeGhostIterator<A>
{
RangeGhostIterator {
cur: self.cur.spec_forward_checked(1).unwrap(),
..*self
}
}
type ExecIter = Range<A>
type Item = A
type Decrease = int
Auto Trait Implementations§
impl<A> Freeze for RangeGhostIterator<A>where
A: Freeze,
impl<A> RefUnwindSafe for RangeGhostIterator<A>where
A: RefUnwindSafe,
impl<A> Send for RangeGhostIterator<A>where
A: Send,
impl<A> Sync for RangeGhostIterator<A>where
A: Sync,
impl<A> Unpin for RangeGhostIterator<A>where
A: Unpin,
impl<A> UnwindSafe for RangeGhostIterator<A>where
A: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more