MCPcopy Create free account
hub / github.com/ZeroIntensity/pointers.py / move

Method move

src/pointers/base_pointers.py:309–325  ·  view source on GitHub ↗

Move data to the target address.

(
        self,
        data: Union["BaseCPointer[T]", T],
        *,
        unsafe: bool = False,
    )

Source from the content-addressed store, hash-verified

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)

Callers 2

__ilshift__Method · 0.95
__ixor__Method · 0.95

Calls 3

_make_stream_and_ptrMethod · 0.95
move_to_memFunction · 0.85
ensureMethod · 0.45

Tested by

no test coverage detected