typestate-rs
typestate-rs copied to clipboard
[Feature Request] Support for Result<T, E> for direct bifurcation
Custom enum
s for every non-det state are somewhat limited in that they add a lot of boilerplate if someone wants to make a conversion to Result; with a lack of FromResidual
and Try
implementations for each non-det enum
, they don't have the same expressiveness for monadic chaining.
I'd like to request either of a way to automatically derive Try
and FromResidual
implementations for non-det output types, or for Result<T, E>
to just work if T
and E
are both states declared in this machine.
The current interpretation of Result<State, AnotherState>
is treated by the validator and graph generation as being "final" states.