If you read the documentation for Result::unwrap
, you’ll note that it’s under a little section called:
impl<T, E> Result<T, E>
where E: Debug
This means the methods in that section only exist so long as the given constraints are satisfied.
The only reason unwrap
wouldn’t exist is that Error
doesn’t implement Debug
.