mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-12-01 22:03:46 +03:00
18 lines
393 B
Python
18 lines
393 B
Python
|
import abc
|
||
|
|
||
|
|
||
|
class Transport(abc.ABC):
|
||
|
# Should return a newly-created instance of itself
|
||
|
@abc.abstractmethod
|
||
|
def recreate_fresh(self):
|
||
|
pass
|
||
|
|
||
|
@abc.abstractmethod
|
||
|
def pack(self, input: bytes) -> bytes:
|
||
|
pass
|
||
|
|
||
|
# Should raise EOFError if it does not have enough bytes
|
||
|
@abc.abstractmethod
|
||
|
def unpack(self, input: bytes) -> (int, bytes):
|
||
|
pass
|