Struct IntoIterGhostIterator

Source
pub struct IntoIterGhostIterator<T, A: Allocator> {
    pub pos: int,
    pub elements: Seq<T>,
    pub _marker: PhantomData<A>,
}

Fields§

§pos: int§elements: Seq<T>§_marker: PhantomData<A>

Trait Implementations§

Source§

impl<T, A: Allocator> ForLoopGhostIterator for IntoIterGhostIterator<T, A>

Source§

open spec fn exec_invariant(&self, exec_iter: &IntoIter<T, A>) -> 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: &IntoIter<T, A>, ) -> IntoIterGhostIterator<T, A>

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

type ExecIter = IntoIter<T, A>

Source§

type Item = T

Source§

type Decrease = int

Source§

impl<T, A: Allocator> View for IntoIterGhostIterator<T, A>

Source§

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

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

type V = Seq<T>

Auto Trait Implementations§

§

impl<T, A> Freeze for IntoIterGhostIterator<T, A>

§

impl<T, A> RefUnwindSafe for IntoIterGhostIterator<T, A>

§

impl<T, A> Send for IntoIterGhostIterator<T, A>
where A: Send, T: Send,

§

impl<T, A> Sync for IntoIterGhostIterator<T, A>
where A: Sync, T: Sync,

§

impl<T, A> Unpin for IntoIterGhostIterator<T, A>
where A: Unpin, T: Unpin,

§

impl<T, A> UnwindSafe for IntoIterGhostIterator<T, A>
where A: UnwindSafe, T: 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>,

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.