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 always bytes.

__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.
__str__()[source]

Return str(self).

Return type:str
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:

data (bytes) – bytes representation of a message.

Return type:

MessageABC

Returns:

Deserialised message.

Raises: