(vm: &VirtualMachine, obj: &'a PyObject)
| 77 | |
| 78 | impl<'a> TryFromBorrowedObject<'a> for ArgBytesLike { |
| 79 | fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> { |
| 80 | let buffer = PyBuffer::try_from_borrowed_object(vm, obj)?; |
| 81 | if buffer.desc.is_contiguous() { |
| 82 | Ok(Self(buffer)) |
| 83 | } else { |
| 84 | Err(vm.new_buffer_error("non-contiguous buffer is not a bytes-like object")) |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /// A memory buffer, read-write access. Like the `w*` format code for `PyArg_Parse` in CPython. |
nothing calls this directly
no test coverage detected