Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Introduce TransportError type #374
It is not very convenient to use
Introduce a new type TransportError which will represent errors for transport callbacks. It is an enumeration which can hold three kinds of errors:
Unfortunately, it's not possible to implement
However, we do implement all other Error requirements like
Note that the error itself is a struct which wraps an enumeration. This allows us to not expose enumeration variants to the user.
Also note the additional
Update the SecureSessionTransport trait to use the new type.
Update usage in tests. Note how
Yeah, Rust has amazing ergonomics at times. While you have to spell out all these
However, this keeps all the benefits of strong static typing (you always know the precise type of the error, unless you explicitly erase it with something like