Function deserialize

Deserializes and returns a serialized value.

serialized_data can be either an input range or a value containing the serialized data, depending on the type of serializer used.

Prototype

T deserialize(Serializer, T, ARGS...)(
  ARGS args
);

See Also

vibe.data.json.JsonSerializer, vibe.data.json.JsonStringSerializer, vibe.data.bson.BsonSerializer

Example

import vibe.data.json;

struct Test {
	int value;
	string text;
}

Json serialized = Json.emptyObject;
serialized.value = 12;
serialized.text = "Hello";

Test test = deserialize!(JsonSerializer, Test)(serialized);
assert(test.value == 12);
assert(test.text == "Hello");

Authors

Sönke Ludwig

Copyright

© 2013 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.