(&self, data: PyBuffer, vm: &VirtualMachine)
| 2396 | |
| 2397 | #[pymethod] |
| 2398 | fn write(&self, data: PyBuffer, vm: &VirtualMachine) -> PyResult<()> { |
| 2399 | self.ensure_connection_open(vm)?; |
| 2400 | let mut inner = self.inner(vm)?; |
| 2401 | let blob_len = inner.blob.bytes(); |
| 2402 | let length = Self::expect_write(blob_len, data.desc.len, inner.offset, vm)?; |
| 2403 | |
| 2404 | let ret = data.contiguous_or_collect(|buf| { |
| 2405 | inner.blob.write(buf.as_ptr().cast(), length, inner.offset) |
| 2406 | }); |
| 2407 | |
| 2408 | self.check(ret, vm)?; |
| 2409 | inner.offset += length; |
| 2410 | Ok(()) |
| 2411 | } |
| 2412 | |
| 2413 | #[pymethod] |
| 2414 | fn tell(&self, vm: &VirtualMachine) -> PyResult<c_int> { |
no test coverage detected