pub struct ParamMetadata {
pub name: String,
pub description: String,
pub typ: ParamType,
pub default: ParamValue,
pub range: ParamRange,
pub unit: Option<String>,
pub choices: Option<Vec<(String, f32)>>,
}Expand description
Metadata about a parameter
Fields§
§name: StringParameter name (must be a valid ParameterId)
description: StringHuman-readable description
typ: ParamTypeParameter type
default: ParamValueDefault value
range: ParamRangeValue range (if applicable)
unit: Option<String>Unit of measurement (e.g., “Hz”, “dB”, “ms”)
choices: Option<Vec<(String, f32)>>Possible choices (for Choice parameters)
Implementations§
Source§impl ParamMetadata
impl ParamMetadata
Sourcepub fn new(
name: impl Into<String>,
typ: ParamType,
default: ParamValue,
) -> ParamMetadata
pub fn new( name: impl Into<String>, typ: ParamType, default: ParamValue, ) -> ParamMetadata
Create new parameter metadata
Sourcepub fn with_description(self, description: impl Into<String>) -> ParamMetadata
pub fn with_description(self, description: impl Into<String>) -> ParamMetadata
Set description
Sourcepub fn with_range(self, min: f32, max: f32, step: f32) -> ParamMetadata
pub fn with_range(self, min: f32, max: f32, step: f32) -> ParamMetadata
Set range
Sourcepub fn with_unit(self, unit: impl Into<String>) -> ParamMetadata
pub fn with_unit(self, unit: impl Into<String>) -> ParamMetadata
Set unit
Sourcepub fn with_choices(self, choices: Vec<(String, f32)>) -> ParamMetadata
pub fn with_choices(self, choices: Vec<(String, f32)>) -> ParamMetadata
Set choices
Trait Implementations§
Source§impl Clone for ParamMetadata
impl Clone for ParamMetadata
Source§fn clone(&self) -> ParamMetadata
fn clone(&self) -> ParamMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParamMetadata
impl Debug for ParamMetadata
Source§impl PartialEq for ParamMetadata
impl PartialEq for ParamMetadata
Source§fn eq(&self, other: &ParamMetadata) -> bool
fn eq(&self, other: &ParamMetadata) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ParamMetadata
Auto Trait Implementations§
impl Freeze for ParamMetadata
impl RefUnwindSafe for ParamMetadata
impl Send for ParamMetadata
impl Sync for ParamMetadata
impl Unpin for ParamMetadata
impl UnsafeUnpin for ParamMetadata
impl UnwindSafe for ParamMetadata
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
Mutably borrows from an owned value. Read more