don't use this function to create the memoryview if the buffer is exporting via another memoryview, use PyMemoryView::new_view() or PyMemoryView::from_object to reduce the chain
(
buffer: PyBuffer,
range: Range<usize>,
vm: &VirtualMachine,
)
| 106 | /// via another memoryview, use PyMemoryView::new_view() or PyMemoryView::from_object |
| 107 | /// to reduce the chain |
| 108 | pub fn from_buffer_range( |
| 109 | buffer: PyBuffer, |
| 110 | range: Range<usize>, |
| 111 | vm: &VirtualMachine, |
| 112 | ) -> PyResult<Self> { |
| 113 | let mut zelf = Self::from_buffer(buffer, vm)?; |
| 114 | |
| 115 | zelf.init_range(range, 0); |
| 116 | zelf.init_len(); |
| 117 | Ok(zelf) |
| 118 | } |
| 119 | |
| 120 | /// this should be the only way to create a memoryview from another memoryview |
| 121 | pub fn new_view(&self) -> Self { |
nothing calls this directly
no test coverage detected