Coverage for oarepo_c4gh/crypt4gh/common/proto4gh.py: 100%
11 statements
« prev ^ index » next coverage.py v7.10.2, created at 2025-08-07 12:05 +0000
« prev ^ index » next coverage.py v7.10.2, created at 2025-08-07 12:05 +0000
1"""Protocol for container implementation.
3"""
5from typing import Protocol, abstractmethod
6from .header import Header
7from typing import Generator
8from .data_block import DataBlock
11class Proto4GH(Protocol):
12 """A protocol ensuring a header and data packets are available."""
14 @property
15 @abstractmethod
16 def header(self) -> Header:
17 """Must return an implementaiton of abstract header."""
18 ...
20 @property
21 @abstractmethod
22 def data_blocks(self) -> Generator[DataBlock, None, None]:
23 """Must be a single-use iterator for data blocks."""
24 ...