MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / to_vec

Method to_vec

src/buffer.rs:484–486  ·  view source on GitHub ↗

Copies the buffer elements to a newly allocated vector. If the buffer is multi-dimensional, the elements are written in C-style order. Fails if the buffer format is not compatible with type `T`.

(&self, py: Python)

Source from the content-addressed store, hash-verified

482 ///
483 /// Fails if the buffer format is not compatible with type `T`.
484 pub fn to_vec<T: Element + Copy>(&self, py: Python) -> PyResult<Vec<T>> {
485 self.to_vec_impl(py, b'C')
486 }
487
488 /// Copies the buffer elements to a newly allocated vector.
489 /// If the buffer is multi-dimensional, the elements are written in Fortran-style order.

Callers 2

test_serde_basic_typesFunction · 0.80
test_serde_basic_structsFunction · 0.80

Calls 1

to_vec_implMethod · 0.80

Tested by 2

test_serde_basic_typesFunction · 0.64
test_serde_basic_structsFunction · 0.64