There should be a drmem-driver-api crate that driver writers can use to make it easier to write them. Driver is the fundamental trait and has the 3 API methods to implement. But we could define other supertraits that guide the developer to create a proper, standardized driver. For instance, there could be a Light state that defines the register_devices() method. In this case, it would create a boolean state device. A DimmableLight could be a supertrait and add a brightness device. ColorLight enhances it further by adding a color device, etc.
This enforces a standard set of device endpoints for classes of hardware.
There should be a
drmem-driver-apicrate that driver writers can use to make it easier to write them.Driveris the fundamental trait and has the 3 API methods to implement. But we could define other supertraits that guide the developer to create a proper, standardized driver. For instance, there could be aLightstate that defines theregister_devices()method. In this case, it would create a booleanstatedevice. ADimmableLightcould be a supertrait and add abrightnessdevice.ColorLightenhances it further by adding acolordevice, etc.This enforces a standard set of device endpoints for classes of hardware.