Skip to main content

OpSpec

Struct OpSpec 

Source
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 str

Space-separated command path, e.g. "denoise profile", "midi quantize".

§category: Category§summary: &'static str

One line: what it does.

§about: &'static str

Longer plain-language explanation for people.

§params: Vec<ParamSpec>§inputs: Inputs§examples: Vec<Example>§presets: Vec<Preset>§auto_mix: bool

The 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: bool

Best-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: Runner

Implementations§

Source§

impl OpSpec

Source

pub fn new( name: &'static str, category: Category, summary: &'static str, runner: Runner, ) -> OpSpec

Source

pub fn transform( name: &'static str, category: Category, summary: &'static str, f: TransformFn, ) -> OpSpec

Source

pub fn custom( name: &'static str, category: Category, summary: &'static str, f: CustomFn, ) -> OpSpec

Source

pub fn about(self, a: &'static str) -> Self

Source

pub fn param(self, p: ParamSpec) -> Self

Source

pub fn params(self, ps: impl IntoIterator<Item = ParamSpec>) -> Self

Source

pub fn inputs(self, i: Inputs) -> Self

Source

pub fn example(self, cmd: &'static str, explain: &'static str) -> Self

Source

pub fn preset( self, name: &'static str, help: &'static str, values: &'static [(&'static str, &'static str)], ) -> Self

Source

pub fn no_mix(self) -> Self

Source

pub fn best_effort(self) -> Self

Source

pub fn positional(self, name: &'static str) -> Self

Positional words fill parameter name (implies no input files).

Source

pub fn alias(self, a: &'static str) -> Self

Source

pub fn id(&self) -> String

Identifier used for MCP tool names and schema files: denoise profile → denoise_profile.

Source

pub fn is_transform(&self) -> bool

Source

pub fn find_param(&self, name: &str) -> Option<&ParamSpec>

Source

pub fn effective_params(&self) -> Vec<ParamSpec>

All params including the implicit ones the executor adds (mix, preset).

Trait Implementations§

Source§

impl Clone for OpSpec

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 OpSpec

Source§

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

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

impl Serialize for OpSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
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> 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.