Skip to main content

InMemoryParameterHost

Struct InMemoryParameterHost 

Source
pub struct InMemoryParameterHost { /* private fields */ }
Expand description

In-memory host for storing parameter values and optional meter data.

This is intended for development tools (like the CLI dev server) and tests.

Implementations§

Source§

impl InMemoryParameterHost

Source

pub fn new(parameters: Vec<ParameterInfo>) -> Self

Create a new in-memory host with the given parameter metadata.

Source

pub fn with_meter_provider( parameters: Vec<ParameterInfo>, meter_provider: Arc<dyn MeterProvider>, ) -> Self

Create a new in-memory host with a meter provider.

Source

pub fn replace_parameters( &self, new_params: Vec<ParameterInfo>, ) -> Result<(), String>

Replace all parameters with new metadata from a fresh build.

This method is used during hot-reload to update parameter definitions while preserving existing parameter values where possible. Parameters with matching IDs retain their current values; new parameters get their default values; removed parameters are dropped.

§Thread Safety

This method acquires write locks on both the parameters and values maps. If a lock is poisoned (from a previous panic), it recovers gracefully by clearing the poisoned lock and continuing.

§Errors

Returns an error if both lock recovery attempts fail.

Trait Implementations§

Source§

impl ParameterHost for InMemoryParameterHost

Source§

fn get_parameter(&self, id: &str) -> Option<ParameterInfo>

Get information about a single parameter. Read more
Source§

fn set_parameter(&self, id: &str, value: f32) -> Result<(), BridgeError>

Set a parameter value. Read more
Source§

fn get_all_parameters(&self) -> Vec<ParameterInfo>

Get all parameters with their current values and metadata. Read more
Source§

fn get_meter_frame(&self) -> Option<MeterFrame>

Get the latest meter frame for UI visualization. Read more
Source§

fn request_resize(&self, _width: u32, _height: u32) -> bool

Request resize of the editor window. Read more
Source§

fn get_audio_status(&self) -> Option<AudioRuntimeStatus>

Get the current audio runtime status for browser/dev hosts. Read more

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