Closed AhsanSarwar45 closed 1 year ago
Thanks for the share, i am working on it
@Mithronn BTW, rustube works with their async api in tauri. Although I can't use that because the download speed is extremely slow :(
With the 0.6.2 version now Stream trait and Search struct is thread safely!
@Mithronn Wow, thanks a lot!
@Mithronn I tried it, and I am no longer getting the error for Stream and Search struct. Unfortunately, I am still getting a similar error for something else:
error: future cannot be sent between threads safely
--> src\main.rs:123:1
|
123 | #[tauri::command]
| ^^^^^^^^^^^^^^^^^ future returned by `download_youtube_song` is not `Send`
...
205 | .invoke_handler(tauri::generate_handler![
| _________________________-
206 | | get_file_tags,
207 | | get_file_tag,
208 | | download_youtube_song
209 | | ])
| |_________- in this macro invocation
|
= help: within `deno_core::extensions::OpDecl`, the trait `Send` is not implemented for `*const c_void`
note: future is not `Send` as this value is used across an await
--> D:\Apps\rust\cargo_home\registry\src\index.crates.io-6f17d22bba15001f\rusty_ytdl-0.6.2\src\info.rs:205:17
|
192 | let mut cut_after_js_script =
| ----------------------- has type `js_sandbox::script::Script` which is not `Send`
...
205 | .await?,
| ^^^^^^ await occurs here, with `mut cut_after_js_script` maybe used later
...
211 | }
| - `mut cut_after_js_script` is later dropped here
note: required by a bound in `ResultFutureTag::future`
--> D:\Apps\rust\cargo_home\registry\src\index.crates.io-6f17d22bba15001f\tauri-1.4.0\src\command.rs:289:42
|
289 | F: Future<Output = Result<T, E>> + Send,
| ^^^^ required by this bound in `ResultFutureTag::future`
= note: this error originates in the macro `__cmd__download_youtube_song` which comes from the expansion of the macro `tauri::generate_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
Completely overlooked. Fixed with new version (0.6.3). Thanks for sharing!
@Mithronn Thanks again, all working now!
Hi, I am trying to use this with tauri commands. But I am getting this error:
The blocking api works, but as expected, it blocks the frontend UI. I am pretty new to rust so I'm not sure but is there any way to make the async api work with tauri?
My full code is: