I don't want to include the esp-hal in the library because I want it re-usable for stm32 etc. I kind of assumed (bad word I know) that this is why the embedded hal exists.
A little new to rust to apologies if this is a stupid question.
This allows your library's users to use any UART implementation that implements the Write trait. The associated type (Error) is defined in each specific UART implementation.
I know nothing about SerialPort for Linux, but if it doesn’t implement the embedded-hal traits, it won’t work—whether you use a trait object or generics.
I would use embedded-io and/or embedded-io-async instead of embedded-hal-nb for new projects. As far as I can see it's where the ecosystem is leaning towards.