rsync.pyi 1.5 KB

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