Skip to main content

TransformMiddleware

Trait TransformMiddleware 

Source
pub trait TransformMiddleware: Send + Sync {
    // Required method
    fn transform<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        sources: &'life1 IndexMap<String, DataTable>,
        spec: &'life2 TransformSpec,
        context: &'life3 TransformContext,
    ) -> Pin<Box<dyn Future<Output = Result<TransformResult, ChartError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Transform middleware — processes data between fetch and render.

Receives a map of named source tables (insertion-ordered, matching the YAML data: map order) and produces a single result table that the renderer consumes. Implementations are expected to:

  • Register every entry in sources so user-authored SQL can reference any source by its declared name.
  • For single-entry maps with a non-"source" key, additionally register the sole table under the alias "source" so legacy SQL referencing FROM source keeps working. Multi-entry maps are NOT aliased — the caller’s SQL must use the explicit source names.

Required Methods§

Source

fn transform<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sources: &'life1 IndexMap<String, DataTable>, spec: &'life2 TransformSpec, context: &'life3 TransformContext, ) -> Pin<Box<dyn Future<Output = Result<TransformResult, ChartError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Transform input data according to the spec.

Implementors§