aiowamp.SerializerABC¶
-
class
aiowamp.SerializerABC[source]¶ Serializer for messages.
Normally an
aiowamp.TransportABCkeeps a serializer which it uses.Deliberately doesn’t adhere to Python’s dump / load interface because the objects in question are always
aiowamp.MessageABCand the serialized format is alwaysbytes.-
__init__()¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__Initialize self. deserialize(data)Deserialise the bytesrepresentation of a message.serialize(msg)Serialise a message. -
serialize(msg)[source]¶ Serialise a message.
Parameters: msg ( MessageABC) – Message to serialise.Return type: bytesReturns: bytesrepresentation of the message.Raises: Exception– If the message couldn’t be serialised.
-
deserialize(data)[source]¶ Deserialise the
bytesrepresentation of a message.Parameters: Return type: MessageABCReturns: Deserialised message.
Raises: aiowamp.InvalidMessage– If the deserialised data isn’t a message.Exception– If the message couldn’t be deserialised.
-