Source code for jina.proto.serializer

from ..types.request import Request


[docs]class RequestProto: """This class is a drop-in replacement for gRPC default serializer. It replace default serializer to make sure we always work with `Request` """
[docs] @staticmethod def SerializeToString(x: 'Request'): """ # noqa: DAR101 # noqa: DAR102 # noqa: DAR201 """ return x.proto.SerializeToString()
[docs] @staticmethod def FromString(x: bytes): """ # noqa: DAR101 # noqa: DAR102 # noqa: DAR201 """ return Request(x)