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
impl InMemoryParameterHost
Sourcepub fn new(parameters: Vec<ParameterInfo>) -> Self
pub fn new(parameters: Vec<ParameterInfo>) -> Self
Create a new in-memory host with the given parameter metadata.
Sourcepub fn with_meter_provider(
parameters: Vec<ParameterInfo>,
meter_provider: Arc<dyn MeterProvider>,
) -> Self
pub fn with_meter_provider( parameters: Vec<ParameterInfo>, meter_provider: Arc<dyn MeterProvider>, ) -> Self
Create a new in-memory host with a meter provider.
Sourcepub fn replace_parameters(
&self,
new_params: Vec<ParameterInfo>,
) -> Result<(), String>
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.