weirdnet-pipelines 0.1.0

Weirdnet pipelines: graphs (DAGs) of application-defined sources, steps and sinks; parsing, validation, ordering, a runner that reaches the application through a host trait, and helpers for JSON column frames.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// A graph, node, edge or frame input that is not valid.
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum PipelineError {
    #[error("invalid {what}: {msg}")]
    Invalid { what: &'static str, msg: String },
}

impl PipelineError {
    pub fn invalid(what: &'static str, msg: impl Into<String>) -> Self {
        PipelineError::Invalid { what, msg: msg.into() }
    }
}

pub type Result<T> = std::result::Result<T, PipelineError>;

pub(crate) fn invalid(msg: impl Into<String>) -> PipelineError {
    PipelineError::invalid("pipeline", msg)
}