We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
std::io::Error
JoinError
1 parent b06ff34 commit e7fd1aeCopy full SHA for e7fd1ae
1 file changed
compio-executor/src/join_handle.rs
@@ -1,6 +1,7 @@
1
use std::{
2
error::Error,
3
fmt::Display,
4
+ io,
5
marker::PhantomData,
6
mem::ManuallyDrop,
7
panic::resume_unwind,
@@ -104,6 +105,15 @@ impl Display for JoinError {
104
105
106
impl Error for JoinError {}
107
108
+impl From<JoinError> for io::Error {
109
+ fn from(e: JoinError) -> Self {
110
+ match e {
111
+ JoinError::Cancelled => io::Error::other("Task was cancelled"),
112
+ JoinError::Panicked(_) => io::Error::other("Task has panicked"),
113
+ }
114
115
+}
116
+
117
impl<T> Future for JoinHandle<T> {
118
type Output = Result<T, JoinError>;
119
0 commit comments