In the standard library I keep seeing things like std.ArrayList(u8) and definitions of the form fn Queue(comptime T: type) type { return struct { ... }; }. I want a fixed-capacity ring buffer for an embedded project, one instance holding u8 UART bytes and another holding 16-bit ADC samples, without any heap allocation.
How does a function that returns a type actually work, is Queue(u8) evaluated every time I write it, and when should I use anytype instead?




