Skip to main content

Module route

Module route 

Source
Expand description

Pure routing layer: decide which execution path a parsed ConvertPlan takes, without performing any conversion work.

crate::run used to make these decisions inline, which meant the media-kind × media-kind dispatch matrix could only be exercised by actually running conversions. Extracting the decision into decide keeps run a thin dispatcher and lets tests pin every cell of the matrix with nothing but a ConvertPlan.

Precedence (first match wins), mirroring the historical inline order:

  1. -ping — header-only inspection, no decode.
  2. --probe — structural inspection, no output write.
  3. PDF input — Scene-aware side-channel (pdf_runner).
  4. 3D-asset input (mesh3d feature) — same-class re-encode, 3D→raster render, or a typed pairing error.
  5. .ico output (ico feature) — multi-resolution icon writer.
  6. Everything else — the regular oxideav-pipeline path.

The precedence order is observable behaviour: in.pdf out.ico routes to the PDF side-channel (which then rejects .ico as an unsupported output class), NOT to the ICO writer, because input classification outranks output classification.

Enums§

Route
One cell of the routing matrix — the execution path crate::run dispatches to for a given plan.

Functions§

decide
Classify a plan into its execution Route, or return the typed error for unroutable pairings (3D input × non-3D/non-raster output, %d template on a single-document 3D scene).
decide_with
decide with the caller’s registries: a 3D input paired with any extension ctx has a still-image encoder for (tiff, gif, qoi, …) routes to Route::Mesh3dToRaster instead of the pairing error.