Skip to main content

MusicComponentDescriptor

Struct MusicComponentDescriptor 

Source
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: Symbol

Stable identifier for the component.

§label: String

Human-readable label.

§category: MusicComponentCategory

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

The rate contract the component runs at.

§determinism: DeterminismPolicy

How 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: Symbol

The latency class symbol derived from the rate contract.

§implemented: bool

Whether the component has a working implementation.

Implementations§

Source§

impl MusicComponentDescriptor

Source

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.

Source

pub fn with_capability(self, capability: MusicCapability) -> Self

Adds a capability and returns the updated descriptor.

Source

pub fn with_port(self, port: MusicPortDescriptor) -> Self

Adds a port and re-sorts the port list by id.

Source

pub fn with_lane(self, lane: LaneDescriptor) -> Self

Adds a lane and restores the stable lane order.

Source

pub fn with_param(self, param: MusicParamDescriptor) -> Self

Adds a parameter and re-sorts the parameter list by id.

Source

pub fn with_events(self, accepted: Vec<LaneKind>, output: Vec<LaneKind>) -> Self

Sets the accepted and output lane kinds, sorting and deduplicating each.

Source

pub fn with_determinism(self, determinism: DeterminismPolicy) -> Self

Sets the determinism policy and returns the updated descriptor.

Source

pub fn with_implemented(self, implemented: bool) -> Self

Sets the implemented flag and returns the updated descriptor.

Source

pub fn has_capability(&self, capability: MusicCapability) -> bool

Returns true if the descriptor advertises capability.

Source

pub fn to_expr(&self) -> Expr

Renders the full descriptor as an Expr map for wire transport.

Trait Implementations§

Source§

impl Clone for MusicComponentDescriptor

Source§

fn clone(&self) -> MusicComponentDescriptor

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 MusicComponentDescriptor

Source§

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

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

impl Eq for MusicComponentDescriptor

Source§

impl PartialEq for MusicComponentDescriptor

Source§

fn eq(&self, other: &MusicComponentDescriptor) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MusicComponentDescriptor

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