MCPcopy Index your code
hub / github.com/RustPython/RustPython / next

Method next

crates/vm/src/stdlib/_collections.rs:659–669  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

657 impl SelfIter for PyDequeIterator {}
658 impl IterNext for PyDequeIterator {
659 fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
660 zelf.internal.lock().next(|deque, pos| {
661 if zelf.state != deque.state.load() {
662 return Err(vm.new_runtime_error("Deque mutated during iteration"));
663 }
664 let deque = deque.borrow_deque();
665 Ok(PyIterReturn::from_result(
666 deque.get(pos).cloned().ok_or(None),
667 ))
668 })
669 }
670 }
671
672 #[pyattr]

Callers

nothing calls this directly

Calls 6

borrow_dequeMethod · 0.80
ErrClass · 0.50
lockMethod · 0.45
loadMethod · 0.45
getMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected