pub struct OpSpec {Show 13 fields
pub name: &'static str,
pub category: Category,
pub summary: &'static str,
pub about: &'static str,
pub params: Vec<ParamSpec>,
pub inputs: Inputs,
pub examples: Vec<Example>,
pub presets: Vec<Preset>,
pub auto_mix: bool,
pub best_effort: bool,
pub aliases: Vec<&'static str>,
pub positional: Option<&'static str>,
pub runner: Runner,
}Expand description
The definition of one command.
Fields§
§name: &'static strSpace-separated command path, e.g. "denoise profile", "midi quantize".
category: Category§summary: &'static strOne line: what it does.
about: &'static strLonger plain-language explanation for people.
params: Vec<ParamSpec>§inputs: Inputs§examples: Vec<Example>§presets: Vec<Preset>§auto_mix: boolThe executor adds a generic --mix dry/wet when the op is a Transform that keeps
the length and channel count, unless the op declares its own mix param.
best_effort: boolBest-effort quality tier (labelled in docs and results).
aliases: Vec<&'static str>Other names the command answers to.
positional: Option<&'static str>When set, positional words on the command line fill this parameter instead of
being input files (ferraus schema separate, ferraus models pull <name>).
runner: RunnerImplementations§
Source§impl OpSpec
impl OpSpec
pub fn new( name: &'static str, category: Category, summary: &'static str, runner: Runner, ) -> OpSpec
pub fn transform( name: &'static str, category: Category, summary: &'static str, f: TransformFn, ) -> OpSpec
pub fn custom( name: &'static str, category: Category, summary: &'static str, f: CustomFn, ) -> OpSpec
pub fn about(self, a: &'static str) -> Self
pub fn param(self, p: ParamSpec) -> Self
pub fn params(self, ps: impl IntoIterator<Item = ParamSpec>) -> Self
pub fn inputs(self, i: Inputs) -> Self
pub fn example(self, cmd: &'static str, explain: &'static str) -> Self
pub fn preset( self, name: &'static str, help: &'static str, values: &'static [(&'static str, &'static str)], ) -> Self
pub fn no_mix(self) -> Self
pub fn best_effort(self) -> Self
Sourcepub fn positional(self, name: &'static str) -> Self
pub fn positional(self, name: &'static str) -> Self
Positional words fill parameter name (implies no input files).
pub fn alias(self, a: &'static str) -> Self
Sourcepub fn id(&self) -> String
pub fn id(&self) -> String
Identifier used for MCP tool names and schema files: denoise profile → denoise_profile.
pub fn is_transform(&self) -> bool
pub fn find_param(&self, name: &str) -> Option<&ParamSpec>
Sourcepub fn effective_params(&self) -> Vec<ParamSpec>
pub fn effective_params(&self) -> Vec<ParamSpec>
All params including the implicit ones the executor adds (mix, preset).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpSpec
impl RefUnwindSafe for OpSpec
impl Send for OpSpec
impl Sync for OpSpec
impl Unpin for OpSpec
impl UnsafeUnpin for OpSpec
impl UnwindSafe for OpSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more