rsync.pyi 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from typing import Callable, Union
  2. ReadOnlyBuffer = Union[bytes, bytearray, memoryview]
  3. WriteBuffer = Union[bytearray, memoryview]
  4. class RsyncError(Exception):
  5. pass
  6. class Hasher:
  7. def __init__(self, which: str, data: ReadOnlyBuffer = b''): ...
  8. def update(self, data: ReadOnlyBuffer) -> None: ...
  9. def reset(self) -> None: ...
  10. def digest(self) -> bytes: ...
  11. def hexdigest(self) -> str: ...
  12. @property
  13. def digest_size(self) -> int: ...
  14. @property
  15. def block_size(self) -> int: ...
  16. @property
  17. def name(self) -> str: ...
  18. def xxh128_hash(data: ReadOnlyBuffer) -> bytes: ...
  19. def xxh128_hash_with_seed(data: ReadOnlyBuffer, seed: int) -> bytes: ...
  20. class Patcher:
  21. def __init__(self, expected_input_size: int = 0): ...
  22. def signature_header(self, output: WriteBuffer) -> int: ...
  23. def sign_block(self, block: ReadOnlyBuffer, output: WriteBuffer) -> int: ...
  24. def apply_delta_data(self, data: ReadOnlyBuffer, read: Callable[[int, WriteBuffer], int], write: Callable[[ReadOnlyBuffer], None]) -> None: ...
  25. def finish_delta_data(self) -> None: ...
  26. @property
  27. def block_size(self) -> int: ...
  28. @property
  29. def total_data_in_delta(self) -> int: ...
  30. class Differ:
  31. def add_signature_data(self, data: ReadOnlyBuffer) -> None: ...
  32. def finish_signature_data(self) -> None: ...
  33. def next_op(self, read: Callable[[WriteBuffer], int], write: Callable[[ReadOnlyBuffer], None]) -> bool: ...
  34. def parse_ftc(x: Union[str, ReadOnlyBuffer], callback: Callable[[memoryview, memoryview], None]) -> None: ...