What is the role of Rust in tauri #2414
-
Hello everyone. I want to understand what is the role of Rust in tauri. Tauri will package the Rust source code and the web source code into an exe. Can only Invoke be used to interact between js and Rust? How to make this exe connect to a local or remote database? Can this exe connect to the network interface provided by other languages? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Rust is what interacts with the OS apis (filesystem, interacting with databases directly and more) and opens the webview with your front-end. You can think of rust as the main process in electron app. Rust can connect to a local database (mongodb for example) using its driver, or connect to your remote database through HTTP requests without CORS limitation if you want. You can connect to a remote database in your js too but there is a CORS bug on linux as I mentioned in your other discussion or you can use our js http module to avoid CORS. |
Beta Was this translation helpful? Give feedback.
Rust is what interacts with the OS apis (filesystem, interacting with databases directly and more) and opens the webview with your front-end.
You can think of rust as the main process in electron app.
Rust can connect to a local database (mongodb for example) using its driver, or connect to your remote database through HTTP requests without CORS limitation if you want.
You can connect to a remote database in your js too but there is a CORS bug on linux as I mentioned in your other discussion or you can use our js http module to avoid CORS.