serdeGetKeyOut

Members

Variables

serdeGetKeyOut
enum string serdeGetKeyOut;
Undocumented in source.
serdeGetKeyOut
enum string serdeGetKeyOut;
Undocumented in source.
serdeGetKeyOut
enum string serdeGetKeyOut;
Undocumented in source.
serdeGetKeyOut
enum string serdeGetKeyOut;
Undocumented in source.

Return Value

output key for the symbol or enum value

Examples

struct S
{
    int f;

    @serdeKeys("D", "t")
    int d;

    @serdeIgnore
    int i;

    @serdeIgnoreIn
    int ii;

    @serdeIgnoreOut
    int io;

    @serdeKeys("P")
    @serdeKeyOut("")
    void p(int) @property {}
}

static assert(serdeGetKeyOut!(S.f) == "f");
static assert(serdeGetKeyOut!(S.d) == "D");
static assert(serdeGetKeyOut!(S.i) is null);
static assert(serdeGetKeyOut!(S.ii) == "ii");
static assert(serdeGetKeyOut!(S.io) is null);
static assert(serdeGetKeyOut!(S.p) !is null);
static assert(serdeGetKeyOut!(S.p) == "");
enum E
{
    @serdeKeys("A", "alpha")
    a,
    @serdeKeys("B", "beta")
    @serdeKeyOut("o")
    b,
    c,
}

static assert (serdeGetKeyOut(E.a) == "A");
static assert (serdeGetKeyOut(E.b) == "o");
static assert (serdeGetKeyOut(E.c) == "c");

Meta