serde

Serialize value to binary ion data and deserialize it back to requested type. Uses GC allocated string tables.

  1. T serde(V value, int serdeTarget)
    template serde(T)
    T
    serde
    (
    V
    )
    (
    auto ref scope const V value
    ,
    int serdeTarget = SerdeTarget.ion
    )
    if (
    !is(immutable V == immutable IonValueStream)
    )
  2. template serde(T)

Members

Functions

serde
T serde(V value, int serdeTarget)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

import mir.ion.stream: IonValueStream;
import mir.algebraic_alias.json: JsonAlgebraic;
static struct S
{
    double a;
    string s;
}
auto s = S(12.34, "str");
assert(s.serde!JsonAlgebraic.serde!S == s);
assert(s.serde!IonValueStream.serde!S == s);

Meta