3 ms·
I'm not super familiar with Zig, but that appears to be the same as the rust function signature fn setData<P, B>(pins: P, bus: B, data: u8) -> B; in rust, the
by SpaceNugget 2y ago
I'm not super familiar with Zig, but that appears to be the same as the rust function signature
fn setData<P, B>(pins: P, bus: B, data: u8) -> B;
in rust, the P and B are resolved at compile time, not at runtime. If you wanted dynamic dispatch the types would be Box<dyn B>
- flohofwoe 2y agoYes, it's essentially the same, the comptime attribute on the pins arg is quite important though (in the function body that's not shown).