use std::rc;
use conformal_component::parameters::{Info, Value};
pub trait Listener {
fn parameter_changed(&self, unique_id: &str, value: &Value);
}
#[derive(Debug, Clone, PartialEq)]
pub enum SetError {
NotFound,
WrongType,
InvalidValue,
InternalError,
}
#[derive(Debug, Clone, PartialEq)]
pub enum SetGrabbedError {
NotFound,
InternalError,
}
pub trait Store {
fn get(&self, unique_id: &str) -> Option<Value>;
fn get_info(&self, unique_id: &str) -> Option<Info>;
fn set(&mut self, unique_id: &str, value: Value) -> Result<(), SetError>;
fn set_grabbed(&mut self, unique_id: &str, grabbed: bool) -> Result<(), SetGrabbedError>;
fn set_listener(&mut self, listener: rc::Weak<dyn Listener>);
}