Skip to main content

ConvertPlan

Struct ConvertPlan 

Source
#[non_exhaustive]
pub struct ConvertPlan { pub input: String, pub input_pages: Option<PageSelector>, pub ops: Vec<Op>, pub output: String, pub output_template: Option<PrintfTemplate>, pub help: bool, pub ping: bool, pub probe: bool, pub probe_json: bool, pub probe_watch: bool, pub mesh3d_options: Mesh3DOptions, }
Expand description

The parsed result of one oxideav convert invocation.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§input: String

Input URI WITH any [N]/[N-M] page selector stripped. Currently exactly one — IM’s multi-input stack is a documented follow-up.

§input_pages: Option<PageSelector>

Page selector parsed from the input arg’s […] suffix, when present. None means “all pages” for Scene-shaped inputs and is ignored for raster inputs.

§ops: Vec<Op>

Chain of operations in source order.

§output: String

Output path (literal). Empty string when ping is on and the caller omitted it.

§output_template: Option<PrintfTemplate>

Parsed printf template if output contains %[0-9]*d. Used by the convert runner to fan out per-page when the input is a Scene-shaped source (PDF) and the output codec doesn’t natively accept Scenes.

§help: bool

--help / -help mode — print the usage synopsis (generated from the parser’s own flag table, so it cannot drift) to stdout and do nothing else. Outranks every other mode; positional arguments become optional and are not validated.

§ping: bool

-ping mode — read only the headers, print one IM-format line per “image” (page / video stream) to stdout, skip pixel decode and any output write. Output positional becomes optional.

§probe: bool

--probe mode — decode the input far enough to extract structural metadata (page count, mesh count, sample rate, …), print a compact summary to stdout, and skip any output write. Mutually exclusive with an output positional: --probe in.gltf is the supported shape; --probe in.gltf out.obj errors at the parser. The summary defaults to a pretty-printed key: value block; pair with probe_json for a single-line JSON object instead.

§probe_json: bool

--json mode — emit machine-readable JSON instead of the pretty-printed summary. Today this only applies to --probe; passing --json without --probe is a parser-level error since there’s nothing else for it to format.

§probe_watch: bool

--watch mode (paired with --probe) — re-run the probe whenever the input file’s mtime changes. Each re-probe emits a fresh summary; in JSON mode each summary is on its own line so convert --probe --json --watch in.png | jq is well-formed JSON-lines. Polls the input mtime once per second; the loop runs forever and exits only on Ctrl+C / signal. Useful for live-monitoring a render-in-progress.

§mesh3d_options: Mesh3DOptions

Per-format encoder options for the 3D side-channel (-stl-format, -gltf-format, …). Default = “use the registry’s default factory for each format” so callers who don’t pass any of these flags see no behaviour change.

Implementations§

Source§

impl ConvertPlan

Source

pub fn new(input: impl Into<String>, output: impl Into<String>) -> Self

A plain conversion of input to output: no ops, no page selector or output template, no mode switch, default 3D options. The arg parser produces the same shape through args::parse; use the with_* setters for the rest.

Source

pub fn with_ops(self, ops: Vec<Op>) -> Self

Operation chain in source order.

Source

pub fn with_input_pages(self, v: impl Into<Option<PageSelector>>) -> Self

[N] / [N-M] / [A,B,…] page selector on the input.

Source

pub fn with_output_template(self, v: impl Into<Option<PrintfTemplate>>) -> Self

Parsed %d template of output (the caller keeps the two in sync, as args::parse does).

Source

pub fn with_help(self, v: bool) -> Self

--help mode.

Source

pub fn with_ping(self, v: bool) -> Self

-ping mode.

Source

pub fn with_probe(self, v: bool) -> Self

--probe mode.

Source

pub fn with_probe_json(self, v: bool) -> Self

--json (with --probe).

Source

pub fn with_probe_watch(self, v: bool) -> Self

--watch (with --probe).

Source

pub fn with_mesh3d_options(self, v: Mesh3DOptions) -> Self

3D side-channel options.

Trait Implementations§

Source§

impl Clone for ConvertPlan

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConvertPlan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V