Method
as_buffer
(zelf: &Py<Self>, _vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 789 | |
| 790 | impl AsBuffer for PyMmap { |
| 791 | fn as_buffer(zelf: &Py<Self>, _vm: &VirtualMachine) -> PyResult<PyBuffer> { |
| 792 | let readonly = matches!(zelf.access, AccessMode::Read); |
| 793 | let buf = PyBuffer::new( |
| 794 | zelf.to_owned().into(), |
| 795 | BufferDescriptor::simple(zelf.__len__(), readonly), |
| 796 | &BUFFER_METHODS, |
| 797 | ); |
| 798 | |
| 799 | Ok(buf) |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | impl AsMapping for PyMmap { |
Callers
nothing calls this directly
Tested by
no test coverage detected