Copies the specified slice into the buffer. If the buffer is multi-dimensional, the elements in the slice are expected to be in C-style order. Fails if the buffer is read-only. 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, use `<T as
(&self, py: Python, source: &[T])
| 529 | /// use `<T as buffer::Element>::is_compatible_format(buf.format())`. |
| 530 | /// Alternatively, `match buffer::ElementType::from_format(buf.format())`. |
| 531 | pub fn copy_from_slice<T: Element + Copy>(&self, py: Python, source: &[T]) -> PyResult<()> { |
| 532 | self.copy_from_slice_impl(py, source, b'C') |
| 533 | } |
| 534 | |
| 535 | /// Copies the specified slice into the buffer. |
| 536 | /// If the buffer is multi-dimensional, the elements in the slice are expected to be in Fortran-style order. |