Struct vstd::std_specs::hash::IterGhostIterator
source · pub struct IterGhostIterator<'a, Key> {
pub pos: int,
pub elements: Seq<Key>,
pub phantom: Option<&'a Key>,
}
Fields§
§pos: int
§elements: Seq<Key>
§phantom: Option<&'a Key>
Trait Implementations§
source§impl<'a, Key: 'a> ForLoopGhostIterator for IterGhostIterator<'a, Key>
impl<'a, Key: 'a> ForLoopGhostIterator for IterGhostIterator<'a, Key>
source§open spec fn exec_invariant(&self, exec_iter: &Iter<'a, Key>) -> bool
open spec fn exec_invariant(&self, exec_iter: &Iter<'a, Key>) -> bool
{
&&& self.pos == exec_iter@.0
&&& self.elements == 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.elements == self.elements
&&& 0 <= self.pos <= self.elements.len()
}
}
source§open spec fn ghost_ensures(&self) -> bool
open spec fn ghost_ensures(&self) -> bool
{ self.pos == self.elements.len() }
source§open spec fn ghost_decrease(&self) -> Option<int>
open spec fn ghost_decrease(&self) -> Option<int>
{ Some(self.elements.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.elements.len() {
Some(self.elements[self.pos])
} else {
None
}
}
source§open spec fn ghost_advance(
&self,
_exec_iter: &Iter<'a, Key>,
) -> IterGhostIterator<'a, Key>
open spec fn ghost_advance( &self, _exec_iter: &Iter<'a, Key>, ) -> IterGhostIterator<'a, Key>
{ Self { pos: self.pos + 1, ..*self } }
type ExecIter = Iter<'a, Key>
type Item = Key
type Decrease = int
Auto Trait Implementations§
impl<'a, Key> Freeze for IterGhostIterator<'a, Key>
impl<'a, Key> RefUnwindSafe for IterGhostIterator<'a, Key>where
Key: RefUnwindSafe,
impl<'a, Key> Send for IterGhostIterator<'a, Key>
impl<'a, Key> Sync for IterGhostIterator<'a, Key>where
Key: Sync,
impl<'a, Key> Unpin for IterGhostIterator<'a, Key>where
Key: Unpin,
impl<'a, Key> UnwindSafe for IterGhostIterator<'a, Key>where
Key: UnwindSafe + 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