hopefully a quick one: if I have a method on a struct, how can I pass that to another function as an argument? Specifically in relation to httpz, I have a method fn xyz(self: @This(), _: *httpz.Request, res: *httpz.Response) !void that I want to pass to router.get as the handler, but Im getting error: no field named 'xyz' in struct 'main.Server'. I want to pass the method because I hold a handle in @This() to something that I need in the http handler
#Pass struct method as argument to function
1 messages · Page 1 of 1 (latest)