feat: use rust rqbit to replace aria2c

This commit is contained in:
xkeyC
2025-12-05 16:32:53 +08:00
parent c5de9e2252
commit 4315e36cbe
30 changed files with 4789 additions and 1052 deletions

View File

@@ -6,7 +6,8 @@ import 'package:flutter/services.dart';
import 'package:starcitizen_doctor/common/utils/log.dart';
class BinaryModuleConf {
static const _modules = {"aria2c": "0"};
// aria2c has been replaced by rqbit (Rust-based torrent library)
static const _modules = <String, String>{};
static Future extractModule(List<String> modules, String workingDir) async {
for (var m in _modules.entries) {

View File

@@ -0,0 +1,198 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
// These functions are ignored because they are not marked as `pub`: `get_task_status`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `fmt`, `fmt`, `fmt`
/// Initialize the download manager session
void downloaderInit({required String downloadDir}) => RustLib.instance.api
.crateApiDownloaderApiDownloaderInit(downloadDir: downloadDir);
/// Check if the downloader is initialized
bool downloaderIsInitialized() =>
RustLib.instance.api.crateApiDownloaderApiDownloaderIsInitialized();
/// Add a torrent from bytes (e.g., .torrent file content)
Future<BigInt> downloaderAddTorrent({
required List<int> torrentBytes,
String? outputFolder,
List<String>? trackers,
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderAddTorrent(
torrentBytes: torrentBytes,
outputFolder: outputFolder,
trackers: trackers,
);
/// Add a torrent from a magnet link
Future<BigInt> downloaderAddMagnet({
required String magnetLink,
String? outputFolder,
List<String>? trackers,
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderAddMagnet(
magnetLink: magnetLink,
outputFolder: outputFolder,
trackers: trackers,
);
/// Add a torrent from URL (HTTP download not supported, only torrent file URLs)
Future<BigInt> downloaderAddUrl({
required String url,
String? outputFolder,
List<String>? trackers,
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderAddUrl(
url: url,
outputFolder: outputFolder,
trackers: trackers,
);
/// Pause a download task
Future<void> downloaderPause({required BigInt taskId}) =>
RustLib.instance.api.crateApiDownloaderApiDownloaderPause(taskId: taskId);
/// Resume a download task
Future<void> downloaderResume({required BigInt taskId}) =>
RustLib.instance.api.crateApiDownloaderApiDownloaderResume(taskId: taskId);
/// Remove a download task
Future<void> downloaderRemove({
required BigInt taskId,
required bool deleteFiles,
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderRemove(
taskId: taskId,
deleteFiles: deleteFiles,
);
/// Get information about a specific task
Future<DownloadTaskInfo> downloaderGetTaskInfo({required BigInt taskId}) =>
RustLib.instance.api.crateApiDownloaderApiDownloaderGetTaskInfo(
taskId: taskId,
);
/// Get all tasks
Future<List<DownloadTaskInfo>> downloaderGetAllTasks() =>
RustLib.instance.api.crateApiDownloaderApiDownloaderGetAllTasks();
/// Get global statistics
Future<DownloadGlobalStat> downloaderGetGlobalStats() =>
RustLib.instance.api.crateApiDownloaderApiDownloaderGetGlobalStats();
/// Check if a task with given name exists
Future<bool> downloaderIsNameInTask({required String name}) => RustLib
.instance
.api
.crateApiDownloaderApiDownloaderIsNameInTask(name: name);
/// Pause all tasks
Future<void> downloaderPauseAll() =>
RustLib.instance.api.crateApiDownloaderApiDownloaderPauseAll();
/// Resume all tasks
Future<void> downloaderResumeAll() =>
RustLib.instance.api.crateApiDownloaderApiDownloaderResumeAll();
/// Stop the downloader session
Future<void> downloaderStop() =>
RustLib.instance.api.crateApiDownloaderApiDownloaderStop();
/// Global statistics
class DownloadGlobalStat {
final BigInt downloadSpeed;
final BigInt uploadSpeed;
final BigInt numActive;
final BigInt numWaiting;
const DownloadGlobalStat({
required this.downloadSpeed,
required this.uploadSpeed,
required this.numActive,
required this.numWaiting,
});
static Future<DownloadGlobalStat> default_() =>
RustLib.instance.api.crateApiDownloaderApiDownloadGlobalStatDefault();
@override
int get hashCode =>
downloadSpeed.hashCode ^
uploadSpeed.hashCode ^
numActive.hashCode ^
numWaiting.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DownloadGlobalStat &&
runtimeType == other.runtimeType &&
downloadSpeed == other.downloadSpeed &&
uploadSpeed == other.uploadSpeed &&
numActive == other.numActive &&
numWaiting == other.numWaiting;
}
/// Download task information
class DownloadTaskInfo {
final BigInt id;
final String name;
final DownloadTaskStatus status;
final BigInt totalBytes;
final BigInt downloadedBytes;
final BigInt uploadedBytes;
final BigInt downloadSpeed;
final BigInt uploadSpeed;
final double progress;
final BigInt numPeers;
final String outputFolder;
const DownloadTaskInfo({
required this.id,
required this.name,
required this.status,
required this.totalBytes,
required this.downloadedBytes,
required this.uploadedBytes,
required this.downloadSpeed,
required this.uploadSpeed,
required this.progress,
required this.numPeers,
required this.outputFolder,
});
@override
int get hashCode =>
id.hashCode ^
name.hashCode ^
status.hashCode ^
totalBytes.hashCode ^
downloadedBytes.hashCode ^
uploadedBytes.hashCode ^
downloadSpeed.hashCode ^
uploadSpeed.hashCode ^
progress.hashCode ^
numPeers.hashCode ^
outputFolder.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DownloadTaskInfo &&
runtimeType == other.runtimeType &&
id == other.id &&
name == other.name &&
status == other.status &&
totalBytes == other.totalBytes &&
downloadedBytes == other.downloadedBytes &&
uploadedBytes == other.uploadedBytes &&
downloadSpeed == other.downloadSpeed &&
uploadSpeed == other.uploadSpeed &&
progress == other.progress &&
numPeers == other.numPeers &&
outputFolder == other.outputFolder;
}
/// Download task status
enum DownloadTaskStatus { initializing, live, paused, error, finished }

View File

@@ -6,7 +6,6 @@
import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
// These functions are ignored because they are not marked as `pub`: `get_process_path`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `fmt`, `fmt`
Future<void> sendNotify({
@@ -21,27 +20,21 @@ Future<void> sendNotify({
appId: appId,
);
/// Get system memory size in GB
Future<BigInt> getSystemMemorySizeGb() =>
RustLib.instance.api.crateApiWin32ApiGetSystemMemorySizeGb();
/// Get number of logical processors
Future<int> getNumberOfLogicalProcessors() =>
RustLib.instance.api.crateApiWin32ApiGetNumberOfLogicalProcessors();
/// Get all system information at once
Future<SystemInfo> getSystemInfo() =>
RustLib.instance.api.crateApiWin32ApiGetSystemInfo();
/// Get GPU info from registry (more accurate VRAM)
Future<String> getGpuInfoFromRegistry() =>
RustLib.instance.api.crateApiWin32ApiGetGpuInfoFromRegistry();
/// Resolve shortcut (.lnk) file to get target path
Future<String> resolveShortcut({required String lnkPath}) =>
RustLib.instance.api.crateApiWin32ApiResolveShortcut(lnkPath: lnkPath);
/// Open file explorer and select file/folder
Future<void> openDirWithExplorer({
required String path,
required bool isFile,
@@ -65,19 +58,16 @@ Future<List<ProcessInfo>> getProcessListByName({required String processName}) =>
processName: processName,
);
/// Kill processes by name
Future<int> killProcessByName({required String processName}) => RustLib
.instance
.api
.crateApiWin32ApiKillProcessByName(processName: processName);
/// Get disk physical sector size for performance
Future<int> getDiskPhysicalSectorSize({required String driveLetter}) => RustLib
.instance
.api
.crateApiWin32ApiGetDiskPhysicalSectorSize(driveLetter: driveLetter);
/// Create a desktop shortcut
Future<void> createDesktopShortcut({
required String targetPath,
required String shortcutName,
@@ -86,14 +76,12 @@ Future<void> createDesktopShortcut({
shortcutName: shortcutName,
);
/// Run a program with admin privileges (UAC)
Future<void> runAsAdmin({required String program, required String args}) =>
RustLib.instance.api.crateApiWin32ApiRunAsAdmin(
program: program,
args: args,
);
/// Start a program (without waiting)
Future<void> startProcess({
required String program,
required List<String> args,
@@ -102,15 +90,12 @@ Future<void> startProcess({
args: args,
);
/// Check if NVME patch is applied
Future<bool> checkNvmePatchStatus() =>
RustLib.instance.api.crateApiWin32ApiCheckNvmePatchStatus();
/// Add NVME patch to registry
Future<void> addNvmePatch() =>
RustLib.instance.api.crateApiWin32ApiAddNvmePatch();
/// Remove NVME patch from registry
Future<void> removeNvmePatch() =>
RustLib.instance.api.crateApiWin32ApiRemoveNvmePatch();

View File

@@ -4,6 +4,7 @@
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
import 'api/asar_api.dart';
import 'api/downloader_api.dart';
import 'api/http_api.dart';
import 'api/ort_api.dart';
import 'api/rs_process.dart';
@@ -71,7 +72,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
String get codegenVersion => '2.11.1';
@override
int get rustContentHash => 1161621087;
int get rustContentHash => -1465039096;
static const kDefaultExternalLibraryLoaderConfig =
ExternalLibraryLoaderConfig(
@@ -97,6 +98,57 @@ abstract class RustLibApi extends BaseApi {
Future<List<String>> crateApiHttpApiDnsLookupTxt({required String host});
Future<DownloadGlobalStat> crateApiDownloaderApiDownloadGlobalStatDefault();
Future<BigInt> crateApiDownloaderApiDownloaderAddMagnet({
required String magnetLink,
String? outputFolder,
List<String>? trackers,
});
Future<BigInt> crateApiDownloaderApiDownloaderAddTorrent({
required List<int> torrentBytes,
String? outputFolder,
List<String>? trackers,
});
Future<BigInt> crateApiDownloaderApiDownloaderAddUrl({
required String url,
String? outputFolder,
List<String>? trackers,
});
Future<List<DownloadTaskInfo>> crateApiDownloaderApiDownloaderGetAllTasks();
Future<DownloadGlobalStat> crateApiDownloaderApiDownloaderGetGlobalStats();
Future<DownloadTaskInfo> crateApiDownloaderApiDownloaderGetTaskInfo({
required BigInt taskId,
});
void crateApiDownloaderApiDownloaderInit({required String downloadDir});
bool crateApiDownloaderApiDownloaderIsInitialized();
Future<bool> crateApiDownloaderApiDownloaderIsNameInTask({
required String name,
});
Future<void> crateApiDownloaderApiDownloaderPause({required BigInt taskId});
Future<void> crateApiDownloaderApiDownloaderPauseAll();
Future<void> crateApiDownloaderApiDownloaderRemove({
required BigInt taskId,
required bool deleteFiles,
});
Future<void> crateApiDownloaderApiDownloaderResume({required BigInt taskId});
Future<void> crateApiDownloaderApiDownloaderResumeAll();
Future<void> crateApiDownloaderApiDownloaderStop();
Future<RustHttpResponse> crateApiHttpApiFetch({
required MyMethod method,
required String url,
@@ -430,6 +482,451 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
TaskConstMeta get kCrateApiHttpApiDnsLookupTxtConstMeta =>
const TaskConstMeta(debugName: "dns_lookup_txt", argNames: ["host"]);
@override
Future<DownloadGlobalStat> crateApiDownloaderApiDownloadGlobalStatDefault() {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
return wire
.wire__crate__api__downloader_api__download_global_stat_default(
port_,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_download_global_stat,
decodeErrorData: null,
),
constMeta: kCrateApiDownloaderApiDownloadGlobalStatDefaultConstMeta,
argValues: [],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloadGlobalStatDefaultConstMeta =>
const TaskConstMeta(
debugName: "download_global_stat_default",
argNames: [],
);
@override
Future<BigInt> crateApiDownloaderApiDownloaderAddMagnet({
required String magnetLink,
String? outputFolder,
List<String>? trackers,
}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_String(magnetLink);
var arg1 = cst_encode_opt_String(outputFolder);
var arg2 = cst_encode_opt_list_String(trackers);
return wire.wire__crate__api__downloader_api__downloader_add_magnet(
port_,
arg0,
arg1,
arg2,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_usize,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderAddMagnetConstMeta,
argValues: [magnetLink, outputFolder, trackers],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderAddMagnetConstMeta =>
const TaskConstMeta(
debugName: "downloader_add_magnet",
argNames: ["magnetLink", "outputFolder", "trackers"],
);
@override
Future<BigInt> crateApiDownloaderApiDownloaderAddTorrent({
required List<int> torrentBytes,
String? outputFolder,
List<String>? trackers,
}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_list_prim_u_8_loose(torrentBytes);
var arg1 = cst_encode_opt_String(outputFolder);
var arg2 = cst_encode_opt_list_String(trackers);
return wire.wire__crate__api__downloader_api__downloader_add_torrent(
port_,
arg0,
arg1,
arg2,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_usize,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderAddTorrentConstMeta,
argValues: [torrentBytes, outputFolder, trackers],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderAddTorrentConstMeta =>
const TaskConstMeta(
debugName: "downloader_add_torrent",
argNames: ["torrentBytes", "outputFolder", "trackers"],
);
@override
Future<BigInt> crateApiDownloaderApiDownloaderAddUrl({
required String url,
String? outputFolder,
List<String>? trackers,
}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_String(url);
var arg1 = cst_encode_opt_String(outputFolder);
var arg2 = cst_encode_opt_list_String(trackers);
return wire.wire__crate__api__downloader_api__downloader_add_url(
port_,
arg0,
arg1,
arg2,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_usize,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderAddUrlConstMeta,
argValues: [url, outputFolder, trackers],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderAddUrlConstMeta =>
const TaskConstMeta(
debugName: "downloader_add_url",
argNames: ["url", "outputFolder", "trackers"],
);
@override
Future<List<DownloadTaskInfo>> crateApiDownloaderApiDownloaderGetAllTasks() {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
return wire
.wire__crate__api__downloader_api__downloader_get_all_tasks(
port_,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_list_download_task_info,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderGetAllTasksConstMeta,
argValues: [],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderGetAllTasksConstMeta =>
const TaskConstMeta(debugName: "downloader_get_all_tasks", argNames: []);
@override
Future<DownloadGlobalStat> crateApiDownloaderApiDownloaderGetGlobalStats() {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
return wire
.wire__crate__api__downloader_api__downloader_get_global_stats(
port_,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_download_global_stat,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderGetGlobalStatsConstMeta,
argValues: [],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderGetGlobalStatsConstMeta =>
const TaskConstMeta(
debugName: "downloader_get_global_stats",
argNames: [],
);
@override
Future<DownloadTaskInfo> crateApiDownloaderApiDownloaderGetTaskInfo({
required BigInt taskId,
}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_usize(taskId);
return wire
.wire__crate__api__downloader_api__downloader_get_task_info(
port_,
arg0,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_download_task_info,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderGetTaskInfoConstMeta,
argValues: [taskId],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderGetTaskInfoConstMeta =>
const TaskConstMeta(
debugName: "downloader_get_task_info",
argNames: ["taskId"],
);
@override
void crateApiDownloaderApiDownloaderInit({required String downloadDir}) {
return handler.executeSync(
SyncTask(
callFfi: () {
var arg0 = cst_encode_String(downloadDir);
return wire.wire__crate__api__downloader_api__downloader_init(arg0);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_unit,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderInitConstMeta,
argValues: [downloadDir],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderInitConstMeta =>
const TaskConstMeta(
debugName: "downloader_init",
argNames: ["downloadDir"],
);
@override
bool crateApiDownloaderApiDownloaderIsInitialized() {
return handler.executeSync(
SyncTask(
callFfi: () {
return wire
.wire__crate__api__downloader_api__downloader_is_initialized();
},
codec: DcoCodec(
decodeSuccessData: dco_decode_bool,
decodeErrorData: null,
),
constMeta: kCrateApiDownloaderApiDownloaderIsInitializedConstMeta,
argValues: [],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderIsInitializedConstMeta =>
const TaskConstMeta(debugName: "downloader_is_initialized", argNames: []);
@override
Future<bool> crateApiDownloaderApiDownloaderIsNameInTask({
required String name,
}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_String(name);
return wire
.wire__crate__api__downloader_api__downloader_is_name_in_task(
port_,
arg0,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_bool,
decodeErrorData: null,
),
constMeta: kCrateApiDownloaderApiDownloaderIsNameInTaskConstMeta,
argValues: [name],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderIsNameInTaskConstMeta =>
const TaskConstMeta(
debugName: "downloader_is_name_in_task",
argNames: ["name"],
);
@override
Future<void> crateApiDownloaderApiDownloaderPause({required BigInt taskId}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_usize(taskId);
return wire.wire__crate__api__downloader_api__downloader_pause(
port_,
arg0,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_unit,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderPauseConstMeta,
argValues: [taskId],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderPauseConstMeta =>
const TaskConstMeta(debugName: "downloader_pause", argNames: ["taskId"]);
@override
Future<void> crateApiDownloaderApiDownloaderPauseAll() {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
return wire.wire__crate__api__downloader_api__downloader_pause_all(
port_,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_unit,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderPauseAllConstMeta,
argValues: [],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderPauseAllConstMeta =>
const TaskConstMeta(debugName: "downloader_pause_all", argNames: []);
@override
Future<void> crateApiDownloaderApiDownloaderRemove({
required BigInt taskId,
required bool deleteFiles,
}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_usize(taskId);
var arg1 = cst_encode_bool(deleteFiles);
return wire.wire__crate__api__downloader_api__downloader_remove(
port_,
arg0,
arg1,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_unit,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderRemoveConstMeta,
argValues: [taskId, deleteFiles],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderRemoveConstMeta =>
const TaskConstMeta(
debugName: "downloader_remove",
argNames: ["taskId", "deleteFiles"],
);
@override
Future<void> crateApiDownloaderApiDownloaderResume({required BigInt taskId}) {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
var arg0 = cst_encode_usize(taskId);
return wire.wire__crate__api__downloader_api__downloader_resume(
port_,
arg0,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_unit,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderResumeConstMeta,
argValues: [taskId],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderResumeConstMeta =>
const TaskConstMeta(debugName: "downloader_resume", argNames: ["taskId"]);
@override
Future<void> crateApiDownloaderApiDownloaderResumeAll() {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
return wire.wire__crate__api__downloader_api__downloader_resume_all(
port_,
);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_unit,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderResumeAllConstMeta,
argValues: [],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderResumeAllConstMeta =>
const TaskConstMeta(debugName: "downloader_resume_all", argNames: []);
@override
Future<void> crateApiDownloaderApiDownloaderStop() {
return handler.executeNormal(
NormalTask(
callFfi: (port_) {
return wire.wire__crate__api__downloader_api__downloader_stop(port_);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_unit,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kCrateApiDownloaderApiDownloaderStopConstMeta,
argValues: [],
apiImpl: this,
),
);
}
TaskConstMeta get kCrateApiDownloaderApiDownloaderStopConstMeta =>
const TaskConstMeta(debugName: "downloader_stop", argNames: []);
@override
Future<RustHttpResponse> crateApiHttpApiFetch({
required MyMethod method,
@@ -1903,6 +2400,53 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return dco_decode_web_view_configuration(raw);
}
@protected
DownloadGlobalStat dco_decode_download_global_stat(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 4)
throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
return DownloadGlobalStat(
downloadSpeed: dco_decode_u_64(arr[0]),
uploadSpeed: dco_decode_u_64(arr[1]),
numActive: dco_decode_usize(arr[2]),
numWaiting: dco_decode_usize(arr[3]),
);
}
@protected
DownloadTaskInfo dco_decode_download_task_info(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 11)
throw Exception('unexpected arr length: expect 11 but see ${arr.length}');
return DownloadTaskInfo(
id: dco_decode_usize(arr[0]),
name: dco_decode_String(arr[1]),
status: dco_decode_download_task_status(arr[2]),
totalBytes: dco_decode_u_64(arr[3]),
downloadedBytes: dco_decode_u_64(arr[4]),
uploadedBytes: dco_decode_u_64(arr[5]),
downloadSpeed: dco_decode_u_64(arr[6]),
uploadSpeed: dco_decode_u_64(arr[7]),
progress: dco_decode_f_64(arr[8]),
numPeers: dco_decode_usize(arr[9]),
outputFolder: dco_decode_String(arr[10]),
);
}
@protected
DownloadTaskStatus dco_decode_download_task_status(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return DownloadTaskStatus.values[raw as int];
}
@protected
double dco_decode_f_64(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return raw as double;
}
@protected
int dco_decode_i_32(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
@@ -1921,6 +2465,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return (raw as List<dynamic>).map(dco_decode_String).toList();
}
@protected
List<DownloadTaskInfo> dco_decode_list_download_task_info(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return (raw as List<dynamic>).map(dco_decode_download_task_info).toList();
}
@protected
List<P4kFileItem> dco_decode_list_p_4_k_file_item(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
@@ -1993,6 +2543,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return raw == null ? null : dco_decode_box_autoadd_u_64(raw);
}
@protected
List<String>? dco_decode_opt_list_String(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return raw == null ? null : dco_decode_list_String(raw);
}
@protected
Uint8List? dco_decode_opt_list_prim_u_8_strict(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
@@ -2255,6 +2811,67 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return (sse_decode_web_view_configuration(deserializer));
}
@protected
DownloadGlobalStat sse_decode_download_global_stat(
SseDeserializer deserializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_downloadSpeed = sse_decode_u_64(deserializer);
var var_uploadSpeed = sse_decode_u_64(deserializer);
var var_numActive = sse_decode_usize(deserializer);
var var_numWaiting = sse_decode_usize(deserializer);
return DownloadGlobalStat(
downloadSpeed: var_downloadSpeed,
uploadSpeed: var_uploadSpeed,
numActive: var_numActive,
numWaiting: var_numWaiting,
);
}
@protected
DownloadTaskInfo sse_decode_download_task_info(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_id = sse_decode_usize(deserializer);
var var_name = sse_decode_String(deserializer);
var var_status = sse_decode_download_task_status(deserializer);
var var_totalBytes = sse_decode_u_64(deserializer);
var var_downloadedBytes = sse_decode_u_64(deserializer);
var var_uploadedBytes = sse_decode_u_64(deserializer);
var var_downloadSpeed = sse_decode_u_64(deserializer);
var var_uploadSpeed = sse_decode_u_64(deserializer);
var var_progress = sse_decode_f_64(deserializer);
var var_numPeers = sse_decode_usize(deserializer);
var var_outputFolder = sse_decode_String(deserializer);
return DownloadTaskInfo(
id: var_id,
name: var_name,
status: var_status,
totalBytes: var_totalBytes,
downloadedBytes: var_downloadedBytes,
uploadedBytes: var_uploadedBytes,
downloadSpeed: var_downloadSpeed,
uploadSpeed: var_uploadSpeed,
progress: var_progress,
numPeers: var_numPeers,
outputFolder: var_outputFolder,
);
}
@protected
DownloadTaskStatus sse_decode_download_task_status(
SseDeserializer deserializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
var inner = sse_decode_i_32(deserializer);
return DownloadTaskStatus.values[inner];
}
@protected
double sse_decode_f_64(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
return deserializer.buffer.getFloat64();
}
@protected
int sse_decode_i_32(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
@@ -2279,6 +2896,20 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return ans_;
}
@protected
List<DownloadTaskInfo> sse_decode_list_download_task_info(
SseDeserializer deserializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
var len_ = sse_decode_i_32(deserializer);
var ans_ = <DownloadTaskInfo>[];
for (var idx_ = 0; idx_ < len_; ++idx_) {
ans_.add(sse_decode_download_task_info(deserializer));
}
return ans_;
}
@protected
List<P4kFileItem> sse_decode_list_p_4_k_file_item(
SseDeserializer deserializer,
@@ -2407,6 +3038,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
}
}
@protected
List<String>? sse_decode_opt_list_String(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
if (sse_decode_bool(deserializer)) {
return (sse_decode_list_String(deserializer));
} else {
return null;
}
}
@protected
Uint8List? sse_decode_opt_list_prim_u_8_strict(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
@@ -2640,6 +3282,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return raw;
}
@protected
int cst_encode_download_task_status(DownloadTaskStatus raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
return cst_encode_i_32(raw.index);
}
@protected
double cst_encode_f_64(double raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
return raw;
}
@protected
int cst_encode_i_32(int raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
@@ -2768,6 +3422,52 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
sse_encode_web_view_configuration(self, serializer);
}
@protected
void sse_encode_download_global_stat(
DownloadGlobalStat self,
SseSerializer serializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_u_64(self.downloadSpeed, serializer);
sse_encode_u_64(self.uploadSpeed, serializer);
sse_encode_usize(self.numActive, serializer);
sse_encode_usize(self.numWaiting, serializer);
}
@protected
void sse_encode_download_task_info(
DownloadTaskInfo self,
SseSerializer serializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_usize(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_download_task_status(self.status, serializer);
sse_encode_u_64(self.totalBytes, serializer);
sse_encode_u_64(self.downloadedBytes, serializer);
sse_encode_u_64(self.uploadedBytes, serializer);
sse_encode_u_64(self.downloadSpeed, serializer);
sse_encode_u_64(self.uploadSpeed, serializer);
sse_encode_f_64(self.progress, serializer);
sse_encode_usize(self.numPeers, serializer);
sse_encode_String(self.outputFolder, serializer);
}
@protected
void sse_encode_download_task_status(
DownloadTaskStatus self,
SseSerializer serializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_i_32(self.index, serializer);
}
@protected
void sse_encode_f_64(double self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
serializer.buffer.putFloat64(self);
}
@protected
void sse_encode_i_32(int self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
@@ -2789,6 +3489,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
}
}
@protected
void sse_encode_list_download_task_info(
List<DownloadTaskInfo> self,
SseSerializer serializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_i_32(self.length, serializer);
for (final item in self) {
sse_encode_download_task_info(item, serializer);
}
}
@protected
void sse_encode_list_p_4_k_file_item(
List<P4kFileItem> self,
@@ -2917,6 +3629,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
}
}
@protected
void sse_encode_opt_list_String(
List<String>? self,
SseSerializer serializer,
) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_bool(self != null, serializer);
if (self != null) {
sse_encode_list_String(self, serializer);
}
}
@protected
void sse_encode_opt_list_prim_u_8_strict(
Uint8List? self,

View File

@@ -4,6 +4,7 @@
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
import 'api/asar_api.dart';
import 'api/downloader_api.dart';
import 'api/http_api.dart';
import 'api/ort_api.dart';
import 'api/rs_process.dart';
@@ -57,6 +58,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
dynamic raw,
);
@protected
DownloadGlobalStat dco_decode_download_global_stat(dynamic raw);
@protected
DownloadTaskInfo dco_decode_download_task_info(dynamic raw);
@protected
DownloadTaskStatus dco_decode_download_task_status(dynamic raw);
@protected
double dco_decode_f_64(dynamic raw);
@protected
int dco_decode_i_32(dynamic raw);
@@ -66,6 +79,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
List<String> dco_decode_list_String(dynamic raw);
@protected
List<DownloadTaskInfo> dco_decode_list_download_task_info(dynamic raw);
@protected
List<P4kFileItem> dco_decode_list_p_4_k_file_item(dynamic raw);
@@ -102,6 +118,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw);
@protected
List<String>? dco_decode_opt_list_String(dynamic raw);
@protected
Uint8List? dco_decode_opt_list_prim_u_8_strict(dynamic raw);
@@ -192,6 +211,22 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseDeserializer deserializer,
);
@protected
DownloadGlobalStat sse_decode_download_global_stat(
SseDeserializer deserializer,
);
@protected
DownloadTaskInfo sse_decode_download_task_info(SseDeserializer deserializer);
@protected
DownloadTaskStatus sse_decode_download_task_status(
SseDeserializer deserializer,
);
@protected
double sse_decode_f_64(SseDeserializer deserializer);
@protected
int sse_decode_i_32(SseDeserializer deserializer);
@@ -201,6 +236,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
List<String> sse_decode_list_String(SseDeserializer deserializer);
@protected
List<DownloadTaskInfo> sse_decode_list_download_task_info(
SseDeserializer deserializer,
);
@protected
List<P4kFileItem> sse_decode_list_p_4_k_file_item(
SseDeserializer deserializer,
@@ -245,6 +285,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer);
@protected
List<String>? sse_decode_opt_list_String(SseDeserializer deserializer);
@protected
Uint8List? sse_decode_opt_list_prim_u_8_strict(SseDeserializer deserializer);
@@ -396,6 +439,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
return ans;
}
@protected
ffi.Pointer<wire_cst_list_download_task_info>
cst_encode_list_download_task_info(List<DownloadTaskInfo> raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
final ans = wire.cst_new_list_download_task_info(raw.length);
for (var i = 0; i < raw.length; ++i) {
cst_api_fill_to_wire_download_task_info(raw[i], ans.ref.ptr[i]);
}
return ans;
}
@protected
ffi.Pointer<wire_cst_list_p_4_k_file_item> cst_encode_list_p_4_k_file_item(
List<P4kFileItem> raw,
@@ -490,6 +544,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_64(raw);
}
@protected
ffi.Pointer<wire_cst_list_String> cst_encode_opt_list_String(
List<String>? raw,
) {
// Codec=Cst (C-struct based), see doc to use other codecs
return raw == null ? ffi.nullptr : cst_encode_list_String(raw);
}
@protected
ffi.Pointer<wire_cst_list_prim_u_8_strict>
cst_encode_opt_list_prim_u_8_strict(Uint8List? raw) {
@@ -525,6 +587,35 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
cst_api_fill_to_wire_web_view_configuration(apiObj, wireObj.ref);
}
@protected
void cst_api_fill_to_wire_download_global_stat(
DownloadGlobalStat apiObj,
wire_cst_download_global_stat wireObj,
) {
wireObj.download_speed = cst_encode_u_64(apiObj.downloadSpeed);
wireObj.upload_speed = cst_encode_u_64(apiObj.uploadSpeed);
wireObj.num_active = cst_encode_usize(apiObj.numActive);
wireObj.num_waiting = cst_encode_usize(apiObj.numWaiting);
}
@protected
void cst_api_fill_to_wire_download_task_info(
DownloadTaskInfo apiObj,
wire_cst_download_task_info wireObj,
) {
wireObj.id = cst_encode_usize(apiObj.id);
wireObj.name = cst_encode_String(apiObj.name);
wireObj.status = cst_encode_download_task_status(apiObj.status);
wireObj.total_bytes = cst_encode_u_64(apiObj.totalBytes);
wireObj.downloaded_bytes = cst_encode_u_64(apiObj.downloadedBytes);
wireObj.uploaded_bytes = cst_encode_u_64(apiObj.uploadedBytes);
wireObj.download_speed = cst_encode_u_64(apiObj.downloadSpeed);
wireObj.upload_speed = cst_encode_u_64(apiObj.uploadSpeed);
wireObj.progress = cst_encode_f_64(apiObj.progress);
wireObj.num_peers = cst_encode_usize(apiObj.numPeers);
wireObj.output_folder = cst_encode_String(apiObj.outputFolder);
}
@protected
void cst_api_fill_to_wire_p_4_k_file_item(
P4kFileItem apiObj,
@@ -675,6 +766,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
bool cst_encode_bool(bool raw);
@protected
int cst_encode_download_task_status(DownloadTaskStatus raw);
@protected
double cst_encode_f_64(double raw);
@protected
int cst_encode_i_32(int raw);
@@ -741,6 +838,27 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseSerializer serializer,
);
@protected
void sse_encode_download_global_stat(
DownloadGlobalStat self,
SseSerializer serializer,
);
@protected
void sse_encode_download_task_info(
DownloadTaskInfo self,
SseSerializer serializer,
);
@protected
void sse_encode_download_task_status(
DownloadTaskStatus self,
SseSerializer serializer,
);
@protected
void sse_encode_f_64(double self, SseSerializer serializer);
@protected
void sse_encode_i_32(int self, SseSerializer serializer);
@@ -750,6 +868,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_list_String(List<String> self, SseSerializer serializer);
@protected
void sse_encode_list_download_task_info(
List<DownloadTaskInfo> self,
SseSerializer serializer,
);
@protected
void sse_encode_list_p_4_k_file_item(
List<P4kFileItem> self,
@@ -804,6 +928,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer);
@protected
void sse_encode_opt_list_String(List<String>? self, SseSerializer serializer);
@protected
void sse_encode_opt_list_prim_u_8_strict(
Uint8List? self,
@@ -1034,6 +1161,334 @@ class RustLibWire implements BaseWire {
void Function(int, ffi.Pointer<wire_cst_list_prim_u_8_strict>)
>();
void wire__crate__api__downloader_api__download_global_stat_default(
int port_,
) {
return _wire__crate__api__downloader_api__download_global_stat_default(
port_,
);
}
late final _wire__crate__api__downloader_api__download_global_stat_defaultPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__download_global_stat_default',
);
late final _wire__crate__api__downloader_api__download_global_stat_default =
_wire__crate__api__downloader_api__download_global_stat_defaultPtr
.asFunction<void Function(int)>();
void wire__crate__api__downloader_api__downloader_add_magnet(
int port_,
ffi.Pointer<wire_cst_list_prim_u_8_strict> magnet_link,
ffi.Pointer<wire_cst_list_prim_u_8_strict> output_folder,
ffi.Pointer<wire_cst_list_String> trackers,
) {
return _wire__crate__api__downloader_api__downloader_add_magnet(
port_,
magnet_link,
output_folder,
trackers,
);
}
late final _wire__crate__api__downloader_api__downloader_add_magnetPtr =
_lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_String>,
)
>
>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_add_magnet',
);
late final _wire__crate__api__downloader_api__downloader_add_magnet =
_wire__crate__api__downloader_api__downloader_add_magnetPtr
.asFunction<
void Function(
int,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_String>,
)
>();
void wire__crate__api__downloader_api__downloader_add_torrent(
int port_,
ffi.Pointer<wire_cst_list_prim_u_8_loose> torrent_bytes,
ffi.Pointer<wire_cst_list_prim_u_8_strict> output_folder,
ffi.Pointer<wire_cst_list_String> trackers,
) {
return _wire__crate__api__downloader_api__downloader_add_torrent(
port_,
torrent_bytes,
output_folder,
trackers,
);
}
late final _wire__crate__api__downloader_api__downloader_add_torrentPtr =
_lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64,
ffi.Pointer<wire_cst_list_prim_u_8_loose>,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_String>,
)
>
>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_add_torrent',
);
late final _wire__crate__api__downloader_api__downloader_add_torrent =
_wire__crate__api__downloader_api__downloader_add_torrentPtr
.asFunction<
void Function(
int,
ffi.Pointer<wire_cst_list_prim_u_8_loose>,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_String>,
)
>();
void wire__crate__api__downloader_api__downloader_add_url(
int port_,
ffi.Pointer<wire_cst_list_prim_u_8_strict> url,
ffi.Pointer<wire_cst_list_prim_u_8_strict> output_folder,
ffi.Pointer<wire_cst_list_String> trackers,
) {
return _wire__crate__api__downloader_api__downloader_add_url(
port_,
url,
output_folder,
trackers,
);
}
late final _wire__crate__api__downloader_api__downloader_add_urlPtr =
_lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_String>,
)
>
>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_add_url',
);
late final _wire__crate__api__downloader_api__downloader_add_url =
_wire__crate__api__downloader_api__downloader_add_urlPtr
.asFunction<
void Function(
int,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
ffi.Pointer<wire_cst_list_String>,
)
>();
void wire__crate__api__downloader_api__downloader_get_all_tasks(int port_) {
return _wire__crate__api__downloader_api__downloader_get_all_tasks(port_);
}
late final _wire__crate__api__downloader_api__downloader_get_all_tasksPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_get_all_tasks',
);
late final _wire__crate__api__downloader_api__downloader_get_all_tasks =
_wire__crate__api__downloader_api__downloader_get_all_tasksPtr
.asFunction<void Function(int)>();
void wire__crate__api__downloader_api__downloader_get_global_stats(
int port_,
) {
return _wire__crate__api__downloader_api__downloader_get_global_stats(
port_,
);
}
late final _wire__crate__api__downloader_api__downloader_get_global_statsPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_get_global_stats',
);
late final _wire__crate__api__downloader_api__downloader_get_global_stats =
_wire__crate__api__downloader_api__downloader_get_global_statsPtr
.asFunction<void Function(int)>();
void wire__crate__api__downloader_api__downloader_get_task_info(
int port_,
int task_id,
) {
return _wire__crate__api__downloader_api__downloader_get_task_info(
port_,
task_id,
);
}
late final _wire__crate__api__downloader_api__downloader_get_task_infoPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_get_task_info',
);
late final _wire__crate__api__downloader_api__downloader_get_task_info =
_wire__crate__api__downloader_api__downloader_get_task_infoPtr
.asFunction<void Function(int, int)>();
WireSyncRust2DartDco wire__crate__api__downloader_api__downloader_init(
ffi.Pointer<wire_cst_list_prim_u_8_strict> download_dir,
) {
return _wire__crate__api__downloader_api__downloader_init(download_dir);
}
late final _wire__crate__api__downloader_api__downloader_initPtr =
_lookup<
ffi.NativeFunction<
WireSyncRust2DartDco Function(
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
)
>
>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_init',
);
late final _wire__crate__api__downloader_api__downloader_init =
_wire__crate__api__downloader_api__downloader_initPtr
.asFunction<
WireSyncRust2DartDco Function(
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
)
>();
WireSyncRust2DartDco
wire__crate__api__downloader_api__downloader_is_initialized() {
return _wire__crate__api__downloader_api__downloader_is_initialized();
}
late final _wire__crate__api__downloader_api__downloader_is_initializedPtr =
_lookup<ffi.NativeFunction<WireSyncRust2DartDco Function()>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_is_initialized',
);
late final _wire__crate__api__downloader_api__downloader_is_initialized =
_wire__crate__api__downloader_api__downloader_is_initializedPtr
.asFunction<WireSyncRust2DartDco Function()>();
void wire__crate__api__downloader_api__downloader_is_name_in_task(
int port_,
ffi.Pointer<wire_cst_list_prim_u_8_strict> name,
) {
return _wire__crate__api__downloader_api__downloader_is_name_in_task(
port_,
name,
);
}
late final _wire__crate__api__downloader_api__downloader_is_name_in_taskPtr =
_lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Int64,
ffi.Pointer<wire_cst_list_prim_u_8_strict>,
)
>
>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_is_name_in_task',
);
late final _wire__crate__api__downloader_api__downloader_is_name_in_task =
_wire__crate__api__downloader_api__downloader_is_name_in_taskPtr
.asFunction<
void Function(int, ffi.Pointer<wire_cst_list_prim_u_8_strict>)
>();
void wire__crate__api__downloader_api__downloader_pause(
int port_,
int task_id,
) {
return _wire__crate__api__downloader_api__downloader_pause(port_, task_id);
}
late final _wire__crate__api__downloader_api__downloader_pausePtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_pause',
);
late final _wire__crate__api__downloader_api__downloader_pause =
_wire__crate__api__downloader_api__downloader_pausePtr
.asFunction<void Function(int, int)>();
void wire__crate__api__downloader_api__downloader_pause_all(int port_) {
return _wire__crate__api__downloader_api__downloader_pause_all(port_);
}
late final _wire__crate__api__downloader_api__downloader_pause_allPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_pause_all',
);
late final _wire__crate__api__downloader_api__downloader_pause_all =
_wire__crate__api__downloader_api__downloader_pause_allPtr
.asFunction<void Function(int)>();
void wire__crate__api__downloader_api__downloader_remove(
int port_,
int task_id,
bool delete_files,
) {
return _wire__crate__api__downloader_api__downloader_remove(
port_,
task_id,
delete_files,
);
}
late final _wire__crate__api__downloader_api__downloader_removePtr =
_lookup<
ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Bool)>
>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_remove',
);
late final _wire__crate__api__downloader_api__downloader_remove =
_wire__crate__api__downloader_api__downloader_removePtr
.asFunction<void Function(int, int, bool)>();
void wire__crate__api__downloader_api__downloader_resume(
int port_,
int task_id,
) {
return _wire__crate__api__downloader_api__downloader_resume(port_, task_id);
}
late final _wire__crate__api__downloader_api__downloader_resumePtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_resume',
);
late final _wire__crate__api__downloader_api__downloader_resume =
_wire__crate__api__downloader_api__downloader_resumePtr
.asFunction<void Function(int, int)>();
void wire__crate__api__downloader_api__downloader_resume_all(int port_) {
return _wire__crate__api__downloader_api__downloader_resume_all(port_);
}
late final _wire__crate__api__downloader_api__downloader_resume_allPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_resume_all',
);
late final _wire__crate__api__downloader_api__downloader_resume_all =
_wire__crate__api__downloader_api__downloader_resume_allPtr
.asFunction<void Function(int)>();
void wire__crate__api__downloader_api__downloader_stop(int port_) {
return _wire__crate__api__downloader_api__downloader_stop(port_);
}
late final _wire__crate__api__downloader_api__downloader_stopPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'frbgen_starcitizen_doctor_wire__crate__api__downloader_api__downloader_stop',
);
late final _wire__crate__api__downloader_api__downloader_stop =
_wire__crate__api__downloader_api__downloader_stopPtr
.asFunction<void Function(int)>();
void wire__crate__api__http_api__fetch(
int port_,
int method,
@@ -1506,9 +1961,9 @@ class RustLibWire implements BaseWire {
void wire__crate__api__win32_api__resolve_shortcut(
int port_,
ffi.Pointer<wire_cst_list_prim_u_8_strict> lnk_path,
ffi.Pointer<wire_cst_list_prim_u_8_strict> _lnk_path,
) {
return _wire__crate__api__win32_api__resolve_shortcut(port_, lnk_path);
return _wire__crate__api__win32_api__resolve_shortcut(port_, _lnk_path);
}
late final _wire__crate__api__win32_api__resolve_shortcutPtr =
@@ -2341,6 +2796,24 @@ class RustLibWire implements BaseWire {
late final _cst_new_list_String = _cst_new_list_StringPtr
.asFunction<ffi.Pointer<wire_cst_list_String> Function(int)>();
ffi.Pointer<wire_cst_list_download_task_info> cst_new_list_download_task_info(
int len,
) {
return _cst_new_list_download_task_info(len);
}
late final _cst_new_list_download_task_infoPtr =
_lookup<
ffi.NativeFunction<
ffi.Pointer<wire_cst_list_download_task_info> Function(ffi.Int32)
>
>('frbgen_starcitizen_doctor_cst_new_list_download_task_info');
late final _cst_new_list_download_task_info =
_cst_new_list_download_task_infoPtr
.asFunction<
ffi.Pointer<wire_cst_list_download_task_info> Function(int)
>();
ffi.Pointer<wire_cst_list_p_4_k_file_item> cst_new_list_p_4_k_file_item(
int len,
) {
@@ -2459,6 +2932,20 @@ final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
external int len;
}
final class wire_cst_list_String extends ffi.Struct {
external ffi.Pointer<ffi.Pointer<wire_cst_list_prim_u_8_strict>> ptr;
@ffi.Int32()
external int len;
}
final class wire_cst_list_prim_u_8_loose extends ffi.Struct {
external ffi.Pointer<ffi.Uint8> ptr;
@ffi.Int32()
external int len;
}
final class wire_cst_record_string_string extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> field0;
@@ -2472,13 +2959,6 @@ final class wire_cst_list_record_string_string extends ffi.Struct {
external int len;
}
final class wire_cst_list_String extends ffi.Struct {
external ffi.Pointer<ffi.Pointer<wire_cst_list_prim_u_8_strict>> ptr;
@ffi.Int32()
external int len;
}
final class wire_cst_rsi_launcher_asar_data extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> asar_path;
@@ -2487,13 +2967,6 @@ final class wire_cst_rsi_launcher_asar_data extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> main_js_content;
}
final class wire_cst_list_prim_u_8_loose extends ffi.Struct {
external ffi.Pointer<ffi.Uint8> ptr;
@ffi.Int32()
external int len;
}
final class wire_cst_web_view_configuration extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> title;
@@ -2514,6 +2987,46 @@ final class wire_cst_web_view_configuration extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> user_agent;
}
final class wire_cst_download_task_info extends ffi.Struct {
@ffi.UintPtr()
external int id;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> name;
@ffi.Int32()
external int status;
@ffi.Uint64()
external int total_bytes;
@ffi.Uint64()
external int downloaded_bytes;
@ffi.Uint64()
external int uploaded_bytes;
@ffi.Uint64()
external int download_speed;
@ffi.Uint64()
external int upload_speed;
@ffi.Double()
external double progress;
@ffi.UintPtr()
external int num_peers;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> output_folder;
}
final class wire_cst_list_download_task_info extends ffi.Struct {
external ffi.Pointer<wire_cst_download_task_info> ptr;
@ffi.Int32()
external int len;
}
final class wire_cst_p_4_k_file_item extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> name;
@@ -2599,6 +3112,20 @@ final class wire_cst_list_web_view_event extends ffi.Struct {
external int len;
}
final class wire_cst_download_global_stat extends ffi.Struct {
@ffi.Uint64()
external int download_speed;
@ffi.Uint64()
external int upload_speed;
@ffi.UintPtr()
external int num_active;
@ffi.UintPtr()
external int num_waiting;
}
final class wire_cst_rs_process_stream_data extends ffi.Struct {
@ffi.Int32()
external int data_type;