jmri_dccex.transport.port
BytePort ABC — bidirectional byte stream.
1"""``BytePort`` ABC — bidirectional byte stream.""" 2from __future__ import annotations 3 4from abc import ABC, abstractmethod 5 6 7class BytePort(ABC): 8 @abstractmethod 9 async def write(self, data: bytes) -> None: ... 10 @abstractmethod 11 async def read_byte(self) -> int: ... 12 @abstractmethod 13 async def aclose(self) -> None: ... 14 @property 15 @abstractmethod 16 def is_open(self) -> bool: ...
class
BytePort(abc.ABC):
8class BytePort(ABC): 9 @abstractmethod 10 async def write(self, data: bytes) -> None: ... 11 @abstractmethod 12 async def read_byte(self) -> int: ... 13 @abstractmethod 14 async def aclose(self) -> None: ... 15 @property 16 @abstractmethod 17 def is_open(self) -> bool: ...
Helper class that provides a standard way to create an ABC using inheritance.