Assuming you mean std::io::Read::read_exact(), that returns io::Result<()>, i.e., the success value doesn't contain any information (and you can always make up a () out of thin air). What do you mean by "available"? It really seems to make no sense.
I'm afraid not, as Read::read implementations must guarantee that there are no bytes read if an error is returned. From the docs:
If this function encounters any form of I/O or other error, an error variant will be returned. If an error is returned then it must be guaranteed that no bytes were read.
One similar case from the standard library is LockResult which is Result<Guard, PoisonError<Guard>>, i.e. the error contains the same data as the success type.
Or binary_search which just returns Result<usize, usize>.
It seems to me that it’s the error type’s responsibility to return possible partial etc data when it makes sense. No need for a three-way Result when you can simply compose
enum Error {
GotSomeData(Data),
SomeOtherError(…)
}
type Res = Result<Data, Error>;