mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-07-31 21:29:29 +08:00
Upgrade to flutter_rust_bridge V2
This commit is contained in:
11
rust/src/api/downloader_api.rs
Normal file
11
rust/src/api/downloader_api.rs
Normal file
@ -0,0 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
use crate::downloader::{do_cancel_download, do_start_download, DownloadCallbackData};
|
||||
use crate::frb_generated::StreamSink;
|
||||
|
||||
pub fn start_download(url: String, save_path: String, file_name: String, connection_count: u8, sink: StreamSink<DownloadCallbackData>) {
|
||||
let _ = do_start_download(url, save_path, file_name, connection_count, Arc::new(sink));
|
||||
}
|
||||
|
||||
pub async fn cancel_download(id: String) {
|
||||
do_cancel_download(&id).await
|
||||
}
|
5
rust/src/api/mod.rs
Normal file
5
rust/src/api/mod.rs
Normal file
@ -0,0 +1,5 @@
|
||||
//
|
||||
// Do not put code in `mod.rs`, but put in e.g. `simple.rs`.
|
||||
//
|
||||
|
||||
pub mod downloader_api;
|
Reference in New Issue
Block a user