mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2026-01-17 00:53:05 +01:00
prowocessing: add documentation of trait experiment
This commit is contained in:
parent
98f6af78be
commit
0ebfed66ed
9 changed files with 93 additions and 37 deletions
|
|
@ -1,17 +1,23 @@
|
|||
//! The trait and type representations
|
||||
|
||||
use crate::experimental::trait_based::data::io::Inputs;
|
||||
|
||||
use super::data::io::Outputs;
|
||||
|
||||
pub(crate) trait PipelineElement {
|
||||
/// return a static runner function pointer to avoid dynamic dispatch during pipeline execution - Types MUST match the signature
|
||||
fn runner(&self) -> fn(&Inputs) -> Outputs;
|
||||
fn signature(&self) -> ElementIo;
|
||||
/// return the signature of the element
|
||||
fn signature(&self) -> ElementSignature;
|
||||
}
|
||||
|
||||
pub(crate) struct ElementIo {
|
||||
/// Type signature for an element used for static checking
|
||||
pub(crate) struct ElementSignature {
|
||||
pub inputs: Vec<DataType>,
|
||||
pub outputs: Vec<DataType>,
|
||||
}
|
||||
|
||||
/// Data type enum
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
pub enum DataType {
|
||||
String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue