A template that evaluates to a bool which determines whether the given Adapter can successfully
compile all the code needed to serialise and deserialise the For type.
Adapters:
Certain IConfig implementations may provide a level of flexibliity in the sense that they will offload the responsiblity
of serialising/deserialising the configuration onto something called an Adapter.
For the most part, these Adapters are likely to simply be that: an adapter for an already existing serialisation library.
Adapters require two static functions, with the following or compatible signatures:
const(ubyte[]) serialise(For)(For value);
For deserialise(For)(const(ubyte[]) value);
Builtin Adapters:
Please note that any adapter that uses a third party library will only be compiled if your own project includes aforementioned library.
For example, AsdfConfigAdapter requires the asdf library, so will only be available if your dub project includes asdf (or specify the Have_asdf version).
e.g. if you want to use AsdfConfigAdapter, use a simple dub add asdf in your own project and then you're good to go.
JCLI provides the following adapters by default:
* AsdfConfigAdapter - An adapter for the asdf serialisation library. asdf is marked as an optional package.
Notes:
If for whatever reason the given Adapter cannot compile when being used with the For type, this template
will attempt to instigate an error message from the compiler as to why.
If this template is being used inside a static assert, and fails, then the above attempt to provide an error message as to
why the compliation failed will not be shown, as the static assert is false error is thrown before the compile has a chance to collect any other error message.
In such a case, please temporarily rewrite the static assert into storing the result of this template into an enum, as that should then allow
the compiler to generate the error message.
A template that evaluates to a bool which determines whether the given Adapter can successfully compile all the code needed to serialise and deserialise the For type.
Adapters: Certain IConfig implementations may provide a level of flexibliity in the sense that they will offload the responsiblity of serialising/deserialising the configuration onto something called an Adapter.
For the most part, these Adapters are likely to simply be that: an adapter for an already existing serialisation library.
Adapters require two static functions, with the following or compatible signatures:
Builtin Adapters: Please note that any adapter that uses a third party library will only be compiled if your own project includes aforementioned library.
For example, AsdfConfigAdapter requires the asdf library, so will only be available if your dub project includes asdf (or specify the Have_asdf version).
e.g. if you want to use AsdfConfigAdapter, use a simple dub add asdf in your own project and then you're good to go.
JCLI provides the following adapters by default:
* AsdfConfigAdapter - An adapter for the asdf serialisation library. asdf is marked as an optional package.
Notes: If for whatever reason the given Adapter cannot compile when being used with the For type, this template will attempt to instigate an error message from the compiler as to why.
If this template is being used inside a static assert, and fails, then the above attempt to provide an error message as to why the compliation failed will not be shown, as the static assert is false error is thrown before the compile has a chance to collect any other error message.
In such a case, please temporarily rewrite the static assert into storing the result of this template into an enum, as that should then allow the compiler to generate the error message.