Consume self to build a bytes
(self, py: Python<'py>)
| 30 | |
| 31 | /// Consume self to build a bytes |
| 32 | fn into_bytes(self, py: Python<'py>) -> PyResult<Py<PyAny>> { |
| 33 | let buffer = self.into_py_any(py)?; |
| 34 | unsafe { PyObject::from_owned_ptr_or_err(py, ffi::PyBytes_FromObject(buffer.as_ptr())) } |
| 35 | } |
| 36 | |
| 37 | /// Consume self to build a bytes |
| 38 | fn into_bytes_ref(self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> { |