|
|
|
|
|
by rvrb
330 days ago
|
|
I've entertained further expanding this API to expose a comptime generated struct of pointers. From the Connection use-case detailed in the article, it would look something like this: pub fn getPtrs(self: Self) struct {
client: *Client,
host: []u8,
read_buffer: []u8,
write_buffer: []u8,
} {
return .{
client: self.get(.client),
host: self.get(.host),
read_buffer: self.get(.read_buffer),
write_buffer: self.get(.write_buffer),
}
}
I haven't done this because I'm not yet convinced it's worth the added complexity |
|