- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 54
 
Open
Description
Hey :)
I'm trying to call a move || closure from dyon, but that doesn't work. Also I wasn't able to figure out how to do something similar with the current library. Maybe someone has an idea?
    pub fn execute<'b>(&mut self, send_dsp_parameter: &dyn FnMut(String, f32) -> ()) {
        let mut module = Module::new();
        module.add_str(
            "set_dsp_parameter",
            move |rt: &mut dyon::Runtime| -> Result<(), String> {
                let value: f64 = rt.pop()?;
                let key: String = rt.pop()?;
                println!("{key} {value}");
                set_dsp_parameter(key, value);
                Ok(())
            },
            Dfn::nl(vec![Type::Str, Type::F64], Type::Void),
        );
        self.runtime
            .run(&mut Arc::new(module))
            .expect("Failed running");
    }Metadata
Metadata
Assignees
Labels
No labels