I posit that WouldBlock should be an enum which contains the Result. So the type would be:
enum Async<R> {
Done<R>, // Done with Result
WouldBlock,
}
This also removes the funny buisness of using ! as the type of the Other error. If it is an operation that cannot fail, then R is just the Value (as it should be).
Note that this is exactly the same API as the futures Async data type.
pub enum Async<T> {
Ready(T),
NotReady,
}
I argue that we should just use futures under the hood for ALL asynchronous core types, and that can easily be converted to the other APIs. This is, in fact, the entire point of futures. I think the nb library serves no purpose then.
The futures api is pretty dang minimal with default-features = false selected. There may be space for us to implement something on top of that minimal interface for use in embedded. That could be the usefulness of this library.
I posit that
WouldBlockshould be an enum which contains theResult. So the type would be:This also removes the funny buisness of using
!as the type of theOthererror. If it is an operation that cannot fail, thenRis just the Value (as it should be).Note that this is exactly the same API as the futures
Asyncdata type.I argue that we should just use
futuresunder the hood for ALL asynchronous core types, and that can easily be converted to the other APIs. This is, in fact, the entire point of futures. I think thenblibrary serves no purpose then.The futures api is pretty dang minimal with
default-features = falseselected. There may be space for us to implement something on top of that minimal interface for use in embedded. That could be the usefulness of this library.