struct Foo { int a; void toData (Serializer serializer, Serializer.Data key) { serializer.serialize(a, "b"); } void fromData (Serializer serializer, Serializer.Data key) { a = serializer.deserialize!(int)("b"); } } static assert(isSerializable!(Foo));
Serializable
This interface represents a type that this is serializable. To implement this interface Evaluates to $(D_KEYWORD true) if the given type is serializable. A type is considered serializable when it implements to two methods in the Serializable interface. Note that the type does not have to implement the actual interface, i.e. it also works for structs.