we don't know yet if we actually really need to box our errors because of the stack size with large error types. this is something i would like to discuss with members of the rust community
boxing makes the code a bit less readable
the new trait definition has been implemented on:
Dummy
VirtualBox
Furthermore, the init function for these 2 drivers is now fallible
new error types:
MicrovmiError
DriverError
DummyDriverError and VirtualBoxDriverError
Last thing, I will switch the error types to be #[non_exhaustive] to better understand all the implications when updating an driver error type.
This PR is a draft to implement precise error types in libmicrovmi.
It tries to improve @rageagainsthepc 's https://github.com/Wenzel/libmicrovmi/pull/152, by removing the DriverError trait and returning only clearly defined enums.
All the trait function definition have been moved to returning
Result<T, DriverError>
Contrary to what I said https://github.com/Wenzel/libmicrovmi/pull/152#issuecomment-753631651 about boxing errors, i attempted here to remove any boxing, since:the new trait definition has been implemented on:
Furthermore, the
init
function for these 2 drivers is now falliblenew error types:
MicrovmiError
DriverError
DummyDriverError
andVirtualBoxDriverError
Last thing, I will switch the error types to be
#[non_exhaustive]
to better understand all the implications when updating an driver error type.