I currently have something like that, but I would like to basically allow for custom arguments, and then when dispatching I would try to give them what they are asking for or fail.
Basically something like axum in rust did if you are familiar with that framework.
pub const dispatcher: std.StaticStringMap(*const fn (
self: *UserContext,
arena: std.mem.Allocator,
rest: std.StringHashMap([]const u8),
) anyerror!void
) = .initComptime(.{
.{ "addon", handleAddon },
.{ "init", inits.handler },
.{ "emo", emotion.handler },
For example handleAddon should only have 1 argument - *UserContext