Source code for minos.common.protocol.abc

import abc
from typing import (
    Any,
)


[docs]class MinosBinaryProtocol(abc.ABC): """Minos binary encoder / decoder interface."""
[docs] @classmethod @abc.abstractmethod def encode(cls, *args, **kwargs) -> bytes: """Encodes the given value into bytes. :param args: Additional positional arguments. :param kwargs: Additional named arguments. :return: A bytes instance. """ raise NotImplementedError
[docs] @classmethod @abc.abstractmethod def decode(cls, data: bytes, *args, **kwargs) -> Any: """Decodes the given bytes data. :param data: bytes data to be decoded. :return: De decoded data. """ raise NotImplementedError