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>
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
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
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
open spec fn ghost_ensures(&self) -> bool
{ self.pos == self.keys.len() }
source§open spec fn ghost_decrease(&self) -> Option<int>
open spec fn ghost_decrease(&self) -> Option<int>
{ Some(self.keys.len() - self.pos) }
source§open spec fn ghost_peek_next(&self) -> Option<Key>
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>
open spec fn ghost_advance( &self, _exec_iter: &Keys<'a, Key, Value>, ) -> KeysGhostIterator<'a, Key, Value>
{ Self { pos: self.pos + 1, ..*self } }
type ExecIter = Keys<'a, Key, Value>
type Item = Key
type Decrease = int
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>
impl<'a, Key, Value> Sync for KeysGhostIterator<'a, Key, Value>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more