From 0705702d4a8eb54a567fa0e71ec25c028165571d Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Tue, 27 Feb 2024 13:13:18 +0100 Subject: [PATCH] experimentation: implement some basic traits for io and data types --- crates/prowocessing/src/experimental/trait_based/data/io.rs | 4 +++- crates/prowocessing/src/experimental/trait_based/data/raw.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/prowocessing/src/experimental/trait_based/data/io.rs b/crates/prowocessing/src/experimental/trait_based/data/io.rs index 59e2f28..4eb9bd3 100644 --- a/crates/prowocessing/src/experimental/trait_based/data/io.rs +++ b/crates/prowocessing/src/experimental/trait_based/data/io.rs @@ -5,6 +5,7 @@ use std::{borrow::ToOwned, convert::Into}; use super::raw::Data; /// Newtype struct with borrowed types for pipeline/element inputs, so that doesn't force a move or clone +#[derive(PartialEq, Eq, Debug)] pub struct Inputs<'a>(pub Vec<&'a Data>); impl<'a> From> for Inputs<'a> { @@ -26,7 +27,8 @@ impl<'a> From<&'a Outputs> for Inputs<'a> { } /// Used for pipeline/element outputs -pub struct Outputs(Vec); +#[derive(PartialEq, Eq, Debug)] +pub struct Outputs(pub Vec); impl Outputs { /// consume self and return inner value(s) diff --git a/crates/prowocessing/src/experimental/trait_based/data/raw.rs b/crates/prowocessing/src/experimental/trait_based/data/raw.rs index 502bb91..6640e64 100644 --- a/crates/prowocessing/src/experimental/trait_based/data/raw.rs +++ b/crates/prowocessing/src/experimental/trait_based/data/raw.rs @@ -1,7 +1,7 @@ //! Dynamic data storage and transfer types for use in [`io`] // Dynamic data type -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum Data { String(String), Int(i32),