Copies the buffer elements to the specified slice. If the buffer is multi-dimensional, the elements are written in C-style order. Fails if the slice does not have the correct length (`buf.item_count()`). Fails if the buffer format is not compatible with type `T`. To check whether the buffer format is compatible before calling this method, you can use ` ::is_compatible_format
(&self, py: Python, target: &mut [T])
| 432 | /// you can use `<T as buffer::Element>::is_compatible_format(buf.format())`. |
| 433 | /// Alternatively, `match buffer::ElementType::from_format(buf.format())`. |
| 434 | pub fn copy_to_slice<T: Element + Copy>(&self, py: Python, target: &mut [T]) -> PyResult<()> { |
| 435 | self.copy_to_slice_impl(py, target, b'C') |
| 436 | } |
| 437 | |
| 438 | /// Copies the buffer elements to the specified slice. |
| 439 | /// If the buffer is multi-dimensional, the elements are written in Fortran-style order. |