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

Method next

crates/vm/src/builtins/bytearray.rs:897–904  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

895impl SelfIter for PyByteArrayIterator {}
896impl IterNext for PyByteArrayIterator {
897 fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
898 zelf.internal.lock().next(|bytearray, pos| {
899 let buf = bytearray.borrow_buf();
900 Ok(PyIterReturn::from_result(
901 buf.get(pos).map(|&x| vm.new_pyobj(x)).ok_or(None),
902 ))
903 })
904 }
905}

Callers

nothing calls this directly

Calls 5

new_pyobjMethod · 0.80
lockMethod · 0.45
borrow_bufMethod · 0.45
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected