Skip to main content

optimize_payload

Function optimize_payload 

Source
pub fn optimize_payload(
    body: &str,
    config: &ShiftConfig,
) -> Option<(String, Report)>
Expand description

Run the SHIFT pipeline on a JSON payload.

Returns the transformed JSON string and report, or None if no optimization was needed or an error occurred (fail-safe: passthrough on error).

This function is synchronous (CPU-bound image operations) and MUST be called from tokio::task::spawn_blocking.