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