Skip to main content

CliError

Enum CliError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§message: String

What is wrong at offset (e.g. unterminated single quote).

§offset: usize

Byte offset of the offending character in the original command string.

§

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

§option: String

The rejected option token, exactly as typed.

§index: usize

Zero-based index of the option token in the parsed argv.

§scope: CliScope

Where in the command the token was found.

§reason: String

Why the spelling is outside the subset (unknown, documented gap, alias, per-stream indexed variant, …).

§hint: Option<String>

Nearest supported spelling, when one is close enough to suggest.

§

UnsupportedValue

The option is supported but this value form is not.

Fields

§option: String

The option whose value failed its grammar.

§value: String

The rejected value token, verbatim.

§index: usize

Zero-based argv index of the VALUE token (not of the option that introduced it).

§reason: String

The value grammar the token violated.

§

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

§token: String

Token at which the violation was detected; empty when the command ended before a required token (missing input or output).

§index: usize

Zero-based argv index of token; the total token count when the command ended early.

§reason: String

The layout rule the command violated.

§

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: String

Display name of the first participant; may carry a value qualifier (-c:v copy) or be collective (-hls_*).

§second: String

Display name of the second participant (same conventions as first).

§first_index: Option<usize>

Argv index of first’s earliest participating occurrence, when resolvable.

§second_index: Option<usize>

Argv index of second’s earliest participating occurrence, when resolvable.

§reason: String

Why the pair cannot coexist in one command.

§

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

§parsed_options: Vec<String>

The command’s manifest fingerprint: sorted, scope-qualified canonical option keys (e.g. in:-ss, out:-c:v).

§

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

§parsed_options: Vec<String>

The command’s manifest fingerprint: sorted, scope-qualified canonical option keys (e.g. in:-ss, out:-c:v).

§

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.

Fields

§video_streams: usize

Video-stream count of the opened input (anything but exactly 1).

§

UnverifiedRuntimeProfile

The linked FFmpeg libraries are not one of the verified runtime profiles. Raised before any I/O.

Fields

§linked_avcodec: String

major.minor of the linked libavcodec.

§linked_avformat: String

major.minor of the linked libavformat.

§verified: String

Rendered list of the verified profiles (name plus the libavcodec/libavformat pairs each one requires).

§

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.

Tuple Fields

§0: Error

The crate’s typed error from context building.

Trait Implementations§

Source§

impl Debug for CliError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for CliError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for CliError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for CliError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,