#[non_exhaustive]pub enum CliError {
Tokenize {
message: String,
offset: usize,
},
UnsupportedOption {
option: String,
index: usize,
scope: CliScope,
reason: String,
hint: Option<String>,
},
UnsupportedValue {
option: String,
value: String,
index: usize,
reason: String,
},
UnsupportedLayout {
token: String,
index: usize,
reason: String,
},
ConflictingOptions {
first: String,
second: String,
first_index: Option<usize>,
second_index: Option<usize>,
reason: String,
},
MissingOverwriteFlag,
NotVerified {
parsed_options: Vec<String>,
},
UnmatchedShape {
parsed_options: Vec<String>,
},
AmbiguousFilterSource {
video_streams: usize,
},
UnverifiedRuntimeProfile {
linked_avcodec: String,
linked_avformat: String,
verified: String,
},
Build(Error),
}Expand description
Error type of the CLI-compat entry points (from_cli_args,
from_cli, emit_rust_code, emit_rust_code_from_args).
The subset contract: every argv token must classify against the compatibility manifest or the whole command is rejected with one of these variants — the layer never guesses, approximates, or silently drops a token.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Tokenize
The single-string form could not be tokenized under the documented
POSIX word-splitting contract (shell constructs, unterminated quotes,
bare newlines, trailing backslash…). offset is the byte offset of
the offending character in the original string.
Fields
UnsupportedOption
A token in option position did not classify into the supported option
table. reason explains the status (unknown, documented gap, alias,
per-stream indexed variant, …); hint may name the nearest supported
spelling.
Fields
UnsupportedValue
The option is supported but this value form is not.
Fields
UnsupportedLayout
The command’s structure is outside the subset (missing/duplicated files, non-canonical ordering, trailing tokens, …). This is a subset limitation, not necessarily invalid ffmpeg syntax.
Fields
ConflictingOptions
Two options that cannot coexist (e.g. -t and -to in the same
scope, -map together with -vf). The indexes anchor each side’s
first occurrence in the argv when known.
Fields
first: StringDisplay name of the first participant; may carry a value
qualifier (-c:v copy) or be collective (-hls_*).
first_index: Option<usize>Argv index of first’s earliest participating occurrence, when
resolvable.
MissingOverwriteFlag
The command has no -y. The CLI would prompt interactively before
overwriting; this crate always opens outputs with O_CREAT|O_TRUNC and
has no prompt, so a command without -y cannot be run faithfully.
NotVerified
Every token classified, but the command shape is not in the verified set of the compatibility manifest — runtime execution is refused. The emitters still accept this command and label their output as unverified scaffolding.
Fields
UnmatchedShape
Every token classified, but the command’s option-set fingerprint matches neither a verified shape nor a documented emit-only entry. The manifest enumerates its emit surface explicitly — arbitrary combinations are rejected, not silently scaffolded.
Fields
AmbiguousFilterSource
A -vf command’s source stream is not structurally unique: the
opened input carries more or fewer than exactly one video stream.
The CLI would score-select one stream and filter it; the subset runs
the filter only when no selection is involved at all (the hard
simple-filter prerequisite), so ambiguous inputs are rejected after
probing instead of silently filtering a chosen stream.
UnverifiedRuntimeProfile
The linked FFmpeg libraries are not one of the verified runtime profiles. Raised before any I/O.
Fields
Build(Error)
The command classified and its shape is verified, but building the pipeline failed (I/O, codec availability, filter validation…). This wraps the crate’s own typed error.
Trait Implementations§
Source§impl Error for CliError
impl Error for CliError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()