Struct vstd::std_specs::hash::KeysGhostIterator

source ·
pub struct KeysGhostIterator<'a, Key, Value> {
    pub pos: int,
    pub keys: Seq<Key>,
    pub phantom: Option<&'a Value>,
}

Fields§

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

Trait Implementations§

source§

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

source§

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

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

}
source§

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

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

    }
}
source§

open spec fn ghost_ensures(&self) -> bool

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

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

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

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

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

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

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

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

source§

type Item = Key

source§

type Decrease = int

source§

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

source§

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

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

type V = Seq<Key>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'a, Key, Value> UnwindSafe for KeysGhostIterator<'a, Key, Value>
where Key: UnwindSafe, Value: 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.