Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions compio-executor/src/join_handle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{
error::Error,
fmt::Display,
io,
marker::PhantomData,
mem::ManuallyDrop,
panic::resume_unwind,
Expand Down Expand Up @@ -104,6 +105,15 @@ impl Display for JoinError {

impl Error for JoinError {}

impl From<JoinError> for io::Error {
fn from(e: JoinError) -> Self {
match e {
JoinError::Cancelled => io::Error::other("Task was cancelled"),
JoinError::Panicked(_) => io::Error::other("Task has panicked"),
}
}
}

impl<T> Future for JoinHandle<T> {
type Output = Result<T, JoinError>;

Expand Down
Loading