pub struct MusicComponentDescriptor {Show 13 fields
pub id: Symbol,
pub label: String,
pub category: MusicComponentCategory,
pub capabilities: BTreeSet<MusicCapability>,
pub ports: Vec<MusicPortDescriptor>,
pub lanes: Vec<LaneDescriptor>,
pub params: Vec<MusicParamDescriptor>,
pub rate: RateContract,
pub determinism: DeterminismPolicy,
pub accepted_event_families: Vec<LaneKind>,
pub output_families: Vec<LaneKind>,
pub latency: Symbol,
pub implemented: bool,
}Expand description
Full description of a music component: its identity, category, capabilities, ports, lanes, parameters, and behavioral contracts.
Built fluently via MusicComponentDescriptor::new and the with_*
methods, then rendered for transport with
MusicComponentDescriptor::to_expr.
Fields§
§id: SymbolStable identifier for the component.
label: StringHuman-readable label.
category: MusicComponentCategoryThe category the component belongs to.
capabilities: BTreeSet<MusicCapability>Capabilities the component advertises.
ports: Vec<MusicPortDescriptor>Input and output ports, ordered by id.
lanes: Vec<LaneDescriptor>Lane descriptors produced by the component, in stable order.
params: Vec<MusicParamDescriptor>Configurable parameters, ordered by id.
rate: RateContractThe rate contract the component runs at.
determinism: DeterminismPolicyHow reproducible the component’s output is.
accepted_event_families: Vec<LaneKind>Lane kinds the component accepts as input.
output_families: Vec<LaneKind>Lane kinds the component emits as output.
latency: SymbolThe latency class symbol derived from the rate contract.
implemented: boolWhether the component has a working implementation.
Implementations§
Source§impl MusicComponentDescriptor
impl MusicComponentDescriptor
Sourcepub fn new(
id: Symbol,
label: impl Into<String>,
category: MusicComponentCategory,
rate: RateContract,
) -> Self
pub fn new( id: Symbol, label: impl Into<String>, category: MusicComponentCategory, rate: RateContract, ) -> Self
Creates a descriptor with default capabilities, ports, lanes, and params.
The latency symbol is derived from rate and implemented defaults to
true.
Sourcepub fn with_capability(self, capability: MusicCapability) -> Self
pub fn with_capability(self, capability: MusicCapability) -> Self
Adds a capability and returns the updated descriptor.
Sourcepub fn with_port(self, port: MusicPortDescriptor) -> Self
pub fn with_port(self, port: MusicPortDescriptor) -> Self
Adds a port and re-sorts the port list by id.
Sourcepub fn with_lane(self, lane: LaneDescriptor) -> Self
pub fn with_lane(self, lane: LaneDescriptor) -> Self
Adds a lane and restores the stable lane order.
Sourcepub fn with_param(self, param: MusicParamDescriptor) -> Self
pub fn with_param(self, param: MusicParamDescriptor) -> Self
Adds a parameter and re-sorts the parameter list by id.
Sourcepub fn with_events(self, accepted: Vec<LaneKind>, output: Vec<LaneKind>) -> Self
pub fn with_events(self, accepted: Vec<LaneKind>, output: Vec<LaneKind>) -> Self
Sets the accepted and output lane kinds, sorting and deduplicating each.
Sourcepub fn with_determinism(self, determinism: DeterminismPolicy) -> Self
pub fn with_determinism(self, determinism: DeterminismPolicy) -> Self
Sets the determinism policy and returns the updated descriptor.
Sourcepub fn with_implemented(self, implemented: bool) -> Self
pub fn with_implemented(self, implemented: bool) -> Self
Sets the implemented flag and returns the updated descriptor.
Sourcepub fn has_capability(&self, capability: MusicCapability) -> bool
pub fn has_capability(&self, capability: MusicCapability) -> bool
Returns true if the descriptor advertises capability.
Trait Implementations§
Source§impl Clone for MusicComponentDescriptor
impl Clone for MusicComponentDescriptor
Source§fn clone(&self) -> MusicComponentDescriptor
fn clone(&self) -> MusicComponentDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more