summaryrefslogtreecommitdiffstats
path: root/tokio/src/executor/task/error.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-11-05 19:12:30 -0800
committerGitHub <noreply@github.com>2019-11-05 19:12:30 -0800
commitd5c1119c881c9a8b511aa9000fd26b9bda014256 (patch)
tree72e2ca6b655f29e948a91ba4573a95350cb241e0 /tokio/src/executor/task/error.rs
parenta6253ed05a1e0d14bc64915f5937c29092df9497 (diff)
runtime: combine `executor` and `runtime` mods (#1734)
Now, all types are under `runtime`. `executor::util` is moved to a top level `util` module.
Diffstat (limited to 'tokio/src/executor/task/error.rs')
-rw-r--r--tokio/src/executor/task/error.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/tokio/src/executor/task/error.rs b/tokio/src/executor/task/error.rs
deleted file mode 100644
index c87b98bb..00000000
--- a/tokio/src/executor/task/error.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-use std::any::Any;
-use std::fmt;
-
-/// Task failed to execute to completion.
-pub struct JoinError {
- repr: Repr,
-}
-
-enum Repr {
- Cancelled,
- Panic(Box<dyn Any + Send + 'static>),
-}
-
-impl JoinError {
- /// Create a new `cancelled` error
- pub fn cancelled() -> JoinError {
- JoinError {
- repr: Repr::Cancelled,
- }
- }
-
- /// Create a new `panic` error
- pub fn panic(err: Box<dyn Any + Send + 'static>) -> JoinError {
- JoinError {
- repr: Repr::Panic(err),
- }
- }
-}
-
-impl fmt::Display for JoinError {
- fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
- match &self.repr {
- Repr::Cancelled => write!(fmt, "cancelled"),
- Repr::Panic(_) => write!(fmt, "panic"),
- }
- }
-}
-
-impl fmt::Debug for JoinError {
- fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
- match &self.repr {
- Repr::Cancelled => write!(fmt, "JoinError::Cancelled"),
- Repr::Panic(_) => write!(fmt, "JoinError::Panic(...)"),
- }
- }
-}
-
-impl std::error::Error for JoinError {}