Coverage for haystack/marshal/protocol.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-21 13:53 +0000

1# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> 

2# 

3# SPDX-License-Identifier: Apache-2.0 

4 

5from typing import Any, Protocol 

6 

7 

8class Marshaller(Protocol): 

9 def marshal(self, dict_: dict[str, Any]) -> str: 

10 "Convert a dictionary to its string representation" 

11 ... 

12 

13 def unmarshal(self, data_: str | bytes | bytearray) -> dict[str, Any]: 

14 """Convert a marshalled object to its dictionary representation""" 

15 ...