Not a big fan of #vtable
Not a big fan of #vtable
Posted Jun 29, 2025 3:20 UTC (Sun) by iabervon (subscriber, #722)In reply to: Not a big fan of #vtable by Cyberax
Parent article: How to write Rust in the kernel: part 2
I don't think the registration is more automatic than in the C code; the call to module_phy_driver is just at the top of the file instead of at the bottom.
The "impl Driver for PhyAX88772C" thing is the usual way to associate a bunch of functions that are related together in Rust with what they're used for, and the odd "#[vtable]" thing is just making the idiomatic Rust code produce what the C code needs.
