summaryrefslogtreecommitdiffstats
path: root/src/runner.rs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-09-06 19:17:55 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-09-06 19:52:44 +0200
commit2e357b78c76129f92c04c5888d2af35872f51c14 (patch)
treefb945782f09bc66e62340dfc9ac4995801d0222b /src/runner.rs
parentb31e12a488f6395f161cfdc2153455f8175b83b4 (diff)
downloadrebel-2e357b78c76129f92c04c5888d2af35872f51c14.tar
rebel-2e357b78c76129f92c04c5888d2af35872f51c14.zip
Introduce new contextualizable error type
The new error type is inspired by the anyhow library, but it can be serialized/desirialized and is much simpler.
Diffstat (limited to 'src/runner.rs')
-rw-r--r--src/runner.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/runner.rs b/src/runner.rs
index f36f65d..4710552 100644
--- a/src/runner.rs
+++ b/src/runner.rs
@@ -1,9 +1,9 @@
pub mod runc;
use serde::{Deserialize, Serialize};
-use std::{collections::HashMap, io};
+use std::collections::HashMap;
-use crate::types::*;
+use crate::{types::*, util::error::*};
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Task {
@@ -15,8 +15,6 @@ pub struct Task {
pub env: HashMap<String, String>,
}
-pub type Result<T> = io::Result<T>;
-
pub trait Runner {
fn run(&self, task: &Task) -> Result<OutputHash>;
}