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

Method write

crates/stdlib/src/_sqlite3.rs:2398–2411  ·  view source on GitHub ↗
(&self, data: PyBuffer, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

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> {

Callers 2

ass_subscriptMethod · 0.45
write_singleMethod · 0.45

Calls 7

innerMethod · 0.45
bytesMethod · 0.45
contiguous_or_collectMethod · 0.45
castMethod · 0.45
as_ptrMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected