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>

source§

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

{
    &&& 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

{ !self.cur.spec_is_lt(self.end) }
source§

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>

{ Some(self.cur) }
source§

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

source§

impl<A: StepSpec + Step> View for RangeGhostIterator<A>

source§

open spec fn view(&self) -> Seq<A>

{
    Seq::new(
        self.start.spec_steps_between_int(self.cur) as nat,
        |i: int| self.start.spec_forward_checked_int(i).unwrap(),
    )
}
§

type V = Seq<A>

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.