Hello all! I am new to Tauri and I have a question. Let's say that I had a data.rs which has a Data struct that includes an i32 value called value and a get_value function that returns said value.
Now let't say that in main.rs I have a struct DataWrapper(Mutex<Data>) and that I added it to tauri::Builder::default().manage().
So I am aware of how to call tauri commands and refer to the state DataWrapper(Mutex<Data>) . I was wondering if there's a way to set the state's instance of get_value() as a tauri command itself, as in if the state's Data instance has a value of 15 and I call get_value() from data.rs via tauri command the ideal result would be to get 15.
Is this even possible and, if so, what do I put in .invoke_handler(tauri::generate_handler![])? If not, I could technically make a get_value() from main.rs that calls the state's get_value(), it would just be cumbersome as the amount of functions to do this for increases. Thanks again everyone!