pub struct OpSpec {Show 14 fields
pub id: String,
pub version: u32,
pub title: String,
pub family: String,
pub summary: String,
pub inputs: Vec<PortSpec>,
pub outputs: Vec<PortSpec>,
pub params: Vec<ParamSpec>,
pub margin: Margin,
pub source: OpSource,
pub finish: Option<String>,
pub effects: bool,
pub available: bool,
pub unavailable: Option<String>,
}Expand description
What an op is: everything a menu, an inspector, a pipeline check, an agent and the runtime need to know, without running it.
Fields§
§id: StringIts id, unique in its namespace (dspk:highpass, gaussian_blur, script:local_contrast).
version: u32Built-in and tool ops: a whole number from 1, bumped when the op’s behaviour changes.
Scripts and recipes are versioned by their hash (OpSpec::version_key).
title: StringIts name for people.
family: StringIts group in the Operations menu (Filter, Detect).
summary: StringOne line: what it does.
inputs: Vec<PortSpec>What it reads.
outputs: Vec<PortSpec>What it gives.
params: Vec<ParamSpec>What it is tuned with.
margin: MarginHow far it looks beyond its piece.
source: OpSourceWhere its code is.
finish: Option<String>How its pieces’ outputs are joined after the last piece (lucem’s stitch_labels); None:
in piece order.
effects: boolIt acts outside the store (uploads, drives an instrument, sends a message, deletes): never reused from an earlier run, never previewed, asks before each run.
available: boolWhether it can run here; when not, OpSpec::unavailable says why.
Why it cannot run here (“weights not downloaded”, “needs CUDA”).
Implementations§
Source§impl OpSpec
impl OpSpec
Sourcepub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
A built-in operation id titled title, with nothing declared yet.
Sourcepub fn context(self, margin: Margin) -> Self
pub fn context(self, margin: Margin) -> Self
Sets its margin (the name kitchen-pipeline used before the standard).
Marks it as unable to run here, with why.
Sourcepub fn version_key(&self) -> String
pub fn version_key(&self) -> String
What versions it for run keys: the hash of a script or a recipe, else v<version>.
Sourcepub fn input_port(&self, name: &str) -> Option<&PortSpec>
pub fn input_port(&self, name: &str) -> Option<&PortSpec>
The input name.
Sourcepub fn output_port(&self, name: &str) -> Option<&PortSpec>
pub fn output_port(&self, name: &str) -> Option<&PortSpec>
The output name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OpSpec
impl<'de> Deserialize<'de> for OpSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for OpSpec
impl JsonSchema for OpSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more