vstd::std_specs::hash

Struct ValuesGhostIterator

Source
pub struct ValuesGhostIterator<'a, Key, Value> {
    pub pos: int,
    pub values: Seq<Value>,
    pub phantom: Option<&'a Key>,
}

Fields§

§pos: int§values: Seq<Value>§phantom: Option<&'a Key>

Trait Implementations§

Source§

impl<'a, Key: 'a, Value: 'a> ForLoopGhostIterator for ValuesGhostIterator<'a, Key, Value>

Source§

open spec fn exec_invariant(&self, exec_iter: &Values<'a, Key, Value>) -> bool

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

}
Source§

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

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

    }
}
Source§

open spec fn ghost_ensures(&self) -> bool

{ self.pos == self.values.len() }
Source§

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

{ Some(self.values.len() - self.pos) }
Source§

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

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

open spec fn ghost_advance( &self, _exec_iter: &Values<'a, Key, Value>, ) -> ValuesGhostIterator<'a, Key, Value>

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

type ExecIter = Values<'a, Key, Value>

Source§

type Item = Value

Source§

type Decrease = int

Source§

impl<'a, Key, Value> View for ValuesGhostIterator<'a, Key, Value>

Source§

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

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

type V = Seq<Value>

Auto Trait Implementations§

§

impl<'a, Key, Value> Freeze for ValuesGhostIterator<'a, Key, Value>

§

impl<'a, Key, Value> RefUnwindSafe for ValuesGhostIterator<'a, Key, Value>
where Value: RefUnwindSafe, Key: RefUnwindSafe,

§

impl<'a, Key, Value> Send for ValuesGhostIterator<'a, Key, Value>
where Value: Send, Key: Sync,

§

impl<'a, Key, Value> Sync for ValuesGhostIterator<'a, Key, Value>
where Value: Sync, Key: Sync,

§

impl<'a, Key, Value> Unpin for ValuesGhostIterator<'a, Key, Value>
where Value: Unpin,

§

impl<'a, Key, Value> UnwindSafe for ValuesGhostIterator<'a, Key, Value>
where Value: UnwindSafe, Key: RefUnwindSafe,

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.