Move data to the target address.
(
self,
data: Union["BaseCPointer[T]", T],
*,
unsafe: bool = False,
)
| 307 | |
| 308 | @handle |
| 309 | def move( |
| 310 | self, |
| 311 | data: Union["BaseCPointer[T]", T], |
| 312 | *, |
| 313 | unsafe: bool = False, |
| 314 | ) -> None: |
| 315 | """Move data to the target address.""" |
| 316 | if not isinstance(data, BaseCPointer): |
| 317 | raise ValueError( |
| 318 | f'"{type(data).__name__}" object is not a valid C pointer', |
| 319 | ) |
| 320 | |
| 321 | ptr, byte_stream = self._make_stream_and_ptr( |
| 322 | data.size, |
| 323 | data.ensure(), |
| 324 | ) |
| 325 | move_to_mem(ptr, byte_stream, unsafe=unsafe, target="C data") |
| 326 | |
| 327 | def __ilshift__(self, data: Union["BaseCPointer[T]", T]): |
| 328 | self.move(data) |
no test coverage detected