Return serialized data as memoryview for zero-copy access. Returns: memoryview: A memoryview of the serialized data. For objects with contiguous memory (bytes, bytearray, numpy arrays), this is zero-copy. For non-contiguous data, a copy m
(self)
| 66 | |
| 67 | @abstractmethod |
| 68 | def getbuffer(self) -> memoryview: |
| 69 | """ |
| 70 | Return serialized data as memoryview for zero-copy access. |
| 71 | |
| 72 | Returns: |
| 73 | memoryview: A memoryview of the serialized data. For objects with |
| 74 | contiguous memory (bytes, bytearray, numpy arrays), this is zero-copy. |
| 75 | For non-contiguous data, a copy may be created to ensure contiguity. |
| 76 | """ |
| 77 | |
| 78 | def raw(self): |
| 79 | return memoryview(self.getbuffer()) |
no outgoing calls