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
sourcesso 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 referencingFROM sourcekeeps working. Multi-entry maps are NOT aliased — the caller’s SQL must use the explicit source names.
Required Methods§
Sourcefn 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,
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.