app/rust/src/frb_generated.rs

938 lines
36 KiB
Rust
Raw Normal View History

2024-02-06 20:19:53 +08:00
// This file is automatically generated, so please do not edit it.
2024-02-15 21:24:39 +08:00
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.24.
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,
clippy::match_single_binding
)]
// Section: imports
2024-02-07 19:32:36 +08:00
use crate::api::http_api::*;
2024-02-06 20:19:53 +08:00
use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
use flutter_rust_bridge::for_generated::transform_result_dco;
use flutter_rust_bridge::{Handler, IntoIntoDart};
// Section: boilerplate
flutter_rust_bridge::frb_generated_boilerplate!(
default_stream_sink_codec = SseCodec,
default_rust_opaque = RustOpaqueMoi,
default_rust_auto_opaque = RustAutoOpaqueMoi,
);
2024-02-15 21:24:39 +08:00
const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.24";
2024-02-06 20:19:53 +08:00
// Section: executor
flutter_rust_bridge::frb_generated_default_handler!();
// Section: wire_funcs
fn wire_cancel_download_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "cancel_download",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let message = unsafe {
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
ptr_,
rust_vec_len_,
data_len_,
)
};
let mut deserializer =
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
let api_id = <String>::sse_decode(&mut deserializer);
deserializer.end();
move |context| async move {
transform_result_sse(
(move || async move {
Result::<_, ()>::Ok(
crate::api::downloader_api::cancel_download(api_id).await,
)
})()
.await,
)
}
},
)
}
fn wire_start_download_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) {
2024-02-07 20:38:16 +08:00
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec,_,_,_>(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "start_download", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Stream }, move || {
let message = unsafe { flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, rust_vec_len_, data_len_) };
let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message);
2024-02-06 20:19:53 +08:00
let api_url = <String>::sse_decode(&mut deserializer);
2024-02-07 20:38:16 +08:00
let api_save_path = <String>::sse_decode(&mut deserializer);
let api_file_name = <String>::sse_decode(&mut deserializer);
let api_connection_count = <u8>::sse_decode(&mut deserializer);deserializer.end(); move |context| async move {
transform_result_sse((move || async move {
Result::<_,()>::Ok(crate::api::downloader_api::start_download(api_url, api_save_path, api_file_name, api_connection_count, StreamSink::new(context.rust2dart_context().stream_sink::<_,crate::downloader::DownloadCallbackData>())).await)
})().await)
} })
2024-02-06 20:19:53 +08:00
}
2024-02-07 22:19:43 +08:00
fn wire_dns_lookup_txt_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "dns_lookup_txt",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let message = unsafe {
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
ptr_,
rust_vec_len_,
data_len_,
)
};
let mut deserializer =
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
let api_host = <String>::sse_decode(&mut deserializer);
deserializer.end();
move |context| async move {
transform_result_sse(
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-02-07 19:32:36 +08:00
fn wire_fetch_impl(
2024-02-07 00:20:06 +08:00
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) {
2024-02-07 19:32:36 +08:00
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
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 || {
let message = unsafe {
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
ptr_,
rust_vec_len_,
data_len_,
)
};
let mut deserializer =
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
2024-02-07 19:32:36 +08:00
let api_method = <crate::api::http_api::MyMethod>::sse_decode(&mut deserializer);
2024-02-07 00:20:06 +08:00
let api_url = <String>::sse_decode(&mut deserializer);
let api_headers =
<Option<std::collections::HashMap<String, String>>>::sse_decode(&mut deserializer);
2024-02-07 19:32:36 +08:00
let api_input_data = <Option<Vec<u8>>>::sse_decode(&mut deserializer);
2024-02-07 00:20:06 +08:00
deserializer.end();
2024-02-07 19:32:36 +08:00
move |context| async move {
transform_result_sse(
(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-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-02-07 19:32:36 +08:00
fn wire_set_default_header_impl(
2024-02-07 00:20:06 +08:00
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) {
2024-02-07 19:32:36 +08:00
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
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 || {
let message = unsafe {
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
ptr_,
rust_vec_len_,
data_len_,
)
};
let mut deserializer =
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
let api_headers =
2024-02-07 19:32:36 +08:00
<std::collections::HashMap<String, String>>::sse_decode(&mut deserializer);
2024-02-07 00:20:06 +08:00
deserializer.end();
2024-02-07 19:32:36 +08:00
move |context| {
transform_result_sse((move || {
Result::<_, ()>::Ok(crate::api::http_api::set_default_header(api_headers))
})())
2024-02-07 00:20:06 +08:00
}
},
)
}
2024-02-06 20:19:53 +08:00
2024-02-07 19:32:36 +08:00
// Section: related_funcs
flutter_rust_bridge::frb_generated_moi_arc_impl_value!(
flutter_rust_bridge::for_generated::rust_async::RwLock<reqwest::Version>
);
2024-02-06 20:19:53 +08:00
// Section: dart2rust
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 {
unreachable!("");
}
}
2024-02-07 19:32:36 +08:00
impl SseDecode for reqwest::Version {
// 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 = <RustOpaqueMoi<
flutter_rust_bridge::for_generated::rust_async::RwLock<reqwest::Version>,
>>::sse_decode(deserializer);
return inner.rust_auto_opaque_decode_owned();
}
}
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-02-07 19:32:36 +08:00
impl SseDecode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::rust_async::RwLock<reqwest::Version>>
{
// 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 = <usize>::sse_decode(deserializer);
return decode_rust_opaque_moi(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();
}
}
impl SseDecode for crate::downloader::DownloadCallbackData {
// 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_id = <String>::sse_decode(deserializer);
let mut var_total = <u64>::sse_decode(deserializer);
let mut var_progress = <u64>::sse_decode(deserializer);
let mut var_speed = <u64>::sse_decode(deserializer);
let mut var_status = <crate::downloader::MyDownloaderStatus>::sse_decode(deserializer);
return crate::downloader::DownloadCallbackData {
id: var_id,
total: var_total,
progress: var_progress,
speed: var_speed,
status: var_status,
};
}
}
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-02-06 20:19:53 +08:00
impl SseDecode for crate::downloader::MyDownloaderStatus {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut tag_ = <i32>::sse_decode(deserializer);
match tag_ {
0 => {
return crate::downloader::MyDownloaderStatus::NoStart;
}
1 => {
return crate::downloader::MyDownloaderStatus::Running;
}
2 => {
let mut var_field0 =
<crate::downloader::MyNetworkItemPendingType>::sse_decode(deserializer);
return crate::downloader::MyDownloaderStatus::Pending(var_field0);
}
3 => {
let mut var_field0 = <String>::sse_decode(deserializer);
return crate::downloader::MyDownloaderStatus::Error(var_field0);
}
4 => {
return crate::downloader::MyDownloaderStatus::Finished;
}
_ => {
unimplemented!("");
}
}
}
}
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-06 20:19:53 +08:00
impl SseDecode for crate::downloader::MyNetworkItemPendingType {
// 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::downloader::MyNetworkItemPendingType::QueueUp,
1 => crate::downloader::MyNetworkItemPendingType::Starting,
2 => crate::downloader::MyNetworkItemPendingType::Stopping,
3 => crate::downloader::MyNetworkItemPendingType::Initializing,
_ => unreachable!("Invalid variant for MyNetworkItemPendingType: {}", 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-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-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-18 20:32:17 +08:00
let mut var_headers = <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);
let mut var_version = <reqwest::Version>::sse_decode(deserializer);
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-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 {}
}
2024-02-07 19:32:36 +08:00
impl SseDecode for usize {
// 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() as _
}
}
2024-02-06 20:19:53 +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
}
}
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 {
2 => wire_cancel_download_impl(port, ptr, rust_vec_len, data_len),
1 => wire_start_download_impl(port, ptr, rust_vec_len, data_len),
2024-02-07 22:19:43 +08:00
5 => wire_dns_lookup_txt_impl(port, ptr, rust_vec_len, data_len),
2024-02-07 19:32:36 +08:00
4 => wire_fetch_impl(port, ptr, rust_vec_len, data_len),
3 => wire_set_default_header_impl(port, ptr, rust_vec_len, data_len),
2024-02-06 20:19:53 +08:00
_ => 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
pub struct Local_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockreqwestVersion(
reqwest::Version,
);
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart
for Local_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockreqwestVersion
{
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, MoiArc<_>>(self.0)
.into_dart()
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for Local_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockreqwestVersion
{
}
impl
flutter_rust_bridge::IntoIntoDart<
Local_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockreqwestVersion,
> for reqwest::Version
{
fn into_into_dart(
self,
) -> Local_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockreqwestVersion
{
Local_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockreqwestVersion(
self,
)
}
}
2024-02-06 20:19:53 +08:00
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::downloader::DownloadCallbackData {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.id.into_into_dart().into_dart(),
self.total.into_into_dart().into_dart(),
self.progress.into_into_dart().into_dart(),
self.speed.into_into_dart().into_dart(),
self.status.into_into_dart().into_dart(),
]
.into_dart()
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for crate::downloader::DownloadCallbackData
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::downloader::DownloadCallbackData>
for crate::downloader::DownloadCallbackData
{
fn into_into_dart(self) -> crate::downloader::DownloadCallbackData {
self
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::downloader::MyDownloaderStatus {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
match self {
crate::downloader::MyDownloaderStatus::NoStart => [0.into_dart()].into_dart(),
crate::downloader::MyDownloaderStatus::Running => [1.into_dart()].into_dart(),
crate::downloader::MyDownloaderStatus::Pending(field0) => {
[2.into_dart(), field0.into_into_dart().into_dart()].into_dart()
}
crate::downloader::MyDownloaderStatus::Error(field0) => {
[3.into_dart(), field0.into_into_dart().into_dart()].into_dart()
}
crate::downloader::MyDownloaderStatus::Finished => [4.into_dart()].into_dart(),
}
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for crate::downloader::MyDownloaderStatus
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::downloader::MyDownloaderStatus>
for crate::downloader::MyDownloaderStatus
{
fn into_into_dart(self) -> crate::downloader::MyDownloaderStatus {
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::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(),
}
}
}
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-02-06 20:19:53 +08:00
impl flutter_rust_bridge::IntoDart for crate::downloader::MyNetworkItemPendingType {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
match self {
Self::QueueUp => 0.into_dart(),
Self::Starting => 1.into_dart(),
Self::Stopping => 2.into_dart(),
Self::Initializing => 3.into_dart(),
}
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for crate::downloader::MyNetworkItemPendingType
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::downloader::MyNetworkItemPendingType>
for crate::downloader::MyNetworkItemPendingType
{
fn into_into_dart(self) -> crate::downloader::MyNetworkItemPendingType {
self
}
}
2024-02-07 19:32:36 +08:00
// Codec=Dco (DartCObject based), see doc to use other codecs
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 19:32:36 +08:00
impl SseEncode for reqwest::Version {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<RustOpaqueMoi<flutter_rust_bridge::for_generated::rust_async::RwLock<reqwest :: Version>>>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, MoiArc<_>>(self), serializer);
}
}
2024-02-06 20:19:53 +08:00
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-02-07 19:32:36 +08:00
impl SseEncode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::rust_async::RwLock<reqwest::Version>>
{
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
let (ptr, size) = self.sse_encode_raw();
<usize>::sse_encode(ptr, serializer);
<i32>::sse_encode(size, serializer);
}
}
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);
}
}
impl SseEncode for crate::downloader::DownloadCallbackData {
// 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.id, serializer);
<u64>::sse_encode(self.total, serializer);
<u64>::sse_encode(self.progress, serializer);
<u64>::sse_encode(self.speed, serializer);
<crate::downloader::MyDownloaderStatus>::sse_encode(self.status, serializer);
}
}
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-02-06 20:19:53 +08:00
impl SseEncode for crate::downloader::MyDownloaderStatus {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
match self {
crate::downloader::MyDownloaderStatus::NoStart => {
<i32>::sse_encode(0, serializer);
}
crate::downloader::MyDownloaderStatus::Running => {
<i32>::sse_encode(1, serializer);
}
crate::downloader::MyDownloaderStatus::Pending(field0) => {
<i32>::sse_encode(2, serializer);
<crate::downloader::MyNetworkItemPendingType>::sse_encode(field0, serializer);
}
crate::downloader::MyDownloaderStatus::Error(field0) => {
<i32>::sse_encode(3, serializer);
<String>::sse_encode(field0, serializer);
}
crate::downloader::MyDownloaderStatus::Finished => {
<i32>::sse_encode(4, 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-06 20:19:53 +08:00
impl SseEncode for crate::downloader::MyNetworkItemPendingType {
// 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::downloader::MyNetworkItemPendingType::QueueUp => 0,
crate::downloader::MyNetworkItemPendingType::Starting => 1,
crate::downloader::MyNetworkItemPendingType::Stopping => 2,
crate::downloader::MyNetworkItemPendingType::Initializing => 3,
_ => {
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-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-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);
<reqwest::Version>::sse_encode(self.version, serializer);
<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-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) {}
}
2024-02-07 19:32:36 +08:00
impl SseEncode for usize {
// 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 as _)
.unwrap();
}
}
2024-02-06 20:19:53 +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();
}
}
#[cfg(not(target_family = "wasm"))]
#[path = "frb_generated.io.rs"]
mod io;
#[cfg(not(target_family = "wasm"))]
pub use io::*;
/// cbindgen:ignore
#[cfg(target_family = "wasm")]
#[path = "frb_generated.web.rs"]
mod web;
#[cfg(target_family = "wasm")]
pub use web::*;