AUDIO
Source snapshot · 11 November 2026

API reference / ravet_plugin::product::Parameter

Struct Parameter 

pub struct Parameter<'a> { /* private fields */ }
Expand description

One parameter, identified permanently by its key.

The key is a stable identifier of up to 64 bytes: an ASCII letter or underscore followed by letters, digits or underscores. Formats use it as the LV2 symbol and the editor protocol address. The numeric host ID is either supplied with Parameter::with_id, to keep sessions from an earlier product loading, or derived from the key by derive_parameter_id. It never depends on declaration order.

Implementations§

§

impl<'a> Parameter<'a>

pub const fn new( key: &'a str, name: &'a str, range: ParameterRange, default: f32, ) -> Self

A parameter over an explicit range. Validation happens in Product::resolve.

pub const fn linear( key: &'a str, name: &'a str, minimum: f32, maximum: f32, default: f32, ) -> Self

A continuous linear parameter.

§Panics

If the range is invalid (nonfinite, or minimum not below maximum). In a const product description, as recommended, this is a compile error rather than a run-time panic.

pub const fn logarithmic( key: &'a str, name: &'a str, minimum: f32, maximum: f32, default: f32, ) -> Self

A continuous logarithmic parameter with strictly positive bounds.

§Panics

If the range is invalid; a compile error in a const description.

pub const fn stepped( key: &'a str, name: &'a str, minimum: f32, maximum: f32, steps: u16, default: f32, ) -> Self

A stepped parameter with steps + 1 equally spaced values.

§Panics

If the range or step count is invalid; a compile error in a const description.

pub const fn toggle(key: &'a str, name: &'a str, default: bool) -> Self

An on/off parameter with values 0 and 1.

pub const fn bypass(key: &'a str, name: &'a str) -> Self

The host bypass toggle, off by default.

pub const fn with_id(self, id: u32) -> Self

Use an explicit permanent host ID instead of the derived one.

pub const fn with_unit(self, unit: &'a str) -> Self

Display unit, for example “dB”.

pub const fn not_automatable(self) -> Self

Hosts may not record automation for this parameter.

pub const fn hidden(self) -> Self

Hidden from host-generated parameter lists.

pub const fn read_only(self) -> Self

Written by the processor only, for example a meter or status value.

pub fn key(&self) -> &'a str

pub fn name(&self) -> &'a str

pub fn unit(&self) -> &'a str

pub fn range(&self) -> ParameterRange

pub fn default(&self) -> f32

pub fn role(&self) -> ParameterRole

pub fn is_automatable(&self) -> bool

pub fn is_hidden(&self) -> bool

pub fn is_read_only(&self) -> bool

pub fn explicit_id(&self) -> Option<ParameterId>

The explicit ID, if one was supplied.

pub fn id(&self) -> ParameterId

The host ID: explicit, or derived from the key.

Trait Implementations§

§

impl<'a> Clone for Parameter<'a>

§

fn clone(&self) -> Parameter<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'a> Copy for Parameter<'a>

§

impl<'a> Debug for Parameter<'a>

§

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

Formats the value using the given formatter. Read more
§

impl<'a> PartialEq for Parameter<'a>

§

fn eq(&self, other: &Parameter<'a>) -> bool

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

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

Inequality operator !=. Read more
§

impl<'a> StructuralPartialEq for Parameter<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Parameter<'a>

§

impl<'a> RefUnwindSafe for Parameter<'a>

§

impl<'a> Send for Parameter<'a>

§

impl<'a> Sync for Parameter<'a>

§

impl<'a> Unpin for Parameter<'a>

§

impl<'a> UnsafeUnpin for Parameter<'a>

§

impl<'a> UnwindSafe for Parameter<'a>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.