Serializer.serialize

Serializes the given value.

class Serializer
serialize
(
T
)
(
auto ref T value
,
string key = null
)

Parameters

value T

the value to serialize

key string

associates the value with the given key. This key can later be used to deserialize the value

* Examples:

auto archive = new XmlArchive!();
auto serializer = new Serializer(archive);

serializer.serialize(1);
serializer.serialize(2, "b");

Return Value

Type: Data

return the serialized data, in an untyped format.

Throws

SerializationException if an error occurs

Meta