Fills the struct with information.
Aliases to all interface methods (Compile-time).
Aliases for each method (Compile-time). This tuple has the same number of entries as methods.
The name of each interface member (Runtime).
Number of methods (Runtime).
Static information about each route (Compile-time).
Information about each route (Runtime). This array has the same number of fields as RouteFunctions.
import std.typecons : tuple; import std.traits; @("api") interface IAPI { @("value") string hello(int number); @noAutoImplement() void disabledMethod(); } alias Info = InterfaceInfo!IAPI; // Compile-time infos auto info = new Info(0); // Runtime infos // Runtime infos assert(info.memberNames.length == 2); assert(info.memberNames[0] == "hello"); assert(info.memberNames[1] == "disabledMethod"); assert(info.methodCount == 1 ); assert(info.methods.length == 1); assert(info.methods[0].name == "hello"); assert(info.methods[0].parameters.length == 1); assert(info.methods[0].parameters[0].name == "number"); // Compile time static assert(Info.Members.length == 2); static assert(Info.Methods.length == 1); static assert(Info.staticMethods.length == 1); static assert(Info.staticMethods[0].name == "hello"); static assert(Info.staticMethods[0].parameters.length == 1); static assert(Info.staticMethods[0].parameters[0].name == "number");
Provides all necessary informations to implement an automated interface or class. inspired by /web/vibe/web/internal/rest/common.d