MessageCodec

automorph.spi.MessageCodec
trait MessageCodec[Node] extends MessageCodecMeta[Node]

Structured message format codec plugin.

Enables serialization of RPC messages into specific structured data format.

The underlying data format must support arbitrarily nested structures of basic data types. Given library must provide intermediate representation of structured data (i.e. document object model).

Type parameters

Node

message format node type

Attributes

Graph
Supertypes
trait MessageCodecMeta[Node]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def deserialize(data: Array[Byte]): Node

Deserializes a node from binary data.

Deserializes a node from binary data.

Value parameters

data

binary data in the specific codec

Attributes

Returns

node

Message format media (MIME) type.

Message format media (MIME) type.

Attributes

def serialize(node: Node): Array[Byte]

Serializes a node as binary data.

Serializes a node as binary data.

Value parameters

node

node

Attributes

Returns

binary data in the specific codec

def text(node: Node): String

Formats a node as human-readable text.

Formats a node as human-readable text.

Value parameters

node

node

Attributes

Returns

node in human-readable textual form

Inherited methods

inline def decode[T](node: Node): T

Decodes a value from a message codec node.

Decodes a value from a message codec node.

Type parameters

T

value type

Value parameters

node

message codec node

Attributes

Returns

value of the specified type

Inherited from:
MessageCodecMeta
inline def encode[T](value: T): Node

Encodes a value as a message codec node.

Encodes a value as a message codec node.

Type parameters

T

value type

Value parameters

value

value of given type

Attributes

Returns

message codec node

Inherited from:
MessageCodecMeta