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

Method next

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

Source from the content-addressed store, hash-verified

774impl SelfIter for PyBytesIterator {}
775impl IterNext for PyBytesIterator {
776 fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
777 zelf.internal.lock().next(|bytes, pos| {
778 Ok(PyIterReturn::from_result(
779 bytes
780 .as_bytes()
781 .get(pos)
782 .map(|&x| vm.new_pyobj(x))
783 .ok_or(None),
784 ))
785 })
786 }
787}
788
789impl<'a> TryFromBorrowedObject<'a> for PyBytes {

Callers

nothing calls this directly

Calls 5

new_pyobjMethod · 0.80
lockMethod · 0.45
mapMethod · 0.45
getMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected