app/lib/common/rust/bridge_definitions.dart

68 lines
2.3 KiB
Dart
Raw Normal View History

// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.3.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const
import 'dart:convert';
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'package:uuid/uuid.dart';
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
part 'bridge_definitions.freezed.dart';
abstract class Rust {
Future<String> ping({dynamic hint});
FlutterRustBridgeTaskConstMeta get kPingConstMeta;
Stream<DownloadCallbackData> startDownload(
{required String url,
required String savePath,
required String fileName,
required int connectionCount,
dynamic hint});
FlutterRustBridgeTaskConstMeta get kStartDownloadConstMeta;
Future<void> cancelDownload({required String id, dynamic hint});
FlutterRustBridgeTaskConstMeta get kCancelDownloadConstMeta;
}
class DownloadCallbackData {
final String id;
final int total;
final int progress;
final int speed;
final MyDownloaderStatus status;
const DownloadCallbackData({
required this.id,
required this.total,
required this.progress,
required this.speed,
required this.status,
});
}
@freezed
sealed class MyDownloaderStatus with _$MyDownloaderStatus {
const factory MyDownloaderStatus.noStart() = MyDownloaderStatus_NoStart;
const factory MyDownloaderStatus.running() = MyDownloaderStatus_Running;
const factory MyDownloaderStatus.pending(
MyNetworkItemPendingType field0,
) = MyDownloaderStatus_Pending;
const factory MyDownloaderStatus.error(
String field0,
) = MyDownloaderStatus_Error;
const factory MyDownloaderStatus.finished() = MyDownloaderStatus_Finished;
}
enum MyNetworkItemPendingType {
QueueUp,
Starting,
Stopping,
Initializing,
}