Struct vstd::std_specs::vecdeque::IterGhostIterator

source ·
pub struct IterGhostIterator<'a, T> {
    pub pos: int,
    pub elements: Seq<T>,
    pub phantom: Option<&'a T>,
}

Fields§

§pos: int§elements: Seq<T>§phantom: Option<&'a T>

Trait Implementations§

source§

impl<'a, T: 'a> ForLoopGhostIterator for IterGhostIterator<'a, T>

source§

open spec fn exec_invariant(&self, exec_iter: &Iter<'a, T>) -> bool

{
    &&& self.pos == exec_iter@.0
    &&& self.elements == exec_iter@.1

}
source§

open spec fn ghost_invariant(&self, init: Option<&Self>) -> bool

{
    init matches Some(
        init,
    ) ==> {
        &&& init.pos == 0
        &&& init.elements == self.elements
        &&& 0 <= self.pos <= self.elements.len()

    }
}
source§

open spec fn ghost_ensures(&self) -> bool

{ self.pos == self.elements.len() }
source§

open spec fn ghost_decrease(&self) -> Option<int>

{ Some(self.elements.len() - self.pos) }
source§

open spec fn ghost_peek_next(&self) -> Option<T>

{
    if 0 <= self.pos < self.elements.len() {
        Some(self.elements[self.pos])
    } else {
        None
    }
}
source§

open spec fn ghost_advance(&self, _exec_iter: &Iter<'a, T>) -> IterGhostIterator<'a, T>

{ Self { pos: self.pos + 1, ..*self } }
source§

type ExecIter = Iter<'a, T>

source§

type Item = T

source§

type Decrease = int

source§

impl<'a, T> View for IterGhostIterator<'a, T>

source§

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

{ self.elements.take(self.pos) }
source§

type V = Seq<T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for IterGhostIterator<'a, T>

§

impl<'a, T> RefUnwindSafe for IterGhostIterator<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for IterGhostIterator<'a, T>
where T: Send + Sync,

§

impl<'a, T> Sync for IterGhostIterator<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for IterGhostIterator<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for IterGhostIterator<'a, T>

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>,

source§

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>,

source§

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.