isISOExtStringSerializable

Checks if a given type has an ISO extended string serialization representation.

A class or struct type is ISO extended string serializable if it defines a pair of toISOExtString/fromISOExtString methods. Any class or struct type that has this trait will be serialized by using the return value of it's toISOExtString method instead of the original value.

This is mainly useful for supporting serialization of the the date/time types in std.datetime.

This trait has precedence over isStringSerializable.

template isISOExtStringSerializable (
T
) {}

Members

Variables

isISOExtStringSerializable
enum bool isISOExtStringSerializable;
Undocumented in source.

Examples

import std.datetime;

static assert(isISOExtStringSerializable!DateTime);
static assert(isISOExtStringSerializable!SysTime);

// represented as an ISO extended string when serialized
static struct S {
	// dummy example implementations
	string toISOExtString() const { return ""; }
	static S fromISOExtString(string s) { return S.init; }
}

static assert(isISOExtStringSerializable!S);

Meta