deserialize

Deserialization function

  1. V deserialize(Asdf data)
  2. V deserialize(char[] str)
    V
    deserialize
    (
    V
    )
    (
    in char[] str
    )

Examples

struct S
{
    string foo;
    uint bar;
}

assert(deserialize!S(`{"foo":"str","bar":4}`) == S("str", 4));

Proxy for members

struct S
{
    // const(char)[] doesn't reallocate ASDF data.
    @serdeProxy!(const(char)[])
    uint bar;
}

auto json = `{"bar":"4"}`;
assert(serializeToJson(S(4)) == json);
assert(deserialize!S(json) == S(4));

Meta