pipeflow 0.0.4

A lightweight, configuration-driven data pipeline framework
Documentation
//! Transform trait and implementations
//!
//! Transform nodes process messages from upstream and emit to downstream.

pub mod compute;
pub mod filter;
pub mod hash;
pub(crate) mod json_path;
pub mod pipeline;
pub mod remap;
pub mod step;
pub mod value;
pub mod window;

use async_trait::async_trait;

use crate::common::message::Message;
use crate::error::Result;

/// Transform processes messages from upstream and emits to downstream
#[async_trait]
pub trait Transform: Send + Sync {
    /// Unique node identifier
    fn id(&self) -> &str;

    /// Process a single message
    ///
    /// Returns:
    /// - `Ok(vec![...])` - emit transformed messages (can be 0, 1, or more)
    /// - `Err(e)` - transform error (currently logged; DLQ routing is planned but not implemented)
    async fn process(&self, msg: Message) -> Result<Vec<Message>>;
}