(zelf: &Py<Self>, vm: &VirtualMachine)
| 774 | impl SelfIter for PyBytesIterator {} |
| 775 | impl 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 | |
| 789 | impl<'a> TryFromBorrowedObject<'a> for PyBytes { |