tricorder 0.10.0

Automation, the KISS way, no YAML involved.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::prelude::{Host, Result};
use serde_json::Value;

/// Describe the result of a `Task` execution
pub type TaskResult = Result<Value>;

/// Generic Task trait
pub trait GenericTask<Data: Send>: Send + Sync {
    /// Called to prepare contextual data for the task execution
    fn prepare(&self, host: Host) -> Result<Data>;

    /// Called to execute the task
    fn apply(&self, host: Host, data: Data) -> TaskResult;
}