Closed sosthene-nitrokey closed 1 year ago
Yeah, this should really be a TryFrom
. If we make changes to the request and reply types, it could make sense to have a trait that defines the request and reply types for a syscall.
I’ll prepare a PR. Will also be useful for API extensions too because I’m using TryFrom
there, so I had to duplicate FutureResult
. Edit: Nevermind, I still have to do the serialization and deserialization.
I'm making a PR that adds a trait that does bindings between the request and reply types.
https://github.com/trussed-dev/trussed/blob/main/src/api/macros.rs#L96
This
unsafe
is not sound and this impl is part of the public API. I think we could replace it with apanic!
, since it is only used byPollClient::request
. To reduce the risk of panicking I would instead useTryFrom
.