diff --git a/lib/common/helper/system_helper.dart b/lib/common/helper/system_helper.dart index 306ee6a..1fd3096 100644 --- a/lib/common/helper/system_helper.dart +++ b/lib/common/helper/system_helper.dart @@ -258,7 +258,7 @@ foreach ($adapter in $adapterMemory) { static Future openDir(path, {bool isFile = false}) async { dPrint("SystemHelper.openDir path === $path"); await Process.run( - SystemHelper.powershellPath, ["explorer.exe", isFile ? "/select,${path}" : "/select,\"\"$path\"\""]); + SystemHelper.powershellPath, ["explorer.exe", isFile ? "/select,$path" : "/select,\"\"$path\"\""]); } static String getHostsFilePath() { diff --git a/lib/common/rust/api/http_api.dart b/lib/common/rust/api/http_api.dart index 93422ba..6a293be 100644 --- a/lib/common/rust/api/http_api.dart +++ b/lib/common/rust/api/http_api.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/common/rust/api/process_api.dart b/lib/common/rust/api/process_api.dart index 7ef8ed6..ba7ad3b 100644 --- a/lib/common/rust/api/process_api.dart +++ b/lib/common/rust/api/process_api.dart @@ -1,12 +1,12 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // 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'; -Stream startProcess( +Future> startProcess( {required String executable, required List arguments, required String workingDirectory, diff --git a/lib/common/rust/frb_generated.dart b/lib/common/rust/frb_generated.dart index 2d75907..45cf6e1 100644 --- a/lib/common/rust/frb_generated.dart +++ b/lib/common/rust/frb_generated.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // 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 @@ -53,7 +53,7 @@ class RustLib extends BaseEntrypoint { kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.0.0-dev.28'; + String get codegenVersion => '2.0.0-dev.31'; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( @@ -79,7 +79,7 @@ abstract class RustLibApi extends BaseApi { Future setDefaultHeader( {required Map headers, dynamic hint}); - Stream startProcess( + Future> startProcess( {required String executable, required List arguments, required String workingDirectory, @@ -198,32 +198,35 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Stream startProcess( + Future> startProcess( {required String executable, required List arguments, required String workingDirectory, - dynamic hint}) { - return handler.executeStream(StreamTask( + dynamic hint}) async { + final streamSink = RustStreamSink(); + await handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_String(executable); var arg1 = cst_encode_list_String(arguments); var arg2 = cst_encode_String(workingDirectory); - return wire.wire_start_process(port_, arg0, arg1, arg2); + var arg3 = cst_encode_StreamSink_String_Dco(streamSink); + return wire.wire_start_process(port_, arg0, arg1, arg2, arg3); }, codec: DcoCodec( - decodeSuccessData: dco_decode_String, + decodeSuccessData: dco_decode_unit, decodeErrorData: null, ), constMeta: kStartProcessConstMeta, - argValues: [executable, arguments, workingDirectory], + argValues: [executable, arguments, workingDirectory, streamSink], apiImpl: this, hint: hint, )); + return streamSink.stream; } TaskConstMeta get kStartProcessConstMeta => const TaskConstMeta( debugName: "start_process", - argNames: ["executable", "arguments", "workingDirectory"], + argNames: ["executable", "arguments", "workingDirectory", "streamSink"], ); @protected @@ -239,6 +242,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { .map((e) => MapEntry(e.$1, e.$2))); } + @protected + RustStreamSink dco_decode_StreamSink_String_Dco(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + throw UnimplementedError(); + } + @protected String dco_decode_String(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -380,6 +389,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2))); } + @protected + RustStreamSink sse_decode_StreamSink_String_Dco( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + throw UnimplementedError('Unreachable ()'); + } + @protected String sse_decode_String(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -588,7 +604,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { void sse_encode_AnyhowException( AnyhowException self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - throw UnimplementedError('Unreachable (('); + throw UnimplementedError('Unreachable ()'); } @protected @@ -599,6 +615,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { self.entries.map((e) => (e.key, e.value)).toList(), serializer); } + @protected + void sse_encode_StreamSink_String_Dco( + RustStreamSink self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String( + self.setupAndSerialize( + codec: DcoCodec( + decodeSuccessData: dco_decode_String, decodeErrorData: null)), + serializer); + } + @protected void sse_encode_String(String self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs diff --git a/lib/common/rust/frb_generated.io.dart b/lib/common/rust/frb_generated.io.dart index fcc3bed..7617522 100644 --- a/lib/common/rust/frb_generated.io.dart +++ b/lib/common/rust/frb_generated.io.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // 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 @@ -26,6 +26,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected Map dco_decode_Map_String_String(dynamic raw); + @protected + RustStreamSink dco_decode_StreamSink_String_Dco(dynamic raw); + @protected String dco_decode_String(dynamic raw); @@ -87,6 +90,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { Map sse_decode_Map_String_String( SseDeserializer deserializer); + @protected + RustStreamSink sse_decode_StreamSink_String_Dco( + SseDeserializer deserializer); + @protected String sse_decode_String(SseDeserializer deserializer); @@ -162,6 +169,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { raw.entries.map((e) => (e.key, e.value)).toList()); } + @protected + ffi.Pointer cst_encode_StreamSink_String_Dco( + RustStreamSink raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_String(raw.setupAndSerialize( + codec: DcoCodec( + decodeSuccessData: dco_decode_String, decodeErrorData: null))); + } + @protected ffi.Pointer cst_encode_String(String raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -283,6 +299,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { void sse_encode_Map_String_String( Map self, SseSerializer serializer); + @protected + void sse_encode_StreamSink_String_Dco( + RustStreamSink self, SseSerializer serializer); + @protected void sse_encode_String(String self, SseSerializer serializer); @@ -484,12 +504,14 @@ class RustLibWire implements BaseWire { ffi.Pointer executable, ffi.Pointer arguments, ffi.Pointer working_directory, + ffi.Pointer stream_sink, ) { return _wire_start_process( port_, executable, arguments, working_directory, + stream_sink, ); } @@ -499,6 +521,7 @@ class RustLibWire implements BaseWire { ffi.Int64, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( 'frbgen_starcitizen_doctor_wire_start_process'); late final _wire_start_process = _wire_start_processPtr.asFunction< @@ -506,6 +529,7 @@ class RustLibWire implements BaseWire { int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cst_new_box_autoadd_u_64( diff --git a/lib/common/rust/http_package.dart b/lib/common/rust/http_package.dart index 5235fb4..3fd4a02 100644 --- a/lib/common/rust/http_package.dart +++ b/lib/common/rust/http_package.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/lib/common/win32/credentials.dart b/lib/common/win32/credentials.dart index fac568a..2777cd7 100644 --- a/lib/common/win32/credentials.dart +++ b/lib/common/win32/credentials.dart @@ -11,7 +11,6 @@ import 'package:ffi/ffi.dart'; import 'package:starcitizen_doctor/common/utils/log.dart'; import 'package:win32/win32.dart'; - class Win32Credentials { static void write( {required String credentialName, @@ -21,9 +20,9 @@ class Win32Credentials { final blob = examplePassword.allocatePointer(); final credential = calloc() - ..ref.Type = CRED_TYPE_GENERIC + ..ref.Type = CRED_TYPE.CRED_TYPE_GENERIC ..ref.TargetName = credentialName.toNativeUtf16() - ..ref.Persist = CRED_PERSIST_LOCAL_MACHINE + ..ref.Persist = CRED_PERSIST.CRED_PERSIST_LOCAL_MACHINE ..ref.UserName = userName.toNativeUtf16() ..ref.CredentialBlob = blob ..ref.CredentialBlobSize = examplePassword.length; @@ -44,12 +43,12 @@ class Win32Credentials { static MapEntry? read(String credentialName) { dPrint('Reading $credentialName ...'); final credPointer = calloc>(); - final result = CredRead( - credentialName.toNativeUtf16(), CRED_TYPE_GENERIC, 0, credPointer); + final result = CredRead(credentialName.toNativeUtf16(), + CRED_TYPE.CRED_TYPE_GENERIC, 0, credPointer); if (result != TRUE) { final errorCode = GetLastError(); var errorText = '$errorCode'; - if (errorCode == ERROR_NOT_FOUND) { + if (errorCode == WIN32_ERROR.ERROR_NOT_FOUND) { errorText += ' Not found.'; } dPrint('Error ($result): $errorText'); @@ -65,8 +64,8 @@ class Win32Credentials { static void delete(String credentialName) { dPrint('Deleting $credentialName'); - final result = - CredDelete(credentialName.toNativeUtf16(), CRED_TYPE_GENERIC, 0); + final result = CredDelete( + credentialName.toNativeUtf16(), CRED_TYPE.CRED_TYPE_GENERIC, 0); if (result != TRUE) { final errorCode = GetLastError(); dPrint('Error ($result): $errorCode'); diff --git a/lib/generated/intl/messages_ja.dart b/lib/generated/intl/messages_ja.dart index 0362f9b..8fa614e 100644 --- a/lib/generated/intl/messages_ja.dart +++ b/lib/generated/intl/messages_ja.dart @@ -22,10 +22,132 @@ class MessageLookup extends MessageLookupByLibrary { static String m2(v0, v1) => "SCToolBox V ${v0} ${v1}"; + static String m19(v0, v1) => "ダウンロード: ${v0}/s アップロード:${v1}/s"; + + static String m20(v0) => "ダウンロード済み:${v0}"; + + static String m21(v0) => "ダウンロード... (${v0}%)"; + + static String m22(v0) => "ステータス:${v0}"; + + static String m23(v1) => "サイズ合計:${v1}"; + + static String m24(v0) => "アップロード済み:${v0}"; + + static String m25(v2) => "検証中...(${v2})"; + + static String m31(v1, v2) => + "RSI サーバレポートのバージョン:${v1} \n\nローカルのバージョン:${v2} \n\nRSI Launcher を使ってゲームをアップデートしてください!"; + final messages = _notInlinedMessages(_notInlinedMessages); static Map _notInlinedMessages(_) => { + "about_action_email": + MessageLookupByLibrary.simpleMessage("メール: xkeyc@qq.com"), + "about_action_open_source": + MessageLookupByLibrary.simpleMessage("オープンソース"), + "about_analytics_install_translation": + MessageLookupByLibrary.simpleMessage("日本語化インストール"), + "about_analytics_launch": MessageLookupByLibrary.simpleMessage("起動"), + "about_analytics_launch_game": + MessageLookupByLibrary.simpleMessage("ゲームを起動"), + "about_analytics_p4k_redirection": + MessageLookupByLibrary.simpleMessage("P4Kダウンロード"), + "about_analytics_total_users": + MessageLookupByLibrary.simpleMessage("利用者数"), + "about_analytics_units_times": + MessageLookupByLibrary.simpleMessage("回"), + "about_analytics_units_user": MessageLookupByLibrary.simpleMessage("人"), + "about_check_update": MessageLookupByLibrary.simpleMessage("更新チェック"), + "about_disclaimer": MessageLookupByLibrary.simpleMessage( + "これは Star Citizen の非公式ツールです、Cloud Imperium Games LLC の所有ではない。 本ソフトウェアのホストまたは使用者によって作成されていないすべての情報は、それぞれの所有者に帰属します。 \nStar Citizen®、Roberts Space Industries®、Cloud Imperium® は Cloud Imperium Rights LLC のトレードマーク。"), + "about_info_latest_version": + MessageLookupByLibrary.simpleMessage("すでに最新バージョンだ!"), + "about_online_feedback": + MessageLookupByLibrary.simpleMessage("フィードバック"), + "action_close": MessageLookupByLibrary.simpleMessage("クローズ"), + "action_open_folder": MessageLookupByLibrary.simpleMessage("フォルダを開く"), "app_index_version_info": m2, "app_language_code": MessageLookupByLibrary.simpleMessage("ja"), - "app_language_name": MessageLookupByLibrary.simpleMessage("日本語") + "app_language_name": MessageLookupByLibrary.simpleMessage("日本語"), + "downloader_action_cancel_all": + MessageLookupByLibrary.simpleMessage("すべてキャンセル"), + "downloader_action_cancel_download": + MessageLookupByLibrary.simpleMessage("ダウンロードをキャンセル"), + "downloader_action_confirm_cancel_all_tasks": + MessageLookupByLibrary.simpleMessage("すべてのタスクのキャンセルを確認する?"), + "downloader_action_confirm_cancel_download": + MessageLookupByLibrary.simpleMessage("ダウンロードのキャンセルを確認しますか?"), + "downloader_action_continue_download": + MessageLookupByLibrary.simpleMessage("ダウンロードを続ける"), + "downloader_action_options": + MessageLookupByLibrary.simpleMessage("オプション"), + "downloader_action_pause_all": + MessageLookupByLibrary.simpleMessage("すべて一時停止"), + "downloader_action_pause_download": + MessageLookupByLibrary.simpleMessage("ダウンロードの一時停止"), + "downloader_action_resume_all": + MessageLookupByLibrary.simpleMessage("すべて復元"), + "downloader_info_deleted": MessageLookupByLibrary.simpleMessage("削除済み"), + "downloader_info_download_completed": + MessageLookupByLibrary.simpleMessage("ダウンロード完了"), + "downloader_info_download_failed": + MessageLookupByLibrary.simpleMessage("ダウンロード失敗"), + "downloader_info_download_upload_speed": m19, + "downloader_info_downloaded": m20, + "downloader_info_downloading": m21, + "downloader_info_downloading_status": + MessageLookupByLibrary.simpleMessage("ダウンロード中..."), + "downloader_info_manual_file_deletion_note": + MessageLookupByLibrary.simpleMessage( + "ダウンロードしたファイルが不要になった場合は、手動で削除する必要があります。"), + "downloader_info_no_download_tasks": + MessageLookupByLibrary.simpleMessage("ダウンロードタスクなし"), + "downloader_info_paused": MessageLookupByLibrary.simpleMessage("一時停止中"), + "downloader_info_status": m22, + "downloader_info_total_size": m23, + "downloader_info_uploaded": m24, + "downloader_info_verifying": m25, + "downloader_info_waiting": MessageLookupByLibrary.simpleMessage("待機中"), + "downloader_speed_limit_settings": + MessageLookupByLibrary.simpleMessage("速度制限設定"), + "downloader_title_downloading": + MessageLookupByLibrary.simpleMessage("ダウンロード中"), + "downloader_title_ended": MessageLookupByLibrary.simpleMessage("終了"), + "home_action_login_rsi_account": + MessageLookupByLibrary.simpleMessage("RSI アカウントログイン"), + "home_action_one_click_launch": + MessageLookupByLibrary.simpleMessage("ワンクリック起動"), + "home_action_q_auto_password_fill_prompt": + MessageLookupByLibrary.simpleMessage("パスワードの自動入力はオンになっていますか?"), + "home_holiday_countdown": + MessageLookupByLibrary.simpleMessage("祝日カウントダウン"), + "home_holiday_countdown_disclaimer": + MessageLookupByLibrary.simpleMessage( + "* 上記の祝日は手作業で収集・管理されているため、誤りがある可能性があります、フィードバックは歓迎する!!"), + "home_info_auto_fill_notice": MessageLookupByLibrary.simpleMessage( + "* 自動入力がオンになっている場合は、Windows Hello のポップアップに注意してください"), + "home_login_action_title_box_one_click_launch": + MessageLookupByLibrary.simpleMessage("ボックスワンクリック起動"), + "home_login_action_title_need_webview2_runtime": + MessageLookupByLibrary.simpleMessage("WebView2 Runtime のインストールが必要"), + "home_login_info_action_ignore": + MessageLookupByLibrary.simpleMessage("無視する"), + "home_login_info_enter_pin_to_encrypt": + MessageLookupByLibrary.simpleMessage("PINを入力して暗号化を有効にする"), + "home_login_info_game_version_outdated": + MessageLookupByLibrary.simpleMessage("ゲームバージョンが古すぎる"), + "home_login_info_one_click_launch_description": + MessageLookupByLibrary.simpleMessage( + "この機能は、ゲームをより便利に起動するのに役立ちます。\n\nアカウントのセキュリティを確保するため、この機能はローカライズブラウザを使用してログイン状態を保持し、パスワード情報を保存しません(自動入力オンの場合を除く)。\n\nこの機能を使用してアカウントにログインする際は、SCToolBox が信頼できるソースからダウンロードされていることを確認してください。"), + "home_login_info_password_encryption_notice": + MessageLookupByLibrary.simpleMessage( + "このツールには PIN と Windows 認証を使用して暗号化のパスワードが保存され、パスワードはローカルのみ保存されます。\n\n次回のログインでパスワードが必要になった場合、PIN だけてを許可する後、パスワードは自動的に入力して、ログインできます。"), + "home_login_info_rsi_server_report": m31, + "home_login_title_launching_game": + MessageLookupByLibrary.simpleMessage("ゲーム起動中..."), + "home_login_title_welcome_back": + MessageLookupByLibrary.simpleMessage("お帰りなさい!"), + "home_title_logging_in": + MessageLookupByLibrary.simpleMessage("ログイン中...") }; } diff --git a/lib/provider/aria2c.dart b/lib/provider/aria2c.dart index b1263df..09573a3 100644 --- a/lib/provider/aria2c.dart +++ b/lib/provider/aria2c.dart @@ -98,7 +98,7 @@ class Aria2cModel extends _$Aria2cModel { dPrint("trackerList === $trackerList"); dPrint("Aria2cManager .----- aria2c start $port------"); - final stream = rs_process.startProcess( + final stream = await rs_process.startProcess( executable: exePath, arguments: [ "-V", diff --git a/pubspec.yaml b/pubspec.yaml index ec90e1a..59e6a96 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,7 +62,7 @@ dependencies: flutter_tilt: ^3.0.0 card_swiper: ^3.0.1 ffi: ^2.1.0 - flutter_rust_bridge: 2.0.0-dev.28 + flutter_rust_bridge: ^2.0.0-dev.31 freezed_annotation: ^2.4.1 meta: ^1.9.1 win32: ^5.0.9 diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 1c6cfd5..0bebbaf 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -11,7 +11,7 @@ strip = "debuginfo" crate-type = ["cdylib", "staticlib"] [dependencies] -flutter_rust_bridge = "=2.0.0-dev.30" +flutter_rust_bridge = "=2.0.0-dev.31" tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "process"] } url = "2.5" async-std = "1.12" diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index b716142..997dd91 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. // Section: imports @@ -31,6 +31,15 @@ impl CstDecode> vec.into_iter().collect() } } +impl CstDecode> + for *mut wire_cst_list_prim_u_8_strict +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> StreamSink { + let raw: String = self.cst_decode(); + StreamSink::deserialize(raw) + } +} impl CstDecode for *mut wire_cst_list_prim_u_8_strict { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> String { @@ -167,8 +176,9 @@ pub extern "C" fn frbgen_starcitizen_doctor_wire_start_process( executable: *mut wire_cst_list_prim_u_8_strict, arguments: *mut wire_cst_list_String, working_directory: *mut wire_cst_list_prim_u_8_strict, + stream_sink: *mut wire_cst_list_prim_u_8_strict, ) { - wire_start_process_impl(port_, executable, arguments, working_directory) + wire_start_process_impl(port_, executable, arguments, working_directory, stream_sink) } #[no_mangle] diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index c2957fe..2eb8438 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31. #![allow( non_camel_case_types, @@ -30,7 +30,7 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueNom, default_rust_auto_opaque = RustAutoOpaqueNom, ); -const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.28"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.31"; // Section: executor @@ -143,17 +143,19 @@ fn wire_start_process_impl( executable: impl CstDecode, arguments: impl CstDecode>, working_directory: impl CstDecode, + stream_sink: impl CstDecode>, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( flutter_rust_bridge::for_generated::TaskInfo { debug_name: "start_process", port: Some(port_), - mode: flutter_rust_bridge::for_generated::FfiCallMode::Stream, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, }, move || { let api_executable = executable.cst_decode(); let api_arguments = arguments.cst_decode(); let api_working_directory = working_directory.cst_decode(); + let api_stream_sink = stream_sink.cst_decode(); move |context| async move { transform_result_dco( (move || async move { @@ -162,9 +164,7 @@ fn wire_start_process_impl( api_executable, api_arguments, api_working_directory, - StreamSink::new( - context.rust2dart_context().stream_sink::<_, String>(), - ), + api_stream_sink, ) .await, ) @@ -248,6 +248,14 @@ impl SseDecode for std::collections::HashMap { } } +impl SseDecode for StreamSink { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return StreamSink::deserialize(inner); + } +} + impl SseDecode for String { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -563,6 +571,13 @@ impl SseEncode for std::collections::HashMap { } } +impl SseEncode for StreamSink { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + unimplemented!("") + } +} + impl SseEncode for String { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {