2024-02-06 20:19:53 +08:00
|
|
|
// This file is automatically generated, so please do not edit it.
|
2024-05-06 22:48:50 +08:00
|
|
|
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
2024-02-06 20:19:53 +08:00
|
|
|
|
|
|
|
// 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
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
import 'api/asar_api.dart';
|
2024-02-07 00:20:06 +08:00
|
|
|
import 'api/http_api.dart';
|
2024-04-16 22:34:50 +08:00
|
|
|
import 'api/rs_process.dart';
|
2024-04-28 22:28:48 +08:00
|
|
|
import 'api/win32_api.dart';
|
2024-02-06 20:19:53 +08:00
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart';
|
2024-02-07 19:32:36 +08:00
|
|
|
import 'http_package.dart';
|
2024-02-06 20:19:53 +08:00
|
|
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|
|
|
|
|
|
|
/// Main entrypoint of the Rust API
|
|
|
|
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
|
|
|
@internal
|
|
|
|
static final instance = RustLib._();
|
|
|
|
|
|
|
|
RustLib._();
|
|
|
|
|
|
|
|
/// Initialize flutter_rust_bridge
|
|
|
|
static Future<void> init({
|
|
|
|
RustLibApi? api,
|
|
|
|
BaseHandler? handler,
|
|
|
|
ExternalLibrary? externalLibrary,
|
|
|
|
}) async {
|
|
|
|
await instance.initImpl(
|
|
|
|
api: api,
|
|
|
|
handler: handler,
|
|
|
|
externalLibrary: externalLibrary,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Dispose flutter_rust_bridge
|
|
|
|
///
|
|
|
|
/// The call to this function is optional, since flutter_rust_bridge (and everything else)
|
|
|
|
/// is automatically disposed when the app stops.
|
|
|
|
static void dispose() => instance.disposeImpl();
|
|
|
|
|
|
|
|
@override
|
|
|
|
ApiImplConstructor<RustLibApiImpl, RustLibWire> get apiImplConstructor =>
|
|
|
|
RustLibApiImpl.new;
|
|
|
|
|
|
|
|
@override
|
|
|
|
WireConstructor<RustLibWire> get wireConstructor =>
|
|
|
|
RustLibWire.fromExternalLibrary;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> executeRustInitializers() async {}
|
|
|
|
|
|
|
|
@override
|
|
|
|
ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
|
|
|
|
kDefaultExternalLibraryLoaderConfig;
|
|
|
|
|
|
|
|
@override
|
2024-05-06 22:48:50 +08:00
|
|
|
String get codegenVersion => '2.0.0-dev.33';
|
2024-04-16 19:29:19 +08:00
|
|
|
|
|
|
|
@override
|
2024-05-01 13:48:37 +08:00
|
|
|
int get rustContentHash => 1832496273;
|
2024-02-06 20:19:53 +08:00
|
|
|
|
|
|
|
static const kDefaultExternalLibraryLoaderConfig =
|
|
|
|
ExternalLibraryLoaderConfig(
|
2024-02-06 20:35:52 +08:00
|
|
|
stem: 'rust',
|
2024-02-06 20:19:53 +08:00
|
|
|
ioDirectory: 'rust/target/release/',
|
|
|
|
webPrefix: 'pkg/',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
abstract class RustLibApi extends BaseApi {
|
2024-05-01 13:48:37 +08:00
|
|
|
Future<RsiLauncherAsarData> getRsiLauncherAsarData(
|
|
|
|
{required String asarPath, dynamic hint});
|
|
|
|
|
|
|
|
Future<void> rsiLauncherAsarDataWriteMainJs(
|
|
|
|
{required RsiLauncherAsarData that,
|
|
|
|
required List<int> content,
|
|
|
|
dynamic hint});
|
|
|
|
|
2024-03-12 20:07:06 +08:00
|
|
|
Future<List<String>> dnsLookupIps({required String host, dynamic hint});
|
|
|
|
|
2024-02-07 22:19:43 +08:00
|
|
|
Future<List<String>> dnsLookupTxt({required String host, dynamic hint});
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
Future<RustHttpResponse> fetch(
|
|
|
|
{required MyMethod method,
|
|
|
|
required String url,
|
2024-02-07 00:20:06 +08:00
|
|
|
Map<String, String>? headers,
|
2024-02-07 19:32:36 +08:00
|
|
|
Uint8List? inputData,
|
2024-03-12 20:07:06 +08:00
|
|
|
String? withIpAddress,
|
2024-02-07 00:20:06 +08:00
|
|
|
dynamic hint});
|
2024-02-07 19:32:36 +08:00
|
|
|
|
|
|
|
Future<void> setDefaultHeader(
|
|
|
|
{required Map<String, String> headers, dynamic hint});
|
|
|
|
|
2024-04-28 22:28:48 +08:00
|
|
|
Stream<RsProcessStreamData> start(
|
|
|
|
{required String executable,
|
|
|
|
required List<String> arguments,
|
|
|
|
required String workingDirectory,
|
|
|
|
dynamic hint});
|
|
|
|
|
|
|
|
Future<void> write({required int rsPid, required String data, dynamic hint});
|
|
|
|
|
2024-04-27 14:25:11 +08:00
|
|
|
Future<void> sendNotify(
|
|
|
|
{String? summary,
|
|
|
|
String? body,
|
|
|
|
String? appName,
|
|
|
|
String? appId,
|
|
|
|
dynamic hint});
|
|
|
|
|
2024-04-28 21:50:36 +08:00
|
|
|
Future<bool> setForegroundWindow({required String windowName, dynamic hint});
|
2024-02-06 20:19:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|
|
|
RustLibApiImpl({
|
|
|
|
required super.handler,
|
|
|
|
required super.wire,
|
|
|
|
required super.generalizedFrbRustBinding,
|
|
|
|
required super.portManager,
|
|
|
|
});
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@override
|
|
|
|
Future<RsiLauncherAsarData> getRsiLauncherAsarData(
|
|
|
|
{required String asarPath, dynamic hint}) {
|
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
|
|
|
var arg0 = cst_encode_String(asarPath);
|
|
|
|
return wire.wire_get_rsi_launcher_asar_data(port_, arg0);
|
|
|
|
},
|
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_rsi_launcher_asar_data,
|
|
|
|
decodeErrorData: dco_decode_AnyhowException,
|
|
|
|
),
|
|
|
|
constMeta: kGetRsiLauncherAsarDataConstMeta,
|
|
|
|
argValues: [asarPath],
|
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
TaskConstMeta get kGetRsiLauncherAsarDataConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "get_rsi_launcher_asar_data",
|
|
|
|
argNames: ["asarPath"],
|
|
|
|
);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> rsiLauncherAsarDataWriteMainJs(
|
|
|
|
{required RsiLauncherAsarData that,
|
|
|
|
required List<int> content,
|
|
|
|
dynamic hint}) {
|
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
|
|
|
var arg0 = cst_encode_box_autoadd_rsi_launcher_asar_data(that);
|
|
|
|
var arg1 = cst_encode_list_prim_u_8_loose(content);
|
|
|
|
return wire.wire_rsi_launcher_asar_data_write_main_js(
|
|
|
|
port_, arg0, arg1);
|
|
|
|
},
|
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_unit,
|
|
|
|
decodeErrorData: dco_decode_AnyhowException,
|
|
|
|
),
|
|
|
|
constMeta: kRsiLauncherAsarDataWriteMainJsConstMeta,
|
|
|
|
argValues: [that, content],
|
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
TaskConstMeta get kRsiLauncherAsarDataWriteMainJsConstMeta =>
|
|
|
|
const TaskConstMeta(
|
|
|
|
debugName: "rsi_launcher_asar_data_write_main_js",
|
|
|
|
argNames: ["that", "content"],
|
|
|
|
);
|
|
|
|
|
2024-03-12 20:07:06 +08:00
|
|
|
@override
|
|
|
|
Future<List<String>> dnsLookupIps({required String host, dynamic hint}) {
|
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
2024-03-13 22:41:28 +08:00
|
|
|
var arg0 = cst_encode_String(host);
|
|
|
|
return wire.wire_dns_lookup_ips(port_, arg0);
|
2024-03-12 20:07:06 +08:00
|
|
|
},
|
2024-03-13 22:41:28 +08:00
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_list_String,
|
|
|
|
decodeErrorData: dco_decode_AnyhowException,
|
2024-03-12 20:07:06 +08:00
|
|
|
),
|
|
|
|
constMeta: kDnsLookupIpsConstMeta,
|
|
|
|
argValues: [host],
|
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
TaskConstMeta get kDnsLookupIpsConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "dns_lookup_ips",
|
|
|
|
argNames: ["host"],
|
|
|
|
);
|
|
|
|
|
2024-02-07 22:19:43 +08:00
|
|
|
@override
|
|
|
|
Future<List<String>> dnsLookupTxt({required String host, dynamic hint}) {
|
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
2024-03-13 22:41:28 +08:00
|
|
|
var arg0 = cst_encode_String(host);
|
|
|
|
return wire.wire_dns_lookup_txt(port_, arg0);
|
2024-02-07 22:19:43 +08:00
|
|
|
},
|
2024-03-13 22:41:28 +08:00
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_list_String,
|
|
|
|
decodeErrorData: dco_decode_AnyhowException,
|
2024-02-07 22:19:43 +08:00
|
|
|
),
|
|
|
|
constMeta: kDnsLookupTxtConstMeta,
|
|
|
|
argValues: [host],
|
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
TaskConstMeta get kDnsLookupTxtConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "dns_lookup_txt",
|
|
|
|
argNames: ["host"],
|
|
|
|
);
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@override
|
2024-02-07 19:32:36 +08:00
|
|
|
Future<RustHttpResponse> fetch(
|
|
|
|
{required MyMethod method,
|
|
|
|
required String url,
|
|
|
|
Map<String, String>? headers,
|
|
|
|
Uint8List? inputData,
|
2024-03-12 20:07:06 +08:00
|
|
|
String? withIpAddress,
|
2024-02-07 19:32:36 +08:00
|
|
|
dynamic hint}) {
|
2024-02-07 00:20:06 +08:00
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
2024-03-13 22:41:28 +08:00
|
|
|
var arg0 = cst_encode_my_method(method);
|
|
|
|
var arg1 = cst_encode_String(url);
|
|
|
|
var arg2 = cst_encode_opt_Map_String_String(headers);
|
|
|
|
var arg3 = cst_encode_opt_list_prim_u_8_strict(inputData);
|
|
|
|
var arg4 = cst_encode_opt_String(withIpAddress);
|
|
|
|
return wire.wire_fetch(port_, arg0, arg1, arg2, arg3, arg4);
|
2024-02-07 00:20:06 +08:00
|
|
|
},
|
2024-03-13 22:41:28 +08:00
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_rust_http_response,
|
|
|
|
decodeErrorData: dco_decode_AnyhowException,
|
2024-02-07 00:20:06 +08:00
|
|
|
),
|
2024-02-07 19:32:36 +08:00
|
|
|
constMeta: kFetchConstMeta,
|
2024-03-12 20:07:06 +08:00
|
|
|
argValues: [method, url, headers, inputData, withIpAddress],
|
2024-02-07 00:20:06 +08:00
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
TaskConstMeta get kFetchConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "fetch",
|
2024-03-12 20:07:06 +08:00
|
|
|
argNames: ["method", "url", "headers", "inputData", "withIpAddress"],
|
2024-02-07 00:20:06 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
@override
|
2024-02-07 19:32:36 +08:00
|
|
|
Future<void> setDefaultHeader(
|
|
|
|
{required Map<String, String> headers, dynamic hint}) {
|
2024-02-07 00:20:06 +08:00
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
2024-03-13 22:41:28 +08:00
|
|
|
var arg0 = cst_encode_Map_String_String(headers);
|
|
|
|
return wire.wire_set_default_header(port_, arg0);
|
2024-02-07 00:20:06 +08:00
|
|
|
},
|
2024-03-13 22:41:28 +08:00
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_unit,
|
2024-02-07 00:20:06 +08:00
|
|
|
decodeErrorData: null,
|
|
|
|
),
|
2024-02-07 19:32:36 +08:00
|
|
|
constMeta: kSetDefaultHeaderConstMeta,
|
|
|
|
argValues: [headers],
|
2024-02-07 00:20:06 +08:00
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
TaskConstMeta get kSetDefaultHeaderConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "set_default_header",
|
|
|
|
argNames: ["headers"],
|
2024-02-07 00:20:06 +08:00
|
|
|
);
|
2024-02-25 10:30:20 +08:00
|
|
|
|
|
|
|
@override
|
2024-04-17 21:40:08 +08:00
|
|
|
Stream<RsProcessStreamData> start(
|
|
|
|
{required String executable,
|
2024-02-25 10:30:20 +08:00
|
|
|
required List<String> arguments,
|
|
|
|
required String workingDirectory,
|
2024-04-16 19:29:19 +08:00
|
|
|
dynamic hint}) {
|
2024-04-16 22:34:50 +08:00
|
|
|
final streamSink = RustStreamSink<RsProcessStreamData>();
|
2024-04-16 19:29:19 +08:00
|
|
|
unawaited(handler.executeNormal(NormalTask(
|
2024-02-25 10:30:20 +08:00
|
|
|
callFfi: (port_) {
|
2024-04-17 21:40:08 +08:00
|
|
|
var arg0 = cst_encode_String(executable);
|
|
|
|
var arg1 = cst_encode_list_String(arguments);
|
|
|
|
var arg2 = cst_encode_String(workingDirectory);
|
|
|
|
var arg3 = cst_encode_StreamSink_rs_process_stream_data_Dco(streamSink);
|
|
|
|
return wire.wire_start(port_, arg0, arg1, arg2, arg3);
|
2024-02-25 10:30:20 +08:00
|
|
|
},
|
2024-03-13 22:41:28 +08:00
|
|
|
codec: DcoCodec(
|
2024-04-11 19:52:13 +08:00
|
|
|
decodeSuccessData: dco_decode_unit,
|
2024-02-25 10:30:20 +08:00
|
|
|
decodeErrorData: null,
|
|
|
|
),
|
2024-04-17 21:40:08 +08:00
|
|
|
constMeta: kStartConstMeta,
|
|
|
|
argValues: [executable, arguments, workingDirectory, streamSink],
|
2024-02-25 10:30:20 +08:00
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
2024-04-16 19:29:19 +08:00
|
|
|
)));
|
2024-04-11 19:52:13 +08:00
|
|
|
return streamSink.stream;
|
2024-02-25 10:30:20 +08:00
|
|
|
}
|
|
|
|
|
2024-04-17 21:40:08 +08:00
|
|
|
TaskConstMeta get kStartConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "start",
|
|
|
|
argNames: ["executable", "arguments", "workingDirectory", "streamSink"],
|
2024-02-25 10:30:20 +08:00
|
|
|
);
|
2024-02-07 00:20:06 +08:00
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@override
|
2024-04-17 21:40:08 +08:00
|
|
|
Future<void> write({required int rsPid, required String data, dynamic hint}) {
|
2024-04-16 22:34:50 +08:00
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
2024-04-17 21:40:08 +08:00
|
|
|
var arg0 = cst_encode_u_32(rsPid);
|
2024-04-16 22:34:50 +08:00
|
|
|
var arg1 = cst_encode_String(data);
|
2024-04-17 21:40:08 +08:00
|
|
|
return wire.wire_write(port_, arg0, arg1);
|
2024-04-16 22:34:50 +08:00
|
|
|
},
|
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_unit,
|
|
|
|
decodeErrorData: null,
|
|
|
|
),
|
2024-04-17 21:40:08 +08:00
|
|
|
constMeta: kWriteConstMeta,
|
|
|
|
argValues: [rsPid, data],
|
2024-04-16 22:34:50 +08:00
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2024-04-17 21:40:08 +08:00
|
|
|
TaskConstMeta get kWriteConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "write",
|
|
|
|
argNames: ["rsPid", "data"],
|
2024-04-16 22:34:50 +08:00
|
|
|
);
|
|
|
|
|
2024-04-28 22:28:48 +08:00
|
|
|
@override
|
|
|
|
Future<void> sendNotify(
|
|
|
|
{String? summary,
|
|
|
|
String? body,
|
|
|
|
String? appName,
|
|
|
|
String? appId,
|
|
|
|
dynamic hint}) {
|
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
|
|
|
var arg0 = cst_encode_opt_String(summary);
|
|
|
|
var arg1 = cst_encode_opt_String(body);
|
|
|
|
var arg2 = cst_encode_opt_String(appName);
|
|
|
|
var arg3 = cst_encode_opt_String(appId);
|
|
|
|
return wire.wire_send_notify(port_, arg0, arg1, arg2, arg3);
|
|
|
|
},
|
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_unit,
|
|
|
|
decodeErrorData: dco_decode_AnyhowException,
|
|
|
|
),
|
|
|
|
constMeta: kSendNotifyConstMeta,
|
|
|
|
argValues: [summary, body, appName, appId],
|
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
TaskConstMeta get kSendNotifyConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "send_notify",
|
|
|
|
argNames: ["summary", "body", "appName", "appId"],
|
|
|
|
);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<bool> setForegroundWindow({required String windowName, dynamic hint}) {
|
|
|
|
return handler.executeNormal(NormalTask(
|
|
|
|
callFfi: (port_) {
|
|
|
|
var arg0 = cst_encode_String(windowName);
|
|
|
|
return wire.wire_set_foreground_window(port_, arg0);
|
|
|
|
},
|
|
|
|
codec: DcoCodec(
|
|
|
|
decodeSuccessData: dco_decode_bool,
|
|
|
|
decodeErrorData: dco_decode_AnyhowException,
|
|
|
|
),
|
|
|
|
constMeta: kSetForegroundWindowConstMeta,
|
|
|
|
argValues: [windowName],
|
|
|
|
apiImpl: this,
|
|
|
|
hint: hint,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
TaskConstMeta get kSetForegroundWindowConstMeta => const TaskConstMeta(
|
|
|
|
debugName: "set_foreground_window",
|
|
|
|
argNames: ["windowName"],
|
|
|
|
);
|
|
|
|
|
2024-02-15 21:24:39 +08:00
|
|
|
@protected
|
|
|
|
AnyhowException dco_decode_AnyhowException(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return AnyhowException(raw as String);
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
Map<String, String> dco_decode_Map_String_String(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return Map.fromEntries(dco_decode_list_record_string_string(raw)
|
|
|
|
.map((e) => MapEntry(e.$1, e.$2)));
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
RustStreamSink<RsProcessStreamData>
|
|
|
|
dco_decode_StreamSink_rs_process_stream_data_Dco(dynamic raw) {
|
2024-04-11 19:52:13 +08:00
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
String dco_decode_String(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as String;
|
|
|
|
}
|
|
|
|
|
2024-04-28 21:50:36 +08:00
|
|
|
@protected
|
|
|
|
bool dco_decode_bool(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as bool;
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
RsiLauncherAsarData dco_decode_box_autoadd_rsi_launcher_asar_data(
|
|
|
|
dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return dco_decode_rsi_launcher_asar_data(raw);
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
int dco_decode_box_autoadd_u_64(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return dco_decode_u_64(raw);
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
int dco_decode_i_32(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as int;
|
|
|
|
}
|
|
|
|
|
2024-02-07 22:19:43 +08:00
|
|
|
@protected
|
|
|
|
List<String> dco_decode_list_String(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return (raw as List<dynamic>).map(dco_decode_String).toList();
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
List<int> dco_decode_list_prim_u_8_loose(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as List<int>;
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as Uint8List;
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
List<(String, String)> dco_decode_list_record_string_string(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return (raw as List<dynamic>).map(dco_decode_record_string_string).toList();
|
|
|
|
}
|
|
|
|
|
2024-03-10 20:28:24 +08:00
|
|
|
@protected
|
|
|
|
MyHttpVersion dco_decode_my_http_version(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return MyHttpVersion.values[raw as int];
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
MyMethod dco_decode_my_method(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return MyMethod.values[raw as int];
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
Map<String, String>? dco_decode_opt_Map_String_String(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw == null ? null : dco_decode_Map_String_String(raw);
|
|
|
|
}
|
|
|
|
|
2024-03-12 20:07:06 +08:00
|
|
|
@protected
|
|
|
|
String? dco_decode_opt_String(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw == null ? null : dco_decode_String(raw);
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
2024-02-07 19:32:36 +08:00
|
|
|
int? dco_decode_opt_box_autoadd_u_64(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw == null ? null : dco_decode_box_autoadd_u_64(raw);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
Uint8List? dco_decode_opt_list_prim_u_8_strict(dynamic raw) {
|
2024-02-07 00:20:06 +08:00
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
2024-02-07 19:32:36 +08:00
|
|
|
return raw == null ? null : dco_decode_list_prim_u_8_strict(raw);
|
2024-02-07 00:20:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
(String, String) dco_decode_record_string_string(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
final arr = raw as List<dynamic>;
|
|
|
|
if (arr.length != 2) {
|
|
|
|
throw Exception('Expected 2 elements, got ${arr.length}');
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
dco_decode_String(arr[0]),
|
|
|
|
dco_decode_String(arr[1]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
RsProcessStreamData dco_decode_rs_process_stream_data(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
final arr = raw as List<dynamic>;
|
2024-04-17 21:40:08 +08:00
|
|
|
if (arr.length != 3)
|
|
|
|
throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
|
2024-04-16 22:34:50 +08:00
|
|
|
return RsProcessStreamData(
|
|
|
|
dataType: dco_decode_rs_process_stream_data_type(arr[0]),
|
|
|
|
data: dco_decode_String(arr[1]),
|
2024-04-17 21:40:08 +08:00
|
|
|
rsPid: dco_decode_u_32(arr[2]),
|
2024-04-16 22:34:50 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
RsProcessStreamDataType dco_decode_rs_process_stream_data_type(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return RsProcessStreamDataType.values[raw as int];
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
RsiLauncherAsarData dco_decode_rsi_launcher_asar_data(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
final arr = raw as List<dynamic>;
|
|
|
|
if (arr.length != 3)
|
|
|
|
throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
|
|
|
|
return RsiLauncherAsarData(
|
|
|
|
asarPath: dco_decode_String(arr[0]),
|
|
|
|
mainJsPath: dco_decode_String(arr[1]),
|
|
|
|
mainJsContent: dco_decode_list_prim_u_8_strict(arr[2]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
RustHttpResponse dco_decode_rust_http_response(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
final arr = raw as List<dynamic>;
|
|
|
|
if (arr.length != 7)
|
|
|
|
throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
|
|
|
|
return RustHttpResponse(
|
|
|
|
statusCode: dco_decode_u_16(arr[0]),
|
|
|
|
headers: dco_decode_Map_String_String(arr[1]),
|
|
|
|
url: dco_decode_String(arr[2]),
|
|
|
|
contentLength: dco_decode_opt_box_autoadd_u_64(arr[3]),
|
2024-03-10 20:28:24 +08:00
|
|
|
version: dco_decode_my_http_version(arr[4]),
|
2024-02-07 19:32:36 +08:00
|
|
|
remoteAddr: dco_decode_String(arr[5]),
|
|
|
|
data: dco_decode_opt_list_prim_u_8_strict(arr[6]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
int dco_decode_u_16(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as int;
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
int dco_decode_u_32(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as int;
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
int dco_decode_u_64(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return dcoDecodeI64OrU64(raw);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
int dco_decode_u_8(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return raw as int;
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void dco_decode_unit(dynamic raw) {
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-02-15 21:24:39 +08:00
|
|
|
@protected
|
|
|
|
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var inner = sse_decode_String(deserializer);
|
|
|
|
return AnyhowException(inner);
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
Map<String, String> sse_decode_Map_String_String(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var inner = sse_decode_list_record_string_string(deserializer);
|
|
|
|
return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2)));
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
RustStreamSink<RsProcessStreamData>
|
|
|
|
sse_decode_StreamSink_rs_process_stream_data_Dco(
|
|
|
|
SseDeserializer deserializer) {
|
2024-04-11 19:52:13 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
throw UnimplementedError('Unreachable ()');
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
String sse_decode_String(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var inner = sse_decode_list_prim_u_8_strict(deserializer);
|
|
|
|
return utf8.decoder.convert(inner);
|
|
|
|
}
|
|
|
|
|
2024-04-28 21:50:36 +08:00
|
|
|
@protected
|
|
|
|
bool sse_decode_bool(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return deserializer.buffer.getUint8() != 0;
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
RsiLauncherAsarData sse_decode_box_autoadd_rsi_launcher_asar_data(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return (sse_decode_rsi_launcher_asar_data(deserializer));
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
int sse_decode_box_autoadd_u_64(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return (sse_decode_u_64(deserializer));
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
int sse_decode_i_32(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return deserializer.buffer.getInt32();
|
|
|
|
}
|
|
|
|
|
2024-02-07 22:19:43 +08:00
|
|
|
@protected
|
|
|
|
List<String> sse_decode_list_String(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
var len_ = sse_decode_i_32(deserializer);
|
|
|
|
var ans_ = <String>[];
|
|
|
|
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
|
|
|
ans_.add(sse_decode_String(deserializer));
|
|
|
|
}
|
|
|
|
return ans_;
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
List<int> sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var len_ = sse_decode_i_32(deserializer);
|
|
|
|
return deserializer.buffer.getUint8List(len_);
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var len_ = sse_decode_i_32(deserializer);
|
|
|
|
return deserializer.buffer.getUint8List(len_);
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
List<(String, String)> sse_decode_list_record_string_string(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
var len_ = sse_decode_i_32(deserializer);
|
|
|
|
var ans_ = <(String, String)>[];
|
|
|
|
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
|
|
|
ans_.add(sse_decode_record_string_string(deserializer));
|
|
|
|
}
|
|
|
|
return ans_;
|
|
|
|
}
|
|
|
|
|
2024-03-10 20:28:24 +08:00
|
|
|
@protected
|
|
|
|
MyHttpVersion sse_decode_my_http_version(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var inner = sse_decode_i_32(deserializer);
|
|
|
|
return MyHttpVersion.values[inner];
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
MyMethod sse_decode_my_method(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var inner = sse_decode_i_32(deserializer);
|
|
|
|
return MyMethod.values[inner];
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
Map<String, String>? sse_decode_opt_Map_String_String(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
if (sse_decode_bool(deserializer)) {
|
|
|
|
return (sse_decode_Map_String_String(deserializer));
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-12 20:07:06 +08:00
|
|
|
@protected
|
|
|
|
String? sse_decode_opt_String(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
if (sse_decode_bool(deserializer)) {
|
|
|
|
return (sse_decode_String(deserializer));
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
2024-02-07 19:32:36 +08:00
|
|
|
int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
if (sse_decode_bool(deserializer)) {
|
|
|
|
return (sse_decode_box_autoadd_u_64(deserializer));
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
Uint8List? sse_decode_opt_list_prim_u_8_strict(SseDeserializer deserializer) {
|
2024-02-07 00:20:06 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
if (sse_decode_bool(deserializer)) {
|
2024-02-07 19:32:36 +08:00
|
|
|
return (sse_decode_list_prim_u_8_strict(deserializer));
|
2024-02-07 00:20:06 +08:00
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
(String, String) sse_decode_record_string_string(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var var_field0 = sse_decode_String(deserializer);
|
|
|
|
var var_field1 = sse_decode_String(deserializer);
|
|
|
|
return (var_field0, var_field1);
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
RsProcessStreamData sse_decode_rs_process_stream_data(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var var_dataType = sse_decode_rs_process_stream_data_type(deserializer);
|
|
|
|
var var_data = sse_decode_String(deserializer);
|
2024-04-17 21:40:08 +08:00
|
|
|
var var_rsPid = sse_decode_u_32(deserializer);
|
|
|
|
return RsProcessStreamData(
|
|
|
|
dataType: var_dataType, data: var_data, rsPid: var_rsPid);
|
2024-04-16 22:34:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
RsProcessStreamDataType sse_decode_rs_process_stream_data_type(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var inner = sse_decode_i_32(deserializer);
|
|
|
|
return RsProcessStreamDataType.values[inner];
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
RsiLauncherAsarData sse_decode_rsi_launcher_asar_data(
|
|
|
|
SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var var_asarPath = sse_decode_String(deserializer);
|
|
|
|
var var_mainJsPath = sse_decode_String(deserializer);
|
|
|
|
var var_mainJsContent = sse_decode_list_prim_u_8_strict(deserializer);
|
|
|
|
return RsiLauncherAsarData(
|
|
|
|
asarPath: var_asarPath,
|
|
|
|
mainJsPath: var_mainJsPath,
|
|
|
|
mainJsContent: var_mainJsContent);
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
RustHttpResponse sse_decode_rust_http_response(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
var var_statusCode = sse_decode_u_16(deserializer);
|
|
|
|
var var_headers = sse_decode_Map_String_String(deserializer);
|
|
|
|
var var_url = sse_decode_String(deserializer);
|
|
|
|
var var_contentLength = sse_decode_opt_box_autoadd_u_64(deserializer);
|
2024-03-10 20:28:24 +08:00
|
|
|
var var_version = sse_decode_my_http_version(deserializer);
|
2024-02-07 19:32:36 +08:00
|
|
|
var var_remoteAddr = sse_decode_String(deserializer);
|
|
|
|
var var_data = sse_decode_opt_list_prim_u_8_strict(deserializer);
|
|
|
|
return RustHttpResponse(
|
|
|
|
statusCode: var_statusCode,
|
|
|
|
headers: var_headers,
|
|
|
|
url: var_url,
|
|
|
|
contentLength: var_contentLength,
|
|
|
|
version: var_version,
|
|
|
|
remoteAddr: var_remoteAddr,
|
|
|
|
data: var_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
int sse_decode_u_16(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return deserializer.buffer.getUint16();
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
int sse_decode_u_32(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return deserializer.buffer.getUint32();
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
int sse_decode_u_64(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return deserializer.buffer.getUint64();
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
int sse_decode_u_8(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
return deserializer.buffer.getUint8();
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void sse_decode_unit(SseDeserializer deserializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
2024-04-28 21:50:36 +08:00
|
|
|
bool cst_encode_bool(bool raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return raw;
|
2024-02-06 20:19:53 +08:00
|
|
|
}
|
|
|
|
|
2024-03-13 22:41:28 +08:00
|
|
|
@protected
|
|
|
|
int cst_encode_i_32(int raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return raw;
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
int cst_encode_my_http_version(MyHttpVersion raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return cst_encode_i_32(raw.index);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
int cst_encode_my_method(MyMethod raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return cst_encode_i_32(raw.index);
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
int cst_encode_rs_process_stream_data_type(RsProcessStreamDataType raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return cst_encode_i_32(raw.index);
|
|
|
|
}
|
|
|
|
|
2024-03-13 22:41:28 +08:00
|
|
|
@protected
|
|
|
|
int cst_encode_u_16(int raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return raw;
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
int cst_encode_u_32(int raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return raw;
|
|
|
|
}
|
|
|
|
|
2024-03-13 22:41:28 +08:00
|
|
|
@protected
|
|
|
|
int cst_encode_u_8(int raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return raw;
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void cst_encode_unit(void raw) {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
return raw;
|
|
|
|
}
|
|
|
|
|
2024-02-15 21:24:39 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_AnyhowException(
|
|
|
|
AnyhowException self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
2024-04-11 19:52:13 +08:00
|
|
|
throw UnimplementedError('Unreachable ()');
|
2024-02-15 21:24:39 +08:00
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_Map_String_String(
|
|
|
|
Map<String, String> self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_list_record_string_string(
|
|
|
|
self.entries.map((e) => (e.key, e.value)).toList(), serializer);
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_StreamSink_rs_process_stream_data_Dco(
|
|
|
|
RustStreamSink<RsProcessStreamData> self, SseSerializer serializer) {
|
2024-04-11 19:52:13 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_String(
|
|
|
|
self.setupAndSerialize(
|
|
|
|
codec: DcoCodec(
|
2024-04-16 22:34:50 +08:00
|
|
|
decodeSuccessData: dco_decode_rs_process_stream_data,
|
|
|
|
decodeErrorData: null)),
|
2024-04-11 19:52:13 +08:00
|
|
|
serializer);
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_String(String self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer);
|
|
|
|
}
|
|
|
|
|
2024-04-28 21:50:36 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_bool(bool self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
serializer.buffer.putUint8(self ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_box_autoadd_rsi_launcher_asar_data(
|
|
|
|
RsiLauncherAsarData self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_rsi_launcher_asar_data(self, serializer);
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_u_64(self, serializer);
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_i_32(int self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
serializer.buffer.putInt32(self);
|
|
|
|
}
|
|
|
|
|
2024-02-07 22:19:43 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_list_String(List<String> 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_String(item, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_list_prim_u_8_loose(
|
|
|
|
List<int> self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_i_32(self.length, serializer);
|
|
|
|
serializer.buffer
|
|
|
|
.putUint8List(self is Uint8List ? self : Uint8List.fromList(self));
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_list_prim_u_8_strict(
|
|
|
|
Uint8List self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_i_32(self.length, serializer);
|
|
|
|
serializer.buffer.putUint8List(self);
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_list_record_string_string(
|
|
|
|
List<(String, String)> 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_record_string_string(item, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 20:28:24 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_my_http_version(
|
|
|
|
MyHttpVersion self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_i_32(self.index, serializer);
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_my_method(MyMethod self, SseSerializer serializer) {
|
2024-02-06 20:19:53 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_i_32(self.index, serializer);
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_opt_Map_String_String(
|
|
|
|
Map<String, 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_Map_String_String(self, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-12 20:07:06 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_opt_String(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_String(self, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
@protected
|
2024-02-07 19:32:36 +08:00
|
|
|
void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
sse_encode_bool(self != null, serializer);
|
|
|
|
if (self != null) {
|
|
|
|
sse_encode_box_autoadd_u_64(self, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void sse_encode_opt_list_prim_u_8_strict(
|
|
|
|
Uint8List? self, SseSerializer serializer) {
|
2024-02-07 00:20:06 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
|
|
|
|
sse_encode_bool(self != null, serializer);
|
|
|
|
if (self != null) {
|
2024-02-07 19:32:36 +08:00
|
|
|
sse_encode_list_prim_u_8_strict(self, serializer);
|
2024-02-07 00:20:06 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void sse_encode_record_string_string(
|
|
|
|
(String, String) self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_String(self.$1, serializer);
|
|
|
|
sse_encode_String(self.$2, serializer);
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_rs_process_stream_data(
|
|
|
|
RsProcessStreamData self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_rs_process_stream_data_type(self.dataType, serializer);
|
|
|
|
sse_encode_String(self.data, serializer);
|
2024-04-17 21:40:08 +08:00
|
|
|
sse_encode_u_32(self.rsPid, serializer);
|
2024-04-16 22:34:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void sse_encode_rs_process_stream_data_type(
|
|
|
|
RsProcessStreamDataType self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_i_32(self.index, serializer);
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_rsi_launcher_asar_data(
|
|
|
|
RsiLauncherAsarData self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_String(self.asarPath, serializer);
|
|
|
|
sse_encode_String(self.mainJsPath, serializer);
|
|
|
|
sse_encode_list_prim_u_8_strict(self.mainJsContent, serializer);
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_rust_http_response(
|
|
|
|
RustHttpResponse self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
sse_encode_u_16(self.statusCode, serializer);
|
|
|
|
sse_encode_Map_String_String(self.headers, serializer);
|
|
|
|
sse_encode_String(self.url, serializer);
|
|
|
|
sse_encode_opt_box_autoadd_u_64(self.contentLength, serializer);
|
2024-03-10 20:28:24 +08:00
|
|
|
sse_encode_my_http_version(self.version, serializer);
|
2024-02-07 19:32:36 +08:00
|
|
|
sse_encode_String(self.remoteAddr, serializer);
|
|
|
|
sse_encode_opt_list_prim_u_8_strict(self.data, serializer);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void sse_encode_u_16(int self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
serializer.buffer.putUint16(self);
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_u_32(int self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
serializer.buffer.putUint32(self);
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
@protected
|
|
|
|
void sse_encode_u_64(int self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
serializer.buffer.putUint64(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void sse_encode_u_8(int self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
serializer.buffer.putUint8(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
@protected
|
|
|
|
void sse_encode_unit(void self, SseSerializer serializer) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
}
|
|
|
|
}
|