File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module mir.serde;
13
13
14
14
import mir.functional: naryFun;
15
15
import mir.reflection;
16
+ import std.meta : AliasSeq;
16
17
import std.traits : TemplateArgsOf, EnumMembers, hasUDA, isAggregateType;
17
18
18
19
version (D_Exceptions)
@@ -652,6 +653,13 @@ version(mir_test) unittest
652
653
+/
653
654
alias serdeGetProxy (alias symbol) = TemplateArgsOf! (getUDA! (symbol, serdeProxy))[0 ];
654
655
656
+ // / Can be applied to @serdeProxy types to make (de)serialization use
657
+ // / underlying type through casting. Useful for enums.
658
+ enum serdeProxyCast;
659
+
660
+ // / Equivalent to @serdeProxy!T @serdeProxyCast
661
+ alias serdeEnumProxy (T) = AliasSeq! (serdeProxy! T, serdeProxyCast);
662
+
655
663
/+ +
656
664
Can be applied only to fields that can be constructed from strings.
657
665
Does not allocate new data when deserializeing. Raw data is used for strings instead of new memory allocation.
You can’t perform that action at this time.
0 commit comments