2024-02-06 20:19:53 +08:00
|
|
|
// This file is automatically generated, so please do not edit it.
|
2024-06-11 19:55:35 +08:00
|
|
|
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38.
|
2024-02-06 20:19:53 +08:00
|
|
|
|
|
|
|
#![allow(
|
|
|
|
non_camel_case_types,
|
|
|
|
unused,
|
|
|
|
non_snake_case,
|
|
|
|
clippy::needless_return,
|
|
|
|
clippy::redundant_closure_call,
|
|
|
|
clippy::redundant_closure,
|
|
|
|
clippy::useless_conversion,
|
|
|
|
clippy::unit_arg,
|
|
|
|
clippy::unused_unit,
|
|
|
|
clippy::double_parens,
|
|
|
|
clippy::let_and_return,
|
|
|
|
clippy::too_many_arguments,
|
2024-05-22 20:05:50 +08:00
|
|
|
clippy::match_single_binding,
|
2024-05-29 21:52:04 +08:00
|
|
|
clippy::clone_on_copy,
|
2024-05-22 20:05:50 +08:00
|
|
|
clippy::let_unit_value
|
2024-02-06 20:19:53 +08:00
|
|
|
)]
|
|
|
|
|
|
|
|
// Section: imports
|
|
|
|
|
|
|
|
use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
|
2024-06-11 19:55:35 +08:00
|
|
|
use flutter_rust_bridge::for_generated::{transform_result_dco, Lockable};
|
2024-02-06 20:19:53 +08:00
|
|
|
use flutter_rust_bridge::{Handler, IntoIntoDart};
|
|
|
|
|
|
|
|
// Section: boilerplate
|
|
|
|
|
|
|
|
flutter_rust_bridge::frb_generated_boilerplate!(
|
2024-03-13 22:41:28 +08:00
|
|
|
default_stream_sink_codec = DcoCodec,
|
|
|
|
default_rust_opaque = RustOpaqueNom,
|
|
|
|
default_rust_auto_opaque = RustAutoOpaqueNom,
|
2024-02-06 20:19:53 +08:00
|
|
|
);
|
2024-06-11 19:55:35 +08:00
|
|
|
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.38";
|
2024-05-01 13:48:37 +08:00
|
|
|
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1832496273;
|
2024-02-06 20:19:53 +08:00
|
|
|
|
|
|
|
// Section: executor
|
|
|
|
|
|
|
|
flutter_rust_bridge::frb_generated_default_handler!();
|
|
|
|
|
|
|
|
// Section: wire_funcs
|
|
|
|
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__asar_api__get_rsi_launcher_asar_data_impl(
|
2024-05-01 13:48:37 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
|
|
|
asar_path: impl CstDecode<String>,
|
|
|
|
) {
|
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
|
|
|
debug_name: "get_rsi_launcher_asar_data",
|
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
|
|
|
let api_asar_path = asar_path.cst_decode();
|
|
|
|
move |context| async move {
|
|
|
|
transform_result_dco(
|
|
|
|
(move || async move {
|
|
|
|
crate::api::asar_api::get_rsi_launcher_asar_data(&api_asar_path).await
|
|
|
|
})()
|
|
|
|
.await,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__asar_api__rsi_launcher_asar_data_write_main_js_impl(
|
2024-05-01 13:48:37 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
|
|
|
that: impl CstDecode<crate::api::asar_api::RsiLauncherAsarData>,
|
|
|
|
content: impl CstDecode<Vec<u8>>,
|
|
|
|
) {
|
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
|
|
|
debug_name: "rsi_launcher_asar_data_write_main_js",
|
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
|
|
|
let api_that = that.cst_decode();
|
|
|
|
let api_content = content.cst_decode();
|
|
|
|
move |context| async move {
|
|
|
|
transform_result_dco(
|
|
|
|
(move || async move {
|
|
|
|
crate::api::asar_api::RsiLauncherAsarData::write_main_js(
|
|
|
|
&api_that,
|
|
|
|
api_content,
|
|
|
|
)
|
|
|
|
.await
|
|
|
|
})()
|
|
|
|
.await,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__http_api__dns_lookup_ips_impl(
|
2024-03-12 20:07:06 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
2024-03-13 22:41:28 +08:00
|
|
|
host: impl CstDecode<String>,
|
2024-03-12 20:07:06 +08:00
|
|
|
) {
|
2024-03-13 22:41:28 +08:00
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
2024-03-12 20:07:06 +08:00
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
|
|
|
debug_name: "dns_lookup_ips",
|
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
2024-03-13 22:41:28 +08:00
|
|
|
let api_host = host.cst_decode();
|
2024-03-12 20:07:06 +08:00
|
|
|
move |context| async move {
|
2024-03-13 22:41:28 +08:00
|
|
|
transform_result_dco(
|
2024-03-12 20:07:06 +08:00
|
|
|
(move || async move { crate::api::http_api::dns_lookup_ips(api_host).await })()
|
|
|
|
.await,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__http_api__dns_lookup_txt_impl(
|
2024-02-07 22:19:43 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
2024-03-13 22:41:28 +08:00
|
|
|
host: impl CstDecode<String>,
|
2024-02-07 22:19:43 +08:00
|
|
|
) {
|
2024-03-13 22:41:28 +08:00
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
2024-02-07 22:19:43 +08:00
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
|
|
|
debug_name: "dns_lookup_txt",
|
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
2024-03-13 22:41:28 +08:00
|
|
|
let api_host = host.cst_decode();
|
2024-02-07 22:19:43 +08:00
|
|
|
move |context| async move {
|
2024-03-13 22:41:28 +08:00
|
|
|
transform_result_dco(
|
2024-02-15 21:24:39 +08:00
|
|
|
(move || async move { crate::api::http_api::dns_lookup_txt(api_host).await })()
|
|
|
|
.await,
|
2024-02-07 22:19:43 +08:00
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__http_api__fetch_impl(
|
2024-02-07 00:20:06 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
2024-03-13 22:41:28 +08:00
|
|
|
method: impl CstDecode<crate::api::http_api::MyMethod>,
|
|
|
|
url: impl CstDecode<String>,
|
|
|
|
headers: impl CstDecode<Option<std::collections::HashMap<String, String>>>,
|
|
|
|
input_data: impl CstDecode<Option<Vec<u8>>>,
|
|
|
|
with_ip_address: impl CstDecode<Option<String>>,
|
2024-02-07 00:20:06 +08:00
|
|
|
) {
|
2024-03-13 22:41:28 +08:00
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
2024-02-07 00:20:06 +08:00
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
2024-02-07 19:32:36 +08:00
|
|
|
debug_name: "fetch",
|
2024-02-07 00:20:06 +08:00
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
2024-03-13 22:41:28 +08:00
|
|
|
let api_method = method.cst_decode();
|
|
|
|
let api_url = url.cst_decode();
|
|
|
|
let api_headers = headers.cst_decode();
|
|
|
|
let api_input_data = input_data.cst_decode();
|
|
|
|
let api_with_ip_address = with_ip_address.cst_decode();
|
2024-02-07 19:32:36 +08:00
|
|
|
move |context| async move {
|
2024-03-13 22:41:28 +08:00
|
|
|
transform_result_dco(
|
2024-02-07 19:32:36 +08:00
|
|
|
(move || async move {
|
2024-02-15 21:24:39 +08:00
|
|
|
crate::api::http_api::fetch(
|
|
|
|
api_method,
|
|
|
|
api_url,
|
|
|
|
api_headers,
|
|
|
|
api_input_data,
|
2024-03-12 20:07:06 +08:00
|
|
|
api_with_ip_address,
|
2024-02-07 19:32:36 +08:00
|
|
|
)
|
2024-02-15 21:24:39 +08:00
|
|
|
.await
|
2024-02-07 19:32:36 +08:00
|
|
|
})()
|
|
|
|
.await,
|
|
|
|
)
|
2024-02-07 00:20:06 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__http_api__set_default_header_impl(
|
2024-02-07 00:20:06 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
2024-03-13 22:41:28 +08:00
|
|
|
headers: impl CstDecode<std::collections::HashMap<String, String>>,
|
2024-02-07 00:20:06 +08:00
|
|
|
) {
|
2024-03-13 22:41:28 +08:00
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
2024-02-07 00:20:06 +08:00
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
2024-02-07 19:32:36 +08:00
|
|
|
debug_name: "set_default_header",
|
2024-02-07 00:20:06 +08:00
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
2024-03-13 22:41:28 +08:00
|
|
|
let api_headers = headers.cst_decode();
|
2024-02-07 19:32:36 +08:00
|
|
|
move |context| {
|
2024-03-13 22:41:28 +08:00
|
|
|
transform_result_dco((move || {
|
2024-06-11 19:55:35 +08:00
|
|
|
Result::<_, ()>::Ok({
|
|
|
|
crate::api::http_api::set_default_header(api_headers);
|
|
|
|
})
|
2024-02-07 19:32:36 +08:00
|
|
|
})())
|
2024-02-07 00:20:06 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__rs_process__start_impl(
|
2024-02-25 10:30:20 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
2024-03-13 22:41:28 +08:00
|
|
|
executable: impl CstDecode<String>,
|
|
|
|
arguments: impl CstDecode<Vec<String>>,
|
|
|
|
working_directory: impl CstDecode<String>,
|
2024-04-16 22:34:50 +08:00
|
|
|
stream_sink: impl CstDecode<
|
|
|
|
StreamSink<
|
|
|
|
crate::api::rs_process::RsProcessStreamData,
|
|
|
|
flutter_rust_bridge::for_generated::DcoCodec,
|
|
|
|
>,
|
|
|
|
>,
|
2024-02-25 10:30:20 +08:00
|
|
|
) {
|
2024-03-13 22:41:28 +08:00
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
2024-02-25 10:30:20 +08:00
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
2024-04-17 21:40:08 +08:00
|
|
|
debug_name: "start",
|
2024-02-25 10:30:20 +08:00
|
|
|
port: Some(port_),
|
2024-04-11 19:52:13 +08:00
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
2024-02-25 10:30:20 +08:00
|
|
|
},
|
|
|
|
move || {
|
2024-03-13 22:41:28 +08:00
|
|
|
let api_executable = executable.cst_decode();
|
|
|
|
let api_arguments = arguments.cst_decode();
|
|
|
|
let api_working_directory = working_directory.cst_decode();
|
2024-04-11 19:52:13 +08:00
|
|
|
let api_stream_sink = stream_sink.cst_decode();
|
2024-02-25 10:30:20 +08:00
|
|
|
move |context| async move {
|
2024-03-13 22:41:28 +08:00
|
|
|
transform_result_dco(
|
2024-02-25 10:30:20 +08:00
|
|
|
(move || async move {
|
2024-06-11 19:55:35 +08:00
|
|
|
Result::<_, ()>::Ok({
|
2024-04-17 21:40:08 +08:00
|
|
|
crate::api::rs_process::start(
|
2024-04-28 21:50:36 +08:00
|
|
|
&api_executable,
|
2024-02-25 10:30:20 +08:00
|
|
|
api_arguments,
|
2024-04-28 21:50:36 +08:00
|
|
|
&api_working_directory,
|
2024-04-11 19:52:13 +08:00
|
|
|
api_stream_sink,
|
2024-02-25 10:30:20 +08:00
|
|
|
)
|
2024-06-11 19:55:35 +08:00
|
|
|
.await;
|
|
|
|
})
|
2024-02-25 10:30:20 +08:00
|
|
|
})()
|
|
|
|
.await,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__rs_process__write_impl(
|
2024-04-16 22:34:50 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
2024-04-17 21:40:08 +08:00
|
|
|
rs_pid: impl CstDecode<u32>,
|
2024-04-16 22:34:50 +08:00
|
|
|
data: impl CstDecode<String>,
|
|
|
|
) {
|
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
2024-04-17 21:40:08 +08:00
|
|
|
debug_name: "write",
|
2024-04-16 22:34:50 +08:00
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
2024-04-17 21:40:08 +08:00
|
|
|
let api_rs_pid = rs_pid.cst_decode();
|
2024-04-16 22:34:50 +08:00
|
|
|
let api_data = data.cst_decode();
|
|
|
|
move |context| async move {
|
|
|
|
transform_result_dco(
|
|
|
|
(move || async move {
|
2024-06-11 19:55:35 +08:00
|
|
|
Result::<_, ()>::Ok({
|
|
|
|
crate::api::rs_process::write(&api_rs_pid, api_data).await;
|
|
|
|
})
|
2024-04-16 22:34:50 +08:00
|
|
|
})()
|
|
|
|
.await,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__win32_api__send_notify_impl(
|
2024-04-28 22:28:48 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
|
|
|
summary: impl CstDecode<Option<String>>,
|
|
|
|
body: impl CstDecode<Option<String>>,
|
|
|
|
app_name: impl CstDecode<Option<String>>,
|
|
|
|
app_id: impl CstDecode<Option<String>>,
|
|
|
|
) {
|
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
|
|
|
debug_name: "send_notify",
|
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
|
|
|
let api_summary = summary.cst_decode();
|
|
|
|
let api_body = body.cst_decode();
|
|
|
|
let api_app_name = app_name.cst_decode();
|
|
|
|
let api_app_id = app_id.cst_decode();
|
|
|
|
move |context| {
|
|
|
|
transform_result_dco((move || {
|
|
|
|
crate::api::win32_api::send_notify(
|
|
|
|
api_summary,
|
|
|
|
api_body,
|
|
|
|
api_app_name,
|
|
|
|
api_app_id,
|
|
|
|
)
|
|
|
|
})())
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-05-22 20:05:50 +08:00
|
|
|
fn wire__crate__api__win32_api__set_foreground_window_impl(
|
2024-04-28 22:28:48 +08:00
|
|
|
port_: flutter_rust_bridge::for_generated::MessagePort,
|
|
|
|
window_name: impl CstDecode<String>,
|
|
|
|
) {
|
|
|
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
|
|
|
flutter_rust_bridge::for_generated::TaskInfo {
|
|
|
|
debug_name: "set_foreground_window",
|
|
|
|
port: Some(port_),
|
|
|
|
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
|
|
|
},
|
|
|
|
move || {
|
|
|
|
let api_window_name = window_name.cst_decode();
|
|
|
|
move |context| {
|
|
|
|
transform_result_dco((move || {
|
|
|
|
crate::api::win32_api::set_foreground_window(&api_window_name)
|
|
|
|
})())
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-02-06 20:19:53 +08:00
|
|
|
|
|
|
|
// Section: dart2rust
|
|
|
|
|
2024-04-28 21:50:36 +08:00
|
|
|
impl CstDecode<bool> for bool {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> bool {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
2024-03-13 22:41:28 +08:00
|
|
|
impl CstDecode<i32> for i32 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> i32 {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl CstDecode<crate::http_package::MyHttpVersion> for i32 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> crate::http_package::MyHttpVersion {
|
|
|
|
match self {
|
|
|
|
0 => crate::http_package::MyHttpVersion::HTTP_09,
|
|
|
|
1 => crate::http_package::MyHttpVersion::HTTP_10,
|
|
|
|
2 => crate::http_package::MyHttpVersion::HTTP_11,
|
|
|
|
3 => crate::http_package::MyHttpVersion::HTTP_2,
|
|
|
|
4 => crate::http_package::MyHttpVersion::HTTP_3,
|
|
|
|
5 => crate::http_package::MyHttpVersion::HTTP_UNKNOWN,
|
|
|
|
_ => unreachable!("Invalid variant for MyHttpVersion: {}", self),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl CstDecode<crate::api::http_api::MyMethod> for i32 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> crate::api::http_api::MyMethod {
|
|
|
|
match self {
|
|
|
|
0 => crate::api::http_api::MyMethod::Options,
|
|
|
|
1 => crate::api::http_api::MyMethod::Gets,
|
|
|
|
2 => crate::api::http_api::MyMethod::Post,
|
|
|
|
3 => crate::api::http_api::MyMethod::Put,
|
|
|
|
4 => crate::api::http_api::MyMethod::Delete,
|
|
|
|
5 => crate::api::http_api::MyMethod::Head,
|
|
|
|
6 => crate::api::http_api::MyMethod::Trace,
|
|
|
|
7 => crate::api::http_api::MyMethod::Connect,
|
|
|
|
8 => crate::api::http_api::MyMethod::Patch,
|
|
|
|
_ => unreachable!("Invalid variant for MyMethod: {}", self),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-04-16 22:34:50 +08:00
|
|
|
impl CstDecode<crate::api::rs_process::RsProcessStreamDataType> for i32 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> crate::api::rs_process::RsProcessStreamDataType {
|
|
|
|
match self {
|
|
|
|
0 => crate::api::rs_process::RsProcessStreamDataType::Output,
|
|
|
|
1 => crate::api::rs_process::RsProcessStreamDataType::Error,
|
|
|
|
2 => crate::api::rs_process::RsProcessStreamDataType::Exit,
|
|
|
|
_ => unreachable!("Invalid variant for RsProcessStreamDataType: {}", self),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-03-13 22:41:28 +08:00
|
|
|
impl CstDecode<u16> for u16 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> u16 {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
2024-04-16 22:34:50 +08:00
|
|
|
impl CstDecode<u32> for u32 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> u32 {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
2024-03-13 22:41:28 +08:00
|
|
|
impl CstDecode<u64> for u64 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> u64 {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl CstDecode<u8> for u8 {
|
|
|
|
// Codec=Cst (C-struct based), see doc to use other codecs
|
|
|
|
fn cst_decode(self) -> u8 {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
2024-02-15 21:24:39 +08:00
|
|
|
impl SseDecode for flutter_rust_bridge::for_generated::anyhow::Error {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
2024-05-22 20:05:50 +08:00
|
|
|
let mut inner = <String>::sse_decode(deserializer);
|
2024-05-29 21:52:04 +08:00
|
|
|
return flutter_rust_bridge::for_generated::anyhow::anyhow!("{}", inner);
|
2024-02-15 21:24:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
impl SseDecode for std::collections::HashMap<String, String> {
|
|
|
|
// 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 = <Vec<(String, String)>>::sse_decode(deserializer);
|
|
|
|
return inner.into_iter().collect();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
impl SseDecode
|
|
|
|
for StreamSink<
|
|
|
|
crate::api::rs_process::RsProcessStreamData,
|
|
|
|
flutter_rust_bridge::for_generated::DcoCodec,
|
|
|
|
>
|
|
|
|
{
|
2024-04-11 19:52:13 +08:00
|
|
|
// 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 = <String>::sse_decode(deserializer);
|
|
|
|
return StreamSink::deserialize(inner);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
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 {
|
|
|
|
let mut inner = <Vec<u8>>::sse_decode(deserializer);
|
|
|
|
return String::from_utf8(inner).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-28 21:50:36 +08:00
|
|
|
impl SseDecode for bool {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
deserializer.cursor.read_u8().unwrap() != 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
impl SseDecode for i32 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
deserializer.cursor.read_i32::<NativeEndian>().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 22:19:43 +08:00
|
|
|
impl SseDecode for Vec<String> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
let mut len_ = <i32>::sse_decode(deserializer);
|
|
|
|
let mut ans_ = vec![];
|
|
|
|
for idx_ in 0..len_ {
|
|
|
|
ans_.push(<String>::sse_decode(deserializer));
|
|
|
|
}
|
|
|
|
return ans_;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
impl SseDecode for Vec<u8> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
let mut len_ = <i32>::sse_decode(deserializer);
|
|
|
|
let mut ans_ = vec![];
|
|
|
|
for idx_ in 0..len_ {
|
|
|
|
ans_.push(<u8>::sse_decode(deserializer));
|
|
|
|
}
|
|
|
|
return ans_;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
impl SseDecode for Vec<(String, String)> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
let mut len_ = <i32>::sse_decode(deserializer);
|
|
|
|
let mut ans_ = vec![];
|
|
|
|
for idx_ in 0..len_ {
|
|
|
|
ans_.push(<(String, String)>::sse_decode(deserializer));
|
|
|
|
}
|
|
|
|
return ans_;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 20:28:24 +08:00
|
|
|
impl SseDecode for crate::http_package::MyHttpVersion {
|
|
|
|
// 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 = <i32>::sse_decode(deserializer);
|
|
|
|
return match inner {
|
|
|
|
0 => crate::http_package::MyHttpVersion::HTTP_09,
|
|
|
|
1 => crate::http_package::MyHttpVersion::HTTP_10,
|
|
|
|
2 => crate::http_package::MyHttpVersion::HTTP_11,
|
|
|
|
3 => crate::http_package::MyHttpVersion::HTTP_2,
|
|
|
|
4 => crate::http_package::MyHttpVersion::HTTP_3,
|
2024-03-12 20:07:06 +08:00
|
|
|
5 => crate::http_package::MyHttpVersion::HTTP_UNKNOWN,
|
2024-03-10 20:28:24 +08:00
|
|
|
_ => unreachable!("Invalid variant for MyHttpVersion: {}", inner),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
impl SseDecode for crate::api::http_api::MyMethod {
|
|
|
|
// 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 = <i32>::sse_decode(deserializer);
|
|
|
|
return match inner {
|
|
|
|
0 => crate::api::http_api::MyMethod::Options,
|
|
|
|
1 => crate::api::http_api::MyMethod::Gets,
|
|
|
|
2 => crate::api::http_api::MyMethod::Post,
|
|
|
|
3 => crate::api::http_api::MyMethod::Put,
|
|
|
|
4 => crate::api::http_api::MyMethod::Delete,
|
|
|
|
5 => crate::api::http_api::MyMethod::Head,
|
|
|
|
6 => crate::api::http_api::MyMethod::Trace,
|
|
|
|
7 => crate::api::http_api::MyMethod::Connect,
|
|
|
|
8 => crate::api::http_api::MyMethod::Patch,
|
|
|
|
_ => unreachable!("Invalid variant for MyMethod: {}", inner),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
impl SseDecode for Option<std::collections::HashMap<String, String>> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
if (<bool>::sse_decode(deserializer)) {
|
|
|
|
return Some(<std::collections::HashMap<String, String>>::sse_decode(
|
|
|
|
deserializer,
|
|
|
|
));
|
|
|
|
} else {
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-12 20:07:06 +08:00
|
|
|
impl SseDecode for Option<String> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
if (<bool>::sse_decode(deserializer)) {
|
|
|
|
return Some(<String>::sse_decode(deserializer));
|
|
|
|
} else {
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
impl SseDecode for Option<u64> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
if (<bool>::sse_decode(deserializer)) {
|
|
|
|
return Some(<u64>::sse_decode(deserializer));
|
|
|
|
} else {
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseDecode for Option<Vec<u8>> {
|
2024-02-07 00:20:06 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
if (<bool>::sse_decode(deserializer)) {
|
2024-02-07 19:32:36 +08:00
|
|
|
return Some(<Vec<u8>>::sse_decode(deserializer));
|
2024-02-07 00:20:06 +08:00
|
|
|
} else {
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseDecode for (String, String) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
let mut var_field0 = <String>::sse_decode(deserializer);
|
|
|
|
let mut var_field1 = <String>::sse_decode(deserializer);
|
|
|
|
return (var_field0, var_field1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
impl SseDecode for crate::api::rs_process::RsProcessStreamData {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
let mut var_dataType =
|
|
|
|
<crate::api::rs_process::RsProcessStreamDataType>::sse_decode(deserializer);
|
|
|
|
let mut var_data = <String>::sse_decode(deserializer);
|
2024-04-17 21:40:08 +08:00
|
|
|
let mut var_rsPid = <u32>::sse_decode(deserializer);
|
2024-04-16 22:34:50 +08:00
|
|
|
return crate::api::rs_process::RsProcessStreamData {
|
|
|
|
data_type: var_dataType,
|
|
|
|
data: var_data,
|
2024-04-17 21:40:08 +08:00
|
|
|
rs_pid: var_rsPid,
|
2024-04-16 22:34:50 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseDecode for crate::api::rs_process::RsProcessStreamDataType {
|
|
|
|
// 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 = <i32>::sse_decode(deserializer);
|
|
|
|
return match inner {
|
|
|
|
0 => crate::api::rs_process::RsProcessStreamDataType::Output,
|
|
|
|
1 => crate::api::rs_process::RsProcessStreamDataType::Error,
|
|
|
|
2 => crate::api::rs_process::RsProcessStreamDataType::Exit,
|
|
|
|
_ => unreachable!("Invalid variant for RsProcessStreamDataType: {}", inner),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
impl SseDecode for crate::api::asar_api::RsiLauncherAsarData {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
let mut var_asarPath = <String>::sse_decode(deserializer);
|
|
|
|
let mut var_mainJsPath = <String>::sse_decode(deserializer);
|
|
|
|
let mut var_mainJsContent = <Vec<u8>>::sse_decode(deserializer);
|
|
|
|
return crate::api::asar_api::RsiLauncherAsarData {
|
|
|
|
asar_path: var_asarPath,
|
|
|
|
main_js_path: var_mainJsPath,
|
|
|
|
main_js_content: var_mainJsContent,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
impl SseDecode for crate::http_package::RustHttpResponse {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
let mut var_statusCode = <u16>::sse_decode(deserializer);
|
2024-02-22 20:38:35 +08:00
|
|
|
let mut var_headers = <std::collections::HashMap<String, String>>::sse_decode(deserializer);
|
2024-02-07 19:32:36 +08:00
|
|
|
let mut var_url = <String>::sse_decode(deserializer);
|
|
|
|
let mut var_contentLength = <Option<u64>>::sse_decode(deserializer);
|
2024-03-10 20:28:24 +08:00
|
|
|
let mut var_version = <crate::http_package::MyHttpVersion>::sse_decode(deserializer);
|
2024-02-07 19:32:36 +08:00
|
|
|
let mut var_remoteAddr = <String>::sse_decode(deserializer);
|
|
|
|
let mut var_data = <Option<Vec<u8>>>::sse_decode(deserializer);
|
|
|
|
return crate::http_package::RustHttpResponse {
|
|
|
|
status_code: var_statusCode,
|
|
|
|
headers: var_headers,
|
|
|
|
url: var_url,
|
|
|
|
content_length: var_contentLength,
|
|
|
|
version: var_version,
|
|
|
|
remote_addr: var_remoteAddr,
|
|
|
|
data: var_data,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseDecode for u16 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
deserializer.cursor.read_u16::<NativeEndian>().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
impl SseDecode for u32 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
deserializer.cursor.read_u32::<NativeEndian>().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
impl SseDecode for u64 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
deserializer.cursor.read_u64::<NativeEndian>().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseDecode for u8 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
|
|
|
deserializer.cursor.read_u8().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseDecode for () {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn pde_ffi_dispatcher_primary_impl(
|
|
|
|
func_id: i32,
|
|
|
|
port: flutter_rust_bridge::for_generated::MessagePort,
|
|
|
|
ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
|
|
|
rust_vec_len: i32,
|
|
|
|
data_len: i32,
|
|
|
|
) {
|
|
|
|
// Codec=Pde (Serialization + dispatch), see doc to use other codecs
|
|
|
|
match func_id {
|
|
|
|
_ => unreachable!(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn pde_ffi_dispatcher_sync_impl(
|
|
|
|
func_id: i32,
|
|
|
|
ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
|
|
|
|
rust_vec_len: i32,
|
|
|
|
data_len: i32,
|
|
|
|
) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse {
|
|
|
|
// Codec=Pde (Serialization + dispatch), see doc to use other codecs
|
|
|
|
match func_id {
|
|
|
|
_ => unreachable!(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Section: rust2dart
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
2024-03-10 20:28:24 +08:00
|
|
|
impl flutter_rust_bridge::IntoDart for crate::http_package::MyHttpVersion {
|
2024-02-07 19:32:36 +08:00
|
|
|
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
2024-03-10 20:28:24 +08:00
|
|
|
match self {
|
|
|
|
Self::HTTP_09 => 0.into_dart(),
|
|
|
|
Self::HTTP_10 => 1.into_dart(),
|
|
|
|
Self::HTTP_11 => 2.into_dart(),
|
|
|
|
Self::HTTP_2 => 3.into_dart(),
|
|
|
|
Self::HTTP_3 => 4.into_dart(),
|
2024-03-12 20:07:06 +08:00
|
|
|
Self::HTTP_UNKNOWN => 5.into_dart(),
|
2024-06-11 19:55:35 +08:00
|
|
|
_ => unreachable!(),
|
2024-03-10 20:28:24 +08:00
|
|
|
}
|
2024-02-07 19:32:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
2024-03-10 20:28:24 +08:00
|
|
|
for crate::http_package::MyHttpVersion
|
2024-02-07 19:32:36 +08:00
|
|
|
{
|
|
|
|
}
|
2024-03-10 20:28:24 +08:00
|
|
|
impl flutter_rust_bridge::IntoIntoDart<crate::http_package::MyHttpVersion>
|
|
|
|
for crate::http_package::MyHttpVersion
|
2024-02-07 19:32:36 +08:00
|
|
|
{
|
2024-03-10 20:28:24 +08:00
|
|
|
fn into_into_dart(self) -> crate::http_package::MyHttpVersion {
|
|
|
|
self
|
2024-02-07 19:32:36 +08:00
|
|
|
}
|
|
|
|
}
|
2024-02-06 20:19:53 +08:00
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
2024-02-07 19:32:36 +08:00
|
|
|
impl flutter_rust_bridge::IntoDart for crate::api::http_api::MyMethod {
|
|
|
|
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
|
|
|
match self {
|
|
|
|
Self::Options => 0.into_dart(),
|
|
|
|
Self::Gets => 1.into_dart(),
|
|
|
|
Self::Post => 2.into_dart(),
|
|
|
|
Self::Put => 3.into_dart(),
|
|
|
|
Self::Delete => 4.into_dart(),
|
|
|
|
Self::Head => 5.into_dart(),
|
|
|
|
Self::Trace => 6.into_dart(),
|
|
|
|
Self::Connect => 7.into_dart(),
|
|
|
|
Self::Patch => 8.into_dart(),
|
2024-06-11 19:55:35 +08:00
|
|
|
_ => unreachable!(),
|
2024-02-07 19:32:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
|
|
|
for crate::api::http_api::MyMethod
|
|
|
|
{
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::IntoIntoDart<crate::api::http_api::MyMethod>
|
|
|
|
for crate::api::http_api::MyMethod
|
|
|
|
{
|
|
|
|
fn into_into_dart(self) -> crate::api::http_api::MyMethod {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
2024-04-16 22:34:50 +08:00
|
|
|
impl flutter_rust_bridge::IntoDart for crate::api::rs_process::RsProcessStreamData {
|
|
|
|
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
|
|
|
[
|
|
|
|
self.data_type.into_into_dart().into_dart(),
|
|
|
|
self.data.into_into_dart().into_dart(),
|
2024-04-17 21:40:08 +08:00
|
|
|
self.rs_pid.into_into_dart().into_dart(),
|
2024-04-16 22:34:50 +08:00
|
|
|
]
|
|
|
|
.into_dart()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
|
|
|
for crate::api::rs_process::RsProcessStreamData
|
|
|
|
{
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::IntoIntoDart<crate::api::rs_process::RsProcessStreamData>
|
|
|
|
for crate::api::rs_process::RsProcessStreamData
|
|
|
|
{
|
|
|
|
fn into_into_dart(self) -> crate::api::rs_process::RsProcessStreamData {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
|
|
|
impl flutter_rust_bridge::IntoDart for crate::api::rs_process::RsProcessStreamDataType {
|
|
|
|
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
|
|
|
match self {
|
|
|
|
Self::Output => 0.into_dart(),
|
|
|
|
Self::Error => 1.into_dart(),
|
|
|
|
Self::Exit => 2.into_dart(),
|
2024-06-11 19:55:35 +08:00
|
|
|
_ => unreachable!(),
|
2024-04-16 22:34:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
|
|
|
for crate::api::rs_process::RsProcessStreamDataType
|
|
|
|
{
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::IntoIntoDart<crate::api::rs_process::RsProcessStreamDataType>
|
|
|
|
for crate::api::rs_process::RsProcessStreamDataType
|
|
|
|
{
|
|
|
|
fn into_into_dart(self) -> crate::api::rs_process::RsProcessStreamDataType {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
2024-05-01 13:48:37 +08:00
|
|
|
impl flutter_rust_bridge::IntoDart for crate::api::asar_api::RsiLauncherAsarData {
|
|
|
|
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
|
|
|
[
|
|
|
|
self.asar_path.into_into_dart().into_dart(),
|
|
|
|
self.main_js_path.into_into_dart().into_dart(),
|
|
|
|
self.main_js_content.into_into_dart().into_dart(),
|
|
|
|
]
|
|
|
|
.into_dart()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
|
|
|
for crate::api::asar_api::RsiLauncherAsarData
|
|
|
|
{
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::IntoIntoDart<crate::api::asar_api::RsiLauncherAsarData>
|
|
|
|
for crate::api::asar_api::RsiLauncherAsarData
|
|
|
|
{
|
|
|
|
fn into_into_dart(self) -> crate::api::asar_api::RsiLauncherAsarData {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
2024-02-07 19:32:36 +08:00
|
|
|
impl flutter_rust_bridge::IntoDart for crate::http_package::RustHttpResponse {
|
|
|
|
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
|
|
|
[
|
|
|
|
self.status_code.into_into_dart().into_dart(),
|
|
|
|
self.headers.into_into_dart().into_dart(),
|
|
|
|
self.url.into_into_dart().into_dart(),
|
|
|
|
self.content_length.into_into_dart().into_dart(),
|
|
|
|
self.version.into_into_dart().into_dart(),
|
|
|
|
self.remote_addr.into_into_dart().into_dart(),
|
|
|
|
self.data.into_into_dart().into_dart(),
|
|
|
|
]
|
|
|
|
.into_dart()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
|
|
|
for crate::http_package::RustHttpResponse
|
|
|
|
{
|
|
|
|
}
|
|
|
|
impl flutter_rust_bridge::IntoIntoDart<crate::http_package::RustHttpResponse>
|
|
|
|
for crate::http_package::RustHttpResponse
|
|
|
|
{
|
|
|
|
fn into_into_dart(self) -> crate::http_package::RustHttpResponse {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-15 21:24:39 +08:00
|
|
|
impl SseEncode for flutter_rust_bridge::for_generated::anyhow::Error {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<String>::sse_encode(format!("{:?}", self), serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
impl SseEncode for std::collections::HashMap<String, String> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<Vec<(String, String)>>::sse_encode(self.into_iter().collect(), serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
impl SseEncode
|
|
|
|
for StreamSink<
|
|
|
|
crate::api::rs_process::RsProcessStreamData,
|
|
|
|
flutter_rust_bridge::for_generated::DcoCodec,
|
|
|
|
>
|
|
|
|
{
|
2024-04-11 19:52:13 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
unimplemented!("")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
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) {
|
|
|
|
<Vec<u8>>::sse_encode(self.into_bytes(), serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-28 21:50:36 +08:00
|
|
|
impl SseEncode for bool {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
serializer.cursor.write_u8(self as _).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
impl SseEncode for i32 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
serializer.cursor.write_i32::<NativeEndian>(self).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 22:19:43 +08:00
|
|
|
impl SseEncode for Vec<String> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<i32>::sse_encode(self.len() as _, serializer);
|
|
|
|
for item in self {
|
|
|
|
<String>::sse_encode(item, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
impl SseEncode for Vec<u8> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<i32>::sse_encode(self.len() as _, serializer);
|
|
|
|
for item in self {
|
|
|
|
<u8>::sse_encode(item, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
impl SseEncode for Vec<(String, String)> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<i32>::sse_encode(self.len() as _, serializer);
|
|
|
|
for item in self {
|
|
|
|
<(String, String)>::sse_encode(item, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 20:28:24 +08:00
|
|
|
impl SseEncode for crate::http_package::MyHttpVersion {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<i32>::sse_encode(
|
|
|
|
match self {
|
|
|
|
crate::http_package::MyHttpVersion::HTTP_09 => 0,
|
|
|
|
crate::http_package::MyHttpVersion::HTTP_10 => 1,
|
|
|
|
crate::http_package::MyHttpVersion::HTTP_11 => 2,
|
|
|
|
crate::http_package::MyHttpVersion::HTTP_2 => 3,
|
|
|
|
crate::http_package::MyHttpVersion::HTTP_3 => 4,
|
2024-03-12 20:07:06 +08:00
|
|
|
crate::http_package::MyHttpVersion::HTTP_UNKNOWN => 5,
|
2024-03-10 20:28:24 +08:00
|
|
|
_ => {
|
|
|
|
unimplemented!("");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
serializer,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
impl SseEncode for crate::api::http_api::MyMethod {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<i32>::sse_encode(
|
|
|
|
match self {
|
|
|
|
crate::api::http_api::MyMethod::Options => 0,
|
|
|
|
crate::api::http_api::MyMethod::Gets => 1,
|
|
|
|
crate::api::http_api::MyMethod::Post => 2,
|
|
|
|
crate::api::http_api::MyMethod::Put => 3,
|
|
|
|
crate::api::http_api::MyMethod::Delete => 4,
|
|
|
|
crate::api::http_api::MyMethod::Head => 5,
|
|
|
|
crate::api::http_api::MyMethod::Trace => 6,
|
|
|
|
crate::api::http_api::MyMethod::Connect => 7,
|
|
|
|
crate::api::http_api::MyMethod::Patch => 8,
|
|
|
|
_ => {
|
|
|
|
unimplemented!("");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
serializer,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 00:20:06 +08:00
|
|
|
impl SseEncode for Option<std::collections::HashMap<String, String>> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<bool>::sse_encode(self.is_some(), serializer);
|
|
|
|
if let Some(value) = self {
|
|
|
|
<std::collections::HashMap<String, String>>::sse_encode(value, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-12 20:07:06 +08:00
|
|
|
impl SseEncode for Option<String> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<bool>::sse_encode(self.is_some(), serializer);
|
|
|
|
if let Some(value) = self {
|
|
|
|
<String>::sse_encode(value, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
impl SseEncode for Option<u64> {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<bool>::sse_encode(self.is_some(), serializer);
|
|
|
|
if let Some(value) = self {
|
|
|
|
<u64>::sse_encode(value, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseEncode for Option<Vec<u8>> {
|
2024-02-07 00:20:06 +08:00
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<bool>::sse_encode(self.is_some(), serializer);
|
|
|
|
if let Some(value) = self {
|
2024-02-07 19:32:36 +08:00
|
|
|
<Vec<u8>>::sse_encode(value, serializer);
|
2024-02-07 00:20:06 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseEncode for (String, String) {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<String>::sse_encode(self.0, serializer);
|
|
|
|
<String>::sse_encode(self.1, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
impl SseEncode for crate::api::rs_process::RsProcessStreamData {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<crate::api::rs_process::RsProcessStreamDataType>::sse_encode(self.data_type, serializer);
|
|
|
|
<String>::sse_encode(self.data, serializer);
|
2024-04-17 21:40:08 +08:00
|
|
|
<u32>::sse_encode(self.rs_pid, serializer);
|
2024-04-16 22:34:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseEncode for crate::api::rs_process::RsProcessStreamDataType {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<i32>::sse_encode(
|
|
|
|
match self {
|
|
|
|
crate::api::rs_process::RsProcessStreamDataType::Output => 0,
|
|
|
|
crate::api::rs_process::RsProcessStreamDataType::Error => 1,
|
|
|
|
crate::api::rs_process::RsProcessStreamDataType::Exit => 2,
|
|
|
|
_ => {
|
|
|
|
unimplemented!("");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
serializer,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-01 13:48:37 +08:00
|
|
|
impl SseEncode for crate::api::asar_api::RsiLauncherAsarData {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<String>::sse_encode(self.asar_path, serializer);
|
|
|
|
<String>::sse_encode(self.main_js_path, serializer);
|
|
|
|
<Vec<u8>>::sse_encode(self.main_js_content, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 19:32:36 +08:00
|
|
|
impl SseEncode for crate::http_package::RustHttpResponse {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
<u16>::sse_encode(self.status_code, serializer);
|
|
|
|
<std::collections::HashMap<String, String>>::sse_encode(self.headers, serializer);
|
|
|
|
<String>::sse_encode(self.url, serializer);
|
|
|
|
<Option<u64>>::sse_encode(self.content_length, serializer);
|
2024-03-10 20:28:24 +08:00
|
|
|
<crate::http_package::MyHttpVersion>::sse_encode(self.version, serializer);
|
2024-02-07 19:32:36 +08:00
|
|
|
<String>::sse_encode(self.remote_addr, serializer);
|
|
|
|
<Option<Vec<u8>>>::sse_encode(self.data, serializer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseEncode for u16 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
serializer.cursor.write_u16::<NativeEndian>(self).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-16 22:34:50 +08:00
|
|
|
impl SseEncode for u32 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
serializer.cursor.write_u32::<NativeEndian>(self).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-06 20:19:53 +08:00
|
|
|
impl SseEncode for u64 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
serializer.cursor.write_u64::<NativeEndian>(self).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseEncode for u8 {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
|
|
|
serializer.cursor.write_u8(self).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SseEncode for () {
|
|
|
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
|
|
|
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(target_family = "wasm"))]
|
|
|
|
#[path = "frb_generated.io.rs"]
|
|
|
|
mod io;
|
|
|
|
#[cfg(not(target_family = "wasm"))]
|
|
|
|
pub use io::*;
|