This commit is contained in:
kodjomoustapha 2025-01-03 11:24:18 +01:00
parent 35c0502e87
commit 26550912a6
16 changed files with 2627 additions and 99 deletions

View file

@ -91,7 +91,13 @@ class _SourcePreferenceWidgetState extends State<SourcePreferenceWidget> {
final res = await showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(pref.title!),
title: Text.rich(TextSpan(children: [
TextSpan(text: pref.title!),
if (pref.summary?.isNotEmpty ?? false)
TextSpan(
text: "\n\n${pref.summary!}",
style: TextStyle(fontSize: 13))
])),
content: SizedBox(
width: context.width(0.8),
child: ListView.builder(

View file

@ -41,7 +41,7 @@ final backupFrequencyStateProvider =
typedef _$BackupFrequencyState = AutoDisposeNotifier<int>;
String _$backupFrequencyOptionsStateHash() =>
r'79d93411a02867c8882d2d0f2143f5da6c107075';
r'dd5aa850bc250e584973496fee05214b22eed9b1';
/// See also [BackupFrequencyOptionsState].
@ProviderFor(BackupFrequencyOptionsState)

View file

@ -6,7 +6,7 @@ part of 'backup.dart';
// RiverpodGenerator
// **************************************************************************
String _$doBackUpHash() => r'71a9a1aca68f00d68fba134084edc82b7ec614db';
String _$doBackUpHash() => r'ad907e7ff4cd9f05bb3fa2da0fd1a1f1d2c23258';
/// Copied from Dart SDK
class _SystemHash {

View file

@ -173,7 +173,7 @@ class _DoRestoreProviderElement extends AutoDisposeProviderElement<void>
BuildContext get context => (origin as DoRestoreProvider).context;
}
String _$restoreBackupHash() => r'8f55a7fa09ef293d558bf336e282ca1f4f44b8d4';
String _$restoreBackupHash() => r'726b88cc165ac6cae83a2bbbb5d8b5533c3a1f46';
/// See also [restoreBackup].
@ProviderFor(restoreBackup)

View file

@ -7,7 +7,7 @@ part of 'storage_usage.dart';
// **************************************************************************
String _$totalChapterCacheSizeStateHash() =>
r'798b873b0be804a09e0dfc4049e8f60a41f1a8e8';
r'83bf78de5ef674d61d3a9311061ef0933e59109b';
/// See also [TotalChapterCacheSizeState].
@ProviderFor(TotalChapterCacheSizeState)

View file

@ -9,6 +9,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'
as flutter_inappwebview;
import 'package:mangayomi/models/settings.dart';
import 'package:http/io_client.dart';
import 'package:mangayomi/services/http/rhttp/src/model/settings.dart';
import 'package:mangayomi/utils/log/log.dart';
import 'package:mangayomi/services/http/rhttp/rhttp.dart' as rhttp;
@ -26,9 +27,10 @@ class MClient {
timeout: reqcopyWith?["timeout"] != null
? Duration(seconds: reqcopyWith?["timeout"])
: null,
connectTimeout: reqcopyWith?["connectTimeout"] != null
? Duration(seconds: reqcopyWith?["connectTimeout"])
: null,
timeoutSettings: TimeoutSettings(
connectTimeout: reqcopyWith?["connectTimeout"] != null
? Duration(seconds: reqcopyWith?["connectTimeout"])
: null),
tlsSettings: rhttp.TlsSettings(
verifyCertificates:
reqcopyWith?["verifyCertificates"] ?? false));

View file

@ -7,7 +7,9 @@ const _keepBaseUrl = '__rhttp_keep__';
const _keepDuration = Duration(microseconds: -9999);
const _keepProxySettings = ProxySettings.noProxy();
const _keepRedirectSettings = RedirectSettings.limited(-9999);
const _keepDnsSettings = DnsSettings.static();
const _keepTlsSettings = TlsSettings();
const _keepTimeoutSettings = TimeoutSettings();
class ClientSettings {
/// Base URL to be prefixed to all requests.
@ -16,9 +18,8 @@ class ClientSettings {
/// The timeout for the request including time to establish a connection.
final Duration? timeout;
/// The timeout for establishing a connection.
/// See [timeout] for the total timeout.
final Duration? connectTimeout;
/// Timeout and keep alive settings.
final TimeoutSettings? timeoutSettings;
/// Throws an exception if the status code is 4xx or 5xx.
final bool throwOnStatusCode;
@ -34,31 +35,36 @@ class ClientSettings {
/// TLS settings.
final TlsSettings? tlsSettings;
/// DNS settings and resolver overrides.
final DnsSettings? dnsSettings;
const ClientSettings({
this.baseUrl,
this.timeout,
this.connectTimeout,
this.timeoutSettings,
this.throwOnStatusCode = true,
this.proxySettings,
this.redirectSettings,
this.tlsSettings,
this.dnsSettings,
});
ClientSettings copyWith({
String? baseUrl = _keepBaseUrl,
Duration? timeout = _keepDuration,
Duration? connectTimeout = _keepDuration,
TimeoutSettings? timeoutSettings = _keepTimeoutSettings,
bool? throwOnStatusCode,
ProxySettings? proxySettings = _keepProxySettings,
RedirectSettings? redirectSettings = _keepRedirectSettings,
TlsSettings? tlsSettings = _keepTlsSettings,
DnsSettings? dnsSettings = _keepDnsSettings,
}) {
return ClientSettings(
baseUrl: identical(baseUrl, _keepBaseUrl) ? this.baseUrl : baseUrl,
timeout: identical(timeout, _keepDuration) ? this.timeout : timeout,
connectTimeout: identical(connectTimeout, _keepDuration)
? this.connectTimeout
: connectTimeout,
timeoutSettings: identical(timeoutSettings, _keepTimeoutSettings)
? this.timeoutSettings
: timeoutSettings,
throwOnStatusCode: throwOnStatusCode ?? this.throwOnStatusCode,
proxySettings: identical(proxySettings, _keepProxySettings)
? this.proxySettings
@ -69,6 +75,9 @@ class ClientSettings {
tlsSettings: identical(tlsSettings, _keepTlsSettings)
? this.tlsSettings
: tlsSettings,
dnsSettings: identical(dnsSettings, _keepDnsSettings)
? this.dnsSettings
: dnsSettings,
);
}
}
@ -158,15 +167,149 @@ class ClientCertificate {
});
}
sealed class CustomProxy extends ProxySettings {
const CustomProxy._();
}
class StaticProxy extends CustomProxy {
/// The URL of the proxy server.
final String url;
/// Which requests to proxy.
final ProxyCondition condition;
const StaticProxy({
required this.url,
required this.condition,
}) : super._();
const StaticProxy.http(String url)
: this(
url: url,
condition: ProxyCondition.onlyHttp,
);
const StaticProxy.https(String url)
: this(
url: url,
condition: ProxyCondition.onlyHttps,
);
const StaticProxy.all(String url)
: this(
url: url,
condition: ProxyCondition.all,
);
}
class CustomProxyList extends ProxySettings {
/// A list of custom proxies.
/// The first proxy that matches the request will be used.
final List<CustomProxy> proxies;
const CustomProxyList(this.proxies);
}
enum ProxyCondition {
/// Proxy only HTTP requests.
onlyHttp,
/// Proxy only HTTPS requests.
onlyHttps,
/// Proxy all requests.
all,
}
/// General timeout settings for the client.
class TimeoutSettings {
/// The timeout for the request including time to establish a connection.
final Duration? timeout;
/// The timeout for establishing a connection.
/// See [timeout] for the total timeout.
final Duration? connectTimeout;
/// Keep alive idle timeout. If not set, keep alive is disabled.
final Duration? keepAliveTimeout;
/// Keep alive ping interval.
/// Only valid if keepAliveTimeout is set and HTTP/2 is used.
final Duration keepAlivePing;
const TimeoutSettings({
this.timeout,
this.connectTimeout,
this.keepAliveTimeout,
this.keepAlivePing = const Duration(seconds: 30),
});
TimeoutSettings copyWith({
Duration? timeout,
Duration? connectTimeout,
Duration? keepAliveTimeout,
Duration? keepAlivePing,
}) {
return TimeoutSettings(
timeout: timeout ?? this.timeout,
connectTimeout: connectTimeout ?? this.connectTimeout,
keepAliveTimeout: keepAliveTimeout ?? this.keepAliveTimeout,
keepAlivePing: keepAlivePing ?? this.keepAlivePing,
);
}
}
sealed class DnsSettings {
const DnsSettings();
/// Static DNS settings and resolver overrides
/// for simple use cases.
const factory DnsSettings.static({
Map<String, List<String>> overrides,
String? fallback,
}) = StaticDnsSettings._;
/// Dynamic DNS settings and resolver for more complex use cases.
const factory DnsSettings.dynamic({
required Future<List<String>> Function(String host) resolver,
}) = DynamicDnsSettings._;
}
/// Static DNS settings and resolver overrides.
class StaticDnsSettings extends DnsSettings {
/// Overrides the DNS resolver for specific hosts.
/// The key is the host and the value is a list of IP addresses.
final Map<String, List<String>> overrides;
/// If set, the client will use this IP address for
/// all requests that don't match any override.
final String? fallback;
const StaticDnsSettings._({
this.overrides = const {},
this.fallback,
});
}
/// Dynamic DNS settings and resolver.
class DynamicDnsSettings extends DnsSettings {
/// The function to resolve the IP address for a host.
final Future<List<String>> Function(String host) resolver;
const DynamicDnsSettings._({
required this.resolver,
});
}
extension ClientSettingsExt on ClientSettings {
rust_client.ClientSettings toRustType() {
return rust_client.ClientSettings(
timeout: timeout,
connectTimeout: connectTimeout,
timeoutSettings: timeoutSettings?._toRustType(),
throwOnStatusCode: throwOnStatusCode,
proxySettings: proxySettings?._toRustType(),
redirectSettings: redirectSettings?._toRustType(),
tlsSettings: tlsSettings?._toRustType(),
dnsSettings: dnsSettings?._toRustType(),
);
}
}
@ -174,11 +317,43 @@ extension ClientSettingsExt on ClientSettings {
extension on ProxySettings {
rust_client.ProxySettings _toRustType() {
return switch (this) {
NoProxy() => rust_client.ProxySettings.noProxy,
NoProxy() => const rust_client.ProxySettings.noProxy(),
CustomProxy proxy => rust_client.ProxySettings.customProxyList([
proxy._toRustType(),
]),
CustomProxyList list => rust_client.ProxySettings.customProxyList(
list.proxies.map((e) => e._toRustType()).toList(),
),
};
}
}
extension on CustomProxy {
rust_client.CustomProxy _toRustType() {
return switch (this) {
StaticProxy s => rust_client.CustomProxy(
url: s.url,
condition: switch (s.condition) {
ProxyCondition.onlyHttp => rust_client.ProxyCondition.http,
ProxyCondition.onlyHttps => rust_client.ProxyCondition.https,
ProxyCondition.all => rust_client.ProxyCondition.all,
},
),
};
}
}
extension on TimeoutSettings {
rust_client.TimeoutSettings _toRustType() {
return rust_client.TimeoutSettings(
timeout: timeout,
connectTimeout: connectTimeout,
keepAliveTimeout: keepAliveTimeout,
keepAlivePing: keepAlivePing,
);
}
}
extension on RedirectSettings {
rust_client.RedirectSettings _toRustType() {
return switch (this) {
@ -212,3 +387,19 @@ extension on ClientCertificate {
);
}
}
extension on DnsSettings {
rust_client.DnsSettings _toRustType() {
return switch (this) {
StaticDnsSettings s => rust_client.createStaticResolverSync(
settings: rust_client.StaticDnsSettings(
overrides: s.overrides,
fallback: s.fallback,
),
),
DynamicDnsSettings d => rust_client.createDynamicResolverSync(
resolver: d.resolver,
),
};
}
}

View file

@ -9,11 +9,30 @@ import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
part 'client.freezed.dart';
// These functions are ignored because they are not marked as `pub`: `create_client`, `new_default`, `new`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`
// These types are ignored because they are not used by any `pub` functions: `DynamicDnsSettings`, `DynamicResolver`, `StaticResolver`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `resolve`, `resolve`
// These functions are ignored (category: IgnoreBecauseNotAllowedOwner): `digest_ip`
DnsSettings createStaticResolverSync({required StaticDnsSettings settings}) =>
RustLib.instance.api
.crateApiRhttpClientCreateStaticResolverSync(settings: settings);
DnsSettings createDynamicResolverSync(
{required FutureOr<List<String>> Function(String) resolver}) =>
RustLib.instance.api
.crateApiRhttpClientCreateDynamicResolverSync(resolver: resolver);
// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>>
abstract class DnsSettings implements RustOpaqueInterface {}
// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<RequestClient>>
abstract class RequestClient implements RustOpaqueInterface {}
abstract class SocketAddrDigester {
/// Adds the `FALLBACK_PORT` to the end of the string if it doesn't have a port.
Future<String> digestIp();
}
class ClientCertificate {
final Uint8List certificate;
final Uint8List privateKey;
@ -36,20 +55,20 @@ class ClientCertificate {
}
class ClientSettings {
final Duration? timeout;
final Duration? connectTimeout;
final TimeoutSettings? timeoutSettings;
final bool throwOnStatusCode;
final ProxySettings? proxySettings;
final RedirectSettings? redirectSettings;
final TlsSettings? tlsSettings;
final DnsSettings? dnsSettings;
const ClientSettings({
this.timeout,
this.connectTimeout,
this.timeoutSettings,
required this.throwOnStatusCode,
this.proxySettings,
this.redirectSettings,
this.tlsSettings,
this.dnsSettings,
});
static Future<ClientSettings> default_() =>
@ -57,31 +76,64 @@ class ClientSettings {
@override
int get hashCode =>
timeout.hashCode ^
connectTimeout.hashCode ^
timeoutSettings.hashCode ^
throwOnStatusCode.hashCode ^
proxySettings.hashCode ^
redirectSettings.hashCode ^
tlsSettings.hashCode;
tlsSettings.hashCode ^
dnsSettings.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ClientSettings &&
runtimeType == other.runtimeType &&
timeout == other.timeout &&
connectTimeout == other.connectTimeout &&
timeoutSettings == other.timeoutSettings &&
throwOnStatusCode == other.throwOnStatusCode &&
proxySettings == other.proxySettings &&
redirectSettings == other.redirectSettings &&
tlsSettings == other.tlsSettings;
tlsSettings == other.tlsSettings &&
dnsSettings == other.dnsSettings;
}
enum ProxySettings {
noProxy,
class CustomProxy {
final String url;
final ProxyCondition condition;
const CustomProxy({
required this.url,
required this.condition,
});
@override
int get hashCode => url.hashCode ^ condition.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is CustomProxy &&
runtimeType == other.runtimeType &&
url == other.url &&
condition == other.condition;
}
enum ProxyCondition {
http,
https,
all,
;
}
@freezed
sealed class ProxySettings with _$ProxySettings {
const ProxySettings._();
const factory ProxySettings.noProxy() = ProxySettings_NoProxy;
const factory ProxySettings.customProxyList(
List<CustomProxy> field0,
) = ProxySettings_CustomProxyList;
}
@freezed
sealed class RedirectSettings with _$RedirectSettings {
const RedirectSettings._();
@ -92,6 +144,58 @@ sealed class RedirectSettings with _$RedirectSettings {
) = RedirectSettings_LimitedRedirects;
}
class StaticDnsSettings {
final Map<String, List<String>> overrides;
final String? fallback;
const StaticDnsSettings({
required this.overrides,
this.fallback,
});
@override
int get hashCode => overrides.hashCode ^ fallback.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is StaticDnsSettings &&
runtimeType == other.runtimeType &&
overrides == other.overrides &&
fallback == other.fallback;
}
class TimeoutSettings {
final Duration? timeout;
final Duration? connectTimeout;
final Duration? keepAliveTimeout;
final Duration? keepAlivePing;
const TimeoutSettings({
this.timeout,
this.connectTimeout,
this.keepAliveTimeout,
this.keepAlivePing,
});
@override
int get hashCode =>
timeout.hashCode ^
connectTimeout.hashCode ^
keepAliveTimeout.hashCode ^
keepAlivePing.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TimeoutSettings &&
runtimeType == other.runtimeType &&
timeout == other.timeout &&
connectTimeout == other.connectTimeout &&
keepAliveTimeout == other.keepAliveTimeout &&
keepAlivePing == other.keepAlivePing;
}
class TlsSettings {
final bool trustRootCertificates;
final List<Uint8List> trustedRootCertificates;

View file

@ -14,6 +14,337 @@ T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$ProxySettings {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() noProxy,
required TResult Function(List<CustomProxy> field0) customProxyList,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function()? noProxy,
TResult? Function(List<CustomProxy> field0)? customProxyList,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? noProxy,
TResult Function(List<CustomProxy> field0)? customProxyList,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ProxySettings_NoProxy value) noProxy,
required TResult Function(ProxySettings_CustomProxyList value)
customProxyList,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult? Function(ProxySettings_NoProxy value)? noProxy,
TResult? Function(ProxySettings_CustomProxyList value)? customProxyList,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ProxySettings_NoProxy value)? noProxy,
TResult Function(ProxySettings_CustomProxyList value)? customProxyList,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProxySettingsCopyWith<$Res> {
factory $ProxySettingsCopyWith(
ProxySettings value, $Res Function(ProxySettings) then) =
_$ProxySettingsCopyWithImpl<$Res, ProxySettings>;
}
/// @nodoc
class _$ProxySettingsCopyWithImpl<$Res, $Val extends ProxySettings>
implements $ProxySettingsCopyWith<$Res> {
_$ProxySettingsCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ProxySettings
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
abstract class _$$ProxySettings_NoProxyImplCopyWith<$Res> {
factory _$$ProxySettings_NoProxyImplCopyWith(
_$ProxySettings_NoProxyImpl value,
$Res Function(_$ProxySettings_NoProxyImpl) then) =
__$$ProxySettings_NoProxyImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$ProxySettings_NoProxyImplCopyWithImpl<$Res>
extends _$ProxySettingsCopyWithImpl<$Res, _$ProxySettings_NoProxyImpl>
implements _$$ProxySettings_NoProxyImplCopyWith<$Res> {
__$$ProxySettings_NoProxyImplCopyWithImpl(_$ProxySettings_NoProxyImpl _value,
$Res Function(_$ProxySettings_NoProxyImpl) _then)
: super(_value, _then);
/// Create a copy of ProxySettings
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
class _$ProxySettings_NoProxyImpl extends ProxySettings_NoProxy {
const _$ProxySettings_NoProxyImpl() : super._();
@override
String toString() {
return 'ProxySettings.noProxy()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ProxySettings_NoProxyImpl);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() noProxy,
required TResult Function(List<CustomProxy> field0) customProxyList,
}) {
return noProxy();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function()? noProxy,
TResult? Function(List<CustomProxy> field0)? customProxyList,
}) {
return noProxy?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? noProxy,
TResult Function(List<CustomProxy> field0)? customProxyList,
required TResult orElse(),
}) {
if (noProxy != null) {
return noProxy();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ProxySettings_NoProxy value) noProxy,
required TResult Function(ProxySettings_CustomProxyList value)
customProxyList,
}) {
return noProxy(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult? Function(ProxySettings_NoProxy value)? noProxy,
TResult? Function(ProxySettings_CustomProxyList value)? customProxyList,
}) {
return noProxy?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ProxySettings_NoProxy value)? noProxy,
TResult Function(ProxySettings_CustomProxyList value)? customProxyList,
required TResult orElse(),
}) {
if (noProxy != null) {
return noProxy(this);
}
return orElse();
}
}
abstract class ProxySettings_NoProxy extends ProxySettings {
const factory ProxySettings_NoProxy() = _$ProxySettings_NoProxyImpl;
const ProxySettings_NoProxy._() : super._();
}
/// @nodoc
abstract class _$$ProxySettings_CustomProxyListImplCopyWith<$Res> {
factory _$$ProxySettings_CustomProxyListImplCopyWith(
_$ProxySettings_CustomProxyListImpl value,
$Res Function(_$ProxySettings_CustomProxyListImpl) then) =
__$$ProxySettings_CustomProxyListImplCopyWithImpl<$Res>;
@useResult
$Res call({List<CustomProxy> field0});
}
/// @nodoc
class __$$ProxySettings_CustomProxyListImplCopyWithImpl<$Res>
extends _$ProxySettingsCopyWithImpl<$Res,
_$ProxySettings_CustomProxyListImpl>
implements _$$ProxySettings_CustomProxyListImplCopyWith<$Res> {
__$$ProxySettings_CustomProxyListImplCopyWithImpl(
_$ProxySettings_CustomProxyListImpl _value,
$Res Function(_$ProxySettings_CustomProxyListImpl) _then)
: super(_value, _then);
/// Create a copy of ProxySettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? field0 = null,
}) {
return _then(_$ProxySettings_CustomProxyListImpl(
null == field0
? _value._field0
: field0 // ignore: cast_nullable_to_non_nullable
as List<CustomProxy>,
));
}
}
/// @nodoc
class _$ProxySettings_CustomProxyListImpl
extends ProxySettings_CustomProxyList {
const _$ProxySettings_CustomProxyListImpl(final List<CustomProxy> field0)
: _field0 = field0,
super._();
final List<CustomProxy> _field0;
@override
List<CustomProxy> get field0 {
if (_field0 is EqualUnmodifiableListView) return _field0;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_field0);
}
@override
String toString() {
return 'ProxySettings.customProxyList(field0: $field0)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ProxySettings_CustomProxyListImpl &&
const DeepCollectionEquality().equals(other._field0, _field0));
}
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(_field0));
/// Create a copy of ProxySettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProxySettings_CustomProxyListImplCopyWith<
_$ProxySettings_CustomProxyListImpl>
get copyWith => __$$ProxySettings_CustomProxyListImplCopyWithImpl<
_$ProxySettings_CustomProxyListImpl>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() noProxy,
required TResult Function(List<CustomProxy> field0) customProxyList,
}) {
return customProxyList(field0);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function()? noProxy,
TResult? Function(List<CustomProxy> field0)? customProxyList,
}) {
return customProxyList?.call(field0);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? noProxy,
TResult Function(List<CustomProxy> field0)? customProxyList,
required TResult orElse(),
}) {
if (customProxyList != null) {
return customProxyList(field0);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ProxySettings_NoProxy value) noProxy,
required TResult Function(ProxySettings_CustomProxyList value)
customProxyList,
}) {
return customProxyList(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult? Function(ProxySettings_NoProxy value)? noProxy,
TResult? Function(ProxySettings_CustomProxyList value)? customProxyList,
}) {
return customProxyList?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ProxySettings_NoProxy value)? noProxy,
TResult Function(ProxySettings_CustomProxyList value)? customProxyList,
required TResult orElse(),
}) {
if (customProxyList != null) {
return customProxyList(this);
}
return orElse();
}
}
abstract class ProxySettings_CustomProxyList extends ProxySettings {
const factory ProxySettings_CustomProxyList(final List<CustomProxy> field0) =
_$ProxySettings_CustomProxyListImpl;
const ProxySettings_CustomProxyList._() : super._();
List<CustomProxy> get field0;
/// Create a copy of ProxySettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProxySettings_CustomProxyListImplCopyWith<
_$ProxySettings_CustomProxyListImpl>
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
mixin _$RedirectSettings {
@optionalTypeArgs

File diff suppressed because it is too large Load diff

View file

@ -26,6 +26,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
get rust_arc_decrement_strong_count_CancellationTokenPtr => wire
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationTokenPtr;
CrossPlatformFinalizerArg
get rust_arc_decrement_strong_count_DnsSettingsPtr => wire
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettingsPtr;
CrossPlatformFinalizerArg
get rust_arc_decrement_strong_count_RequestClientPtr => wire
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClientPtr;
@ -43,6 +47,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
dynamic raw);
@protected
DnsSettings
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
RequestClient
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -66,6 +75,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
dco_decode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken_Output_unit_AnyhowException(
dynamic raw);
@protected
FutureOr<List<String>> Function(String)
dco_decode_DartFn_Inputs_String_Output_list_String_AnyhowException(
dynamic raw);
@protected
FutureOr<void> Function(HttpResponse)
dco_decode_DartFn_Inputs_http_response_Output_unit_AnyhowException(
@ -82,11 +96,19 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Map<String, String> dco_decode_Map_String_String(dynamic raw);
@protected
Map<String, List<String>> dco_decode_Map_String_list_String(dynamic raw);
@protected
CancellationToken
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
dynamic raw);
@protected
DnsSettings
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
RequestClient
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -99,9 +121,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
String dco_decode_String(dynamic raw);
@protected
SocketAddrDigester dco_decode_TraitDef_SocketAddrDigester(dynamic raw);
@protected
bool dco_decode_bool(dynamic raw);
@protected
DnsSettings
dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
Duration dco_decode_box_autoadd_Chrono_Duration(dynamic raw);
@ -123,6 +153,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RedirectSettings dco_decode_box_autoadd_redirect_settings(dynamic raw);
@protected
StaticDnsSettings dco_decode_box_autoadd_static_dns_settings(dynamic raw);
@protected
TimeoutSettings dco_decode_box_autoadd_timeout_settings(dynamic raw);
@protected
TlsSettings dco_decode_box_autoadd_tls_settings(dynamic raw);
@ -135,6 +171,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
ClientSettings dco_decode_client_settings(dynamic raw);
@protected
CustomProxy dco_decode_custom_proxy(dynamic raw);
@protected
HttpHeaders dco_decode_http_headers(dynamic raw);
@ -159,6 +198,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 dco_decode_isize(dynamic raw);
@protected
List<String> dco_decode_list_String(dynamic raw);
@protected
List<CustomProxy> dco_decode_list_custom_proxy(dynamic raw);
@protected
List<Uint8List> dco_decode_list_list_prim_u_8_strict(dynamic raw);
@ -168,6 +213,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
@protected
List<(String, List<String>)> dco_decode_list_record_string_list_string(
dynamic raw);
@protected
List<(String, String)> dco_decode_list_record_string_string(dynamic raw);
@ -176,6 +225,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
dynamic raw);
@protected
String? dco_decode_opt_String(dynamic raw);
@protected
DnsSettings?
dco_decode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
Duration? dco_decode_opt_box_autoadd_Chrono_Duration(dynamic raw);
@ -194,6 +251,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RedirectSettings? dco_decode_opt_box_autoadd_redirect_settings(dynamic raw);
@protected
TimeoutSettings? dco_decode_opt_box_autoadd_timeout_settings(dynamic raw);
@protected
TlsSettings? dco_decode_opt_box_autoadd_tls_settings(dynamic raw);
@ -206,9 +266,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
List<(String, String)>? dco_decode_opt_list_record_string_string(dynamic raw);
@protected
ProxyCondition dco_decode_proxy_condition(dynamic raw);
@protected
ProxySettings dco_decode_proxy_settings(dynamic raw);
@protected
(String, List<String>) dco_decode_record_string_list_string(dynamic raw);
@protected
(String, String) dco_decode_record_string_string(dynamic raw);
@ -218,6 +284,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RhttpError dco_decode_rhttp_error(dynamic raw);
@protected
StaticDnsSettings dco_decode_static_dns_settings(dynamic raw);
@protected
TimeoutSettings dco_decode_timeout_settings(dynamic raw);
@protected
TlsSettings dco_decode_tls_settings(dynamic raw);
@ -249,6 +321,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
SseDeserializer deserializer);
@protected
DnsSettings
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
RequestClient
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -274,11 +351,20 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
Map<String, String> sse_decode_Map_String_String(
SseDeserializer deserializer);
@protected
Map<String, List<String>> sse_decode_Map_String_list_String(
SseDeserializer deserializer);
@protected
CancellationToken
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
SseDeserializer deserializer);
@protected
DnsSettings
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
RequestClient
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -294,6 +380,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
bool sse_decode_bool(SseDeserializer deserializer);
@protected
DnsSettings
sse_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
Duration sse_decode_box_autoadd_Chrono_Duration(SseDeserializer deserializer);
@ -320,6 +411,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RedirectSettings sse_decode_box_autoadd_redirect_settings(
SseDeserializer deserializer);
@protected
StaticDnsSettings sse_decode_box_autoadd_static_dns_settings(
SseDeserializer deserializer);
@protected
TimeoutSettings sse_decode_box_autoadd_timeout_settings(
SseDeserializer deserializer);
@protected
TlsSettings sse_decode_box_autoadd_tls_settings(SseDeserializer deserializer);
@ -332,6 +431,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
ClientSettings sse_decode_client_settings(SseDeserializer deserializer);
@protected
CustomProxy sse_decode_custom_proxy(SseDeserializer deserializer);
@protected
HttpHeaders sse_decode_http_headers(SseDeserializer deserializer);
@ -356,6 +458,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 sse_decode_isize(SseDeserializer deserializer);
@protected
List<String> sse_decode_list_String(SseDeserializer deserializer);
@protected
List<CustomProxy> sse_decode_list_custom_proxy(SseDeserializer deserializer);
@protected
List<Uint8List> sse_decode_list_list_prim_u_8_strict(
SseDeserializer deserializer);
@ -366,6 +474,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
@protected
List<(String, List<String>)> sse_decode_list_record_string_list_string(
SseDeserializer deserializer);
@protected
List<(String, String)> sse_decode_list_record_string_string(
SseDeserializer deserializer);
@ -375,6 +487,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
SseDeserializer deserializer);
@protected
String? sse_decode_opt_String(SseDeserializer deserializer);
@protected
DnsSettings?
sse_decode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
Duration? sse_decode_opt_box_autoadd_Chrono_Duration(
SseDeserializer deserializer);
@ -399,6 +519,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RedirectSettings? sse_decode_opt_box_autoadd_redirect_settings(
SseDeserializer deserializer);
@protected
TimeoutSettings? sse_decode_opt_box_autoadd_timeout_settings(
SseDeserializer deserializer);
@protected
TlsSettings? sse_decode_opt_box_autoadd_tls_settings(
SseDeserializer deserializer);
@ -414,9 +538,16 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
List<(String, String)>? sse_decode_opt_list_record_string_string(
SseDeserializer deserializer);
@protected
ProxyCondition sse_decode_proxy_condition(SseDeserializer deserializer);
@protected
ProxySettings sse_decode_proxy_settings(SseDeserializer deserializer);
@protected
(String, List<String>) sse_decode_record_string_list_string(
SseDeserializer deserializer);
@protected
(String, String) sse_decode_record_string_string(
SseDeserializer deserializer);
@ -427,6 +558,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RhttpError sse_decode_rhttp_error(SseDeserializer deserializer);
@protected
StaticDnsSettings sse_decode_static_dns_settings(
SseDeserializer deserializer);
@protected
TimeoutSettings sse_decode_timeout_settings(SseDeserializer deserializer);
@protected
TlsSettings sse_decode_tls_settings(SseDeserializer deserializer);
@ -459,6 +597,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
CancellationToken self, SseSerializer serializer);
@protected
void
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings self, SseSerializer serializer);
@protected
void
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -483,6 +626,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
FutureOr<void> Function(CancellationToken) self,
SseSerializer serializer);
@protected
void sse_encode_DartFn_Inputs_String_Output_list_String_AnyhowException(
FutureOr<List<String>> Function(String) self, SseSerializer serializer);
@protected
void sse_encode_DartFn_Inputs_http_response_Output_unit_AnyhowException(
FutureOr<void> Function(HttpResponse) self, SseSerializer serializer);
@ -498,11 +645,20 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_Map_String_String(
Map<String, String> self, SseSerializer serializer);
@protected
void sse_encode_Map_String_list_String(
Map<String, List<String>> self, SseSerializer serializer);
@protected
void
sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
CancellationToken self, SseSerializer serializer);
@protected
void
sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings self, SseSerializer serializer);
@protected
void
sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -518,6 +674,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_bool(bool self, SseSerializer serializer);
@protected
void
sse_encode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_Chrono_Duration(
Duration self, SseSerializer serializer);
@ -546,6 +707,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_box_autoadd_redirect_settings(
RedirectSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_static_dns_settings(
StaticDnsSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_timeout_settings(
TimeoutSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_tls_settings(
TlsSettings self, SseSerializer serializer);
@ -562,6 +731,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_client_settings(
ClientSettings self, SseSerializer serializer);
@protected
void sse_encode_custom_proxy(CustomProxy self, SseSerializer serializer);
@protected
void sse_encode_http_headers(HttpHeaders self, SseSerializer serializer);
@ -587,6 +759,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_isize(PlatformInt64 self, SseSerializer serializer);
@protected
void sse_encode_list_String(List<String> self, SseSerializer serializer);
@protected
void sse_encode_list_custom_proxy(
List<CustomProxy> self, SseSerializer serializer);
@protected
void sse_encode_list_list_prim_u_8_strict(
List<Uint8List> self, SseSerializer serializer);
@ -598,6 +777,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_list_prim_u_8_strict(
Uint8List self, SseSerializer serializer);
@protected
void sse_encode_list_record_string_list_string(
List<(String, List<String>)> self, SseSerializer serializer);
@protected
void sse_encode_list_record_string_string(
List<(String, String)> self, SseSerializer serializer);
@ -607,6 +790,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
RequestClient? self, SseSerializer serializer);
@protected
void sse_encode_opt_String(String? self, SseSerializer serializer);
@protected
void
sse_encode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_Chrono_Duration(
Duration? self, SseSerializer serializer);
@ -631,6 +822,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_opt_box_autoadd_redirect_settings(
RedirectSettings? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_timeout_settings(
TimeoutSettings? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_tls_settings(
TlsSettings? self, SseSerializer serializer);
@ -647,9 +842,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_opt_list_record_string_string(
List<(String, String)>? self, SseSerializer serializer);
@protected
void sse_encode_proxy_condition(
ProxyCondition self, SseSerializer serializer);
@protected
void sse_encode_proxy_settings(ProxySettings self, SseSerializer serializer);
@protected
void sse_encode_record_string_list_string(
(String, List<String>) self, SseSerializer serializer);
@protected
void sse_encode_record_string_string(
(String, String) self, SseSerializer serializer);
@ -661,6 +864,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_rhttp_error(RhttpError self, SseSerializer serializer);
@protected
void sse_encode_static_dns_settings(
StaticDnsSettings self, SseSerializer serializer);
@protected
void sse_encode_timeout_settings(
TimeoutSettings self, SseSerializer serializer);
@protected
void sse_encode_tls_settings(TlsSettings self, SseSerializer serializer);
@ -726,6 +937,38 @@ class RustLibWire implements BaseWire {
_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationTokenPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
void
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ffi.Pointer<ffi.Void> ptr,
) {
return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr,
);
}
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettingsPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_mangayomi_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings');
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings =
_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettingsPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
void
rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ffi.Pointer<ffi.Void> ptr,
) {
return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr,
);
}
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettingsPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_mangayomi_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings');
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings =
_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettingsPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
void
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
ffi.Pointer<ffi.Void> ptr,

View file

@ -28,6 +28,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
get rust_arc_decrement_strong_count_CancellationTokenPtr => wire
.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken;
CrossPlatformFinalizerArg
get rust_arc_decrement_strong_count_DnsSettingsPtr => wire
.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings;
CrossPlatformFinalizerArg
get rust_arc_decrement_strong_count_RequestClientPtr => wire
.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient;
@ -45,6 +49,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
dynamic raw);
@protected
DnsSettings
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
RequestClient
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -68,6 +77,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
dco_decode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken_Output_unit_AnyhowException(
dynamic raw);
@protected
FutureOr<List<String>> Function(String)
dco_decode_DartFn_Inputs_String_Output_list_String_AnyhowException(
dynamic raw);
@protected
FutureOr<void> Function(HttpResponse)
dco_decode_DartFn_Inputs_http_response_Output_unit_AnyhowException(
@ -84,11 +98,19 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Map<String, String> dco_decode_Map_String_String(dynamic raw);
@protected
Map<String, List<String>> dco_decode_Map_String_list_String(dynamic raw);
@protected
CancellationToken
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
dynamic raw);
@protected
DnsSettings
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
RequestClient
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -101,9 +123,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
String dco_decode_String(dynamic raw);
@protected
SocketAddrDigester dco_decode_TraitDef_SocketAddrDigester(dynamic raw);
@protected
bool dco_decode_bool(dynamic raw);
@protected
DnsSettings
dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
Duration dco_decode_box_autoadd_Chrono_Duration(dynamic raw);
@ -125,6 +155,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RedirectSettings dco_decode_box_autoadd_redirect_settings(dynamic raw);
@protected
StaticDnsSettings dco_decode_box_autoadd_static_dns_settings(dynamic raw);
@protected
TimeoutSettings dco_decode_box_autoadd_timeout_settings(dynamic raw);
@protected
TlsSettings dco_decode_box_autoadd_tls_settings(dynamic raw);
@ -137,6 +173,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
ClientSettings dco_decode_client_settings(dynamic raw);
@protected
CustomProxy dco_decode_custom_proxy(dynamic raw);
@protected
HttpHeaders dco_decode_http_headers(dynamic raw);
@ -161,6 +200,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 dco_decode_isize(dynamic raw);
@protected
List<String> dco_decode_list_String(dynamic raw);
@protected
List<CustomProxy> dco_decode_list_custom_proxy(dynamic raw);
@protected
List<Uint8List> dco_decode_list_list_prim_u_8_strict(dynamic raw);
@ -170,6 +215,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
@protected
List<(String, List<String>)> dco_decode_list_record_string_list_string(
dynamic raw);
@protected
List<(String, String)> dco_decode_list_record_string_string(dynamic raw);
@ -178,6 +227,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
dco_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
dynamic raw);
@protected
String? dco_decode_opt_String(dynamic raw);
@protected
DnsSettings?
dco_decode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
dynamic raw);
@protected
Duration? dco_decode_opt_box_autoadd_Chrono_Duration(dynamic raw);
@ -196,6 +253,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RedirectSettings? dco_decode_opt_box_autoadd_redirect_settings(dynamic raw);
@protected
TimeoutSettings? dco_decode_opt_box_autoadd_timeout_settings(dynamic raw);
@protected
TlsSettings? dco_decode_opt_box_autoadd_tls_settings(dynamic raw);
@ -208,9 +268,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
List<(String, String)>? dco_decode_opt_list_record_string_string(dynamic raw);
@protected
ProxyCondition dco_decode_proxy_condition(dynamic raw);
@protected
ProxySettings dco_decode_proxy_settings(dynamic raw);
@protected
(String, List<String>) dco_decode_record_string_list_string(dynamic raw);
@protected
(String, String) dco_decode_record_string_string(dynamic raw);
@ -220,6 +286,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RhttpError dco_decode_rhttp_error(dynamic raw);
@protected
StaticDnsSettings dco_decode_static_dns_settings(dynamic raw);
@protected
TimeoutSettings dco_decode_timeout_settings(dynamic raw);
@protected
TlsSettings dco_decode_tls_settings(dynamic raw);
@ -251,6 +323,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
SseDeserializer deserializer);
@protected
DnsSettings
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
RequestClient
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -276,11 +353,20 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
Map<String, String> sse_decode_Map_String_String(
SseDeserializer deserializer);
@protected
Map<String, List<String>> sse_decode_Map_String_list_String(
SseDeserializer deserializer);
@protected
CancellationToken
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
SseDeserializer deserializer);
@protected
DnsSettings
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
RequestClient
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -296,6 +382,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
bool sse_decode_bool(SseDeserializer deserializer);
@protected
DnsSettings
sse_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
Duration sse_decode_box_autoadd_Chrono_Duration(SseDeserializer deserializer);
@ -322,6 +413,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RedirectSettings sse_decode_box_autoadd_redirect_settings(
SseDeserializer deserializer);
@protected
StaticDnsSettings sse_decode_box_autoadd_static_dns_settings(
SseDeserializer deserializer);
@protected
TimeoutSettings sse_decode_box_autoadd_timeout_settings(
SseDeserializer deserializer);
@protected
TlsSettings sse_decode_box_autoadd_tls_settings(SseDeserializer deserializer);
@ -334,6 +433,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
ClientSettings sse_decode_client_settings(SseDeserializer deserializer);
@protected
CustomProxy sse_decode_custom_proxy(SseDeserializer deserializer);
@protected
HttpHeaders sse_decode_http_headers(SseDeserializer deserializer);
@ -358,6 +460,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 sse_decode_isize(SseDeserializer deserializer);
@protected
List<String> sse_decode_list_String(SseDeserializer deserializer);
@protected
List<CustomProxy> sse_decode_list_custom_proxy(SseDeserializer deserializer);
@protected
List<Uint8List> sse_decode_list_list_prim_u_8_strict(
SseDeserializer deserializer);
@ -368,6 +476,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
@protected
List<(String, List<String>)> sse_decode_list_record_string_list_string(
SseDeserializer deserializer);
@protected
List<(String, String)> sse_decode_list_record_string_string(
SseDeserializer deserializer);
@ -377,6 +489,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_decode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
SseDeserializer deserializer);
@protected
String? sse_decode_opt_String(SseDeserializer deserializer);
@protected
DnsSettings?
sse_decode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
SseDeserializer deserializer);
@protected
Duration? sse_decode_opt_box_autoadd_Chrono_Duration(
SseDeserializer deserializer);
@ -401,6 +521,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RedirectSettings? sse_decode_opt_box_autoadd_redirect_settings(
SseDeserializer deserializer);
@protected
TimeoutSettings? sse_decode_opt_box_autoadd_timeout_settings(
SseDeserializer deserializer);
@protected
TlsSettings? sse_decode_opt_box_autoadd_tls_settings(
SseDeserializer deserializer);
@ -416,9 +540,16 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
List<(String, String)>? sse_decode_opt_list_record_string_string(
SseDeserializer deserializer);
@protected
ProxyCondition sse_decode_proxy_condition(SseDeserializer deserializer);
@protected
ProxySettings sse_decode_proxy_settings(SseDeserializer deserializer);
@protected
(String, List<String>) sse_decode_record_string_list_string(
SseDeserializer deserializer);
@protected
(String, String) sse_decode_record_string_string(
SseDeserializer deserializer);
@ -429,6 +560,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RhttpError sse_decode_rhttp_error(SseDeserializer deserializer);
@protected
StaticDnsSettings sse_decode_static_dns_settings(
SseDeserializer deserializer);
@protected
TimeoutSettings sse_decode_timeout_settings(SseDeserializer deserializer);
@protected
TlsSettings sse_decode_tls_settings(SseDeserializer deserializer);
@ -461,6 +599,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
CancellationToken self, SseSerializer serializer);
@protected
void
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings self, SseSerializer serializer);
@protected
void
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -485,6 +628,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
FutureOr<void> Function(CancellationToken) self,
SseSerializer serializer);
@protected
void sse_encode_DartFn_Inputs_String_Output_list_String_AnyhowException(
FutureOr<List<String>> Function(String) self, SseSerializer serializer);
@protected
void sse_encode_DartFn_Inputs_http_response_Output_unit_AnyhowException(
FutureOr<void> Function(HttpResponse) self, SseSerializer serializer);
@ -500,11 +647,20 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_Map_String_String(
Map<String, String> self, SseSerializer serializer);
@protected
void sse_encode_Map_String_list_String(
Map<String, List<String>> self, SseSerializer serializer);
@protected
void
sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
CancellationToken self, SseSerializer serializer);
@protected
void
sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings self, SseSerializer serializer);
@protected
void
sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
@ -520,6 +676,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_bool(bool self, SseSerializer serializer);
@protected
void
sse_encode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_Chrono_Duration(
Duration self, SseSerializer serializer);
@ -548,6 +709,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_box_autoadd_redirect_settings(
RedirectSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_static_dns_settings(
StaticDnsSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_timeout_settings(
TimeoutSettings self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_tls_settings(
TlsSettings self, SseSerializer serializer);
@ -564,6 +733,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_client_settings(
ClientSettings self, SseSerializer serializer);
@protected
void sse_encode_custom_proxy(CustomProxy self, SseSerializer serializer);
@protected
void sse_encode_http_headers(HttpHeaders self, SseSerializer serializer);
@ -589,6 +761,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_isize(PlatformInt64 self, SseSerializer serializer);
@protected
void sse_encode_list_String(List<String> self, SseSerializer serializer);
@protected
void sse_encode_list_custom_proxy(
List<CustomProxy> self, SseSerializer serializer);
@protected
void sse_encode_list_list_prim_u_8_strict(
List<Uint8List> self, SseSerializer serializer);
@ -600,6 +779,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_list_prim_u_8_strict(
Uint8List self, SseSerializer serializer);
@protected
void sse_encode_list_record_string_list_string(
List<(String, List<String>)> self, SseSerializer serializer);
@protected
void sse_encode_list_record_string_string(
List<(String, String)> self, SseSerializer serializer);
@ -609,6 +792,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
sse_encode_opt_AutoExplicit_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
RequestClient? self, SseSerializer serializer);
@protected
void sse_encode_opt_String(String? self, SseSerializer serializer);
@protected
void
sse_encode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
DnsSettings? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_Chrono_Duration(
Duration? self, SseSerializer serializer);
@ -633,6 +824,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_opt_box_autoadd_redirect_settings(
RedirectSettings? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_timeout_settings(
TimeoutSettings? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_tls_settings(
TlsSettings? self, SseSerializer serializer);
@ -649,9 +844,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_opt_list_record_string_string(
List<(String, String)>? self, SseSerializer serializer);
@protected
void sse_encode_proxy_condition(
ProxyCondition self, SseSerializer serializer);
@protected
void sse_encode_proxy_settings(ProxySettings self, SseSerializer serializer);
@protected
void sse_encode_record_string_list_string(
(String, List<String>) self, SseSerializer serializer);
@protected
void sse_encode_record_string_string(
(String, String) self, SseSerializer serializer);
@ -663,6 +866,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_rhttp_error(RhttpError self, SseSerializer serializer);
@protected
void sse_encode_static_dns_settings(
StaticDnsSettings self, SseSerializer serializer);
@protected
void sse_encode_timeout_settings(
TimeoutSettings self, SseSerializer serializer);
@protected
void sse_encode_tls_settings(TlsSettings self, SseSerializer serializer);
@ -699,6 +910,18 @@ class RustLibWire implements BaseWire {
.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
ptr);
void rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
int ptr) =>
wasmModule
.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr);
void rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
int ptr) =>
wasmModule
.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr);
void rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
int ptr) =>
wasmModule
@ -726,6 +949,14 @@ extension type RustLibWasmModule._(JSObject _) implements JSObject {
rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerCancellationToken(
int ptr);
external void
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
int ptr);
external void
rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
int ptr);
external void
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
int ptr);

13
rust/Cargo.lock generated
View file

@ -1616,6 +1616,7 @@ dependencies = [
"sync_wrapper",
"tokio",
"tokio-rustls",
"tokio-socks",
"tokio-util",
"tower-service",
"url",
@ -2022,6 +2023,18 @@ dependencies = [
"tokio",
]
[[package]]
name = "tokio-socks"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f"
dependencies = [
"either",
"futures-util",
"thiserror",
"tokio",
]
[[package]]
name = "tokio-util"
version = "0.7.12"

View file

@ -11,6 +11,6 @@ flutter_rust_bridge = { version = "=2.7.0", features = ["chrono"] }
image = "0.25.5"
chrono = "0.4.38"
futures-util = "0.3.31"
reqwest = { version = "0.12.9", default-features = false, features = ["charset", "http2", "rustls-tls", "rustls-tls-native-roots", "stream", "multipart", "brotli", "gzip"] }
reqwest = { version = "0.12.9", default-features = false, features = ["charset", "http2", "rustls-tls", "rustls-tls-native-roots", "stream", "multipart", "socks", "brotli", "gzip"] }
tokio = { version = "1.41.1", features = ["full"] }
tokio-util = "0.7.12"

View file

@ -1,26 +1,46 @@
use std::str::FromStr;
use std::{collections::HashMap, net::SocketAddr, sync::Arc};
use crate::api::rhttp::error::RhttpError;
use chrono::Duration;
use flutter_rust_bridge::{frb, DartFnFuture};
use reqwest::dns::{Addrs, Name, Resolve, Resolving};
use reqwest::{tls, Certificate};
pub use tokio_util::sync::CancellationToken;
pub struct ClientSettings {
pub timeout: Option<Duration>,
pub connect_timeout: Option<Duration>,
pub timeout_settings: Option<TimeoutSettings>,
pub throw_on_status_code: bool,
pub proxy_settings: Option<ProxySettings>,
pub redirect_settings: Option<RedirectSettings>,
pub tls_settings: Option<TlsSettings>,
pub dns_settings: Option<DnsSettings>,
}
pub enum ProxySettings {
NoProxy,
CustomProxyList(Vec<CustomProxy>),
}
pub struct CustomProxy {
pub url: String,
pub condition: ProxyCondition,
}
pub enum ProxyCondition {
Http,
Https,
All,
}
pub enum RedirectSettings {
NoRedirect,
LimitedRedirects(i32),
}
pub struct TimeoutSettings {
pub timeout: Option<Duration>,
pub connect_timeout: Option<Duration>,
pub keep_alive_timeout: Option<Duration>,
pub keep_alive_ping: Option<Duration>,
}
pub struct TlsSettings {
pub trust_root_certificates: bool,
pub trusted_root_certificates: Vec<Vec<u8>>,
@ -30,6 +50,21 @@ pub struct TlsSettings {
pub max_tls_version: Option<TlsVersion>,
}
pub enum DnsSettings {
StaticDns(StaticDnsSettings),
DynamicDns(DynamicDnsSettings),
}
pub struct StaticDnsSettings {
pub overrides: HashMap<String, Vec<String>>,
pub fallback: Option<String>,
}
pub struct DynamicDnsSettings {
/// A function that takes a hostname and returns a future that resolves to an IP address.
resolver: Arc<dyn Fn(String) -> DartFnFuture<Vec<String>> + 'static + Send + Sync>,
}
pub struct ClientCertificate {
pub certificate: Vec<u8>,
pub private_key: Vec<u8>,
@ -43,12 +78,12 @@ pub enum TlsVersion {
impl Default for ClientSettings {
fn default() -> Self {
ClientSettings {
timeout: None,
connect_timeout: None,
timeout_settings: None,
throw_on_status_code: true,
proxy_settings: None,
redirect_settings: None,
tls_settings: None,
dns_settings: None,
}
}
}
@ -78,6 +113,19 @@ fn create_client(settings: ClientSettings) -> Result<RequestClient, RhttpError>
if let Some(proxy_settings) = settings.proxy_settings {
match proxy_settings {
ProxySettings::NoProxy => client = client.no_proxy(),
ProxySettings::CustomProxyList(proxies) => {
for proxy in proxies {
let proxy = match proxy.condition {
ProxyCondition::Http => reqwest::Proxy::http(&proxy.url),
ProxyCondition::Https => reqwest::Proxy::https(&proxy.url),
ProxyCondition::All => reqwest::Proxy::all(&proxy.url),
}
.map_err(|e| {
RhttpError::RhttpUnknownError(format!("Error creating proxy: {e:?}"))
})?;
client = client.proxy(proxy);
}
}
}
}
@ -90,19 +138,40 @@ fn create_client(settings: ClientSettings) -> Result<RequestClient, RhttpError>
};
}
if let Some(timeout) = settings.timeout {
client = client.timeout(
timeout
if let Some(timeout_settings) = settings.timeout_settings {
if let Some(timeout) = timeout_settings.timeout {
client = client.timeout(
timeout
.to_std()
.map_err(|e| RhttpError::RhttpUnknownError(e.to_string()))?,
);
}
if let Some(timeout) = timeout_settings.connect_timeout {
client = client.connect_timeout(
timeout
.to_std()
.map_err(|e| RhttpError::RhttpUnknownError(e.to_string()))?,
);
}
if let Some(keep_alive_timeout) = timeout_settings.keep_alive_timeout {
let timeout = keep_alive_timeout
.to_std()
.map_err(|e| RhttpError::RhttpUnknownError(e.to_string()))?,
);
}
if let Some(timeout) = settings.connect_timeout {
client = client.connect_timeout(
timeout
.to_std()
.map_err(|e| RhttpError::RhttpUnknownError(e.to_string()))?,
);
.map_err(|e| RhttpError::RhttpUnknownError(e.to_string()))?;
if timeout.as_millis() > 0 {
client = client.tcp_keepalive(timeout);
client = client.http2_keep_alive_while_idle(true);
client = client.http2_keep_alive_timeout(timeout);
}
}
if let Some(keep_alive_ping) = timeout_settings.keep_alive_ping {
client = client.http2_keep_alive_interval(
keep_alive_ping
.to_std()
.map_err(|e| RhttpError::RhttpUnknownError(e.to_string()))?,
);
}
}
if let Some(tls_settings) = settings.tls_settings {
@ -151,6 +220,46 @@ fn create_client(settings: ClientSettings) -> Result<RequestClient, RhttpError>
});
}
}
if let Some(dns_settings) = settings.dns_settings {
match dns_settings {
DnsSettings::StaticDns(settings) => {
if let Some(fallback) = settings.fallback {
client = client.dns_resolver(Arc::new(StaticResolver {
address: SocketAddr::from_str(fallback.digest_ip().as_str())
.map_err(|e| RhttpError::RhttpUnknownError(format!("{e:?}")))?,
}));
}
for dns_override in settings.overrides {
let (hostname, ip) = dns_override;
let hostname = hostname.as_str();
let mut err: Option<String> = None;
let ip = ip
.into_iter()
.map(|ip| {
let ip_digested = ip.digest_ip();
SocketAddr::from_str(ip_digested.as_str()).map_err(|e| {
err = Some(format!("Invalid IP address: {ip_digested}. {e:?}"));
RhttpError::RhttpUnknownError(e.to_string())
})
})
.filter_map(Result::ok)
.collect::<Vec<SocketAddr>>();
if let Some(error) = err {
return Err(RhttpError::RhttpUnknownError(error));
}
client = client.resolve_to_addrs(hostname, ip.as_slice());
}
}
DnsSettings::DynamicDns(settings) => {
client = client.dns_resolver(Arc::new(DynamicResolver {
resolver: settings.resolver,
}));
}
}
}
client
.build()
@ -163,3 +272,85 @@ fn create_client(settings: ClientSettings) -> Result<RequestClient, RhttpError>
cancel_token: CancellationToken::new(),
})
}
struct StaticResolver {
address: SocketAddr,
}
impl Resolve for StaticResolver {
fn resolve(&self, _: Name) -> Resolving {
let addrs: Addrs = Box::new(vec![self.address].clone().into_iter());
Box::pin(futures_util::future::ready(Ok(addrs)))
}
}
struct DynamicResolver {
resolver: Arc<dyn Fn(String) -> DartFnFuture<Vec<String>> + 'static + Send + Sync>,
}
impl Resolve for DynamicResolver {
fn resolve(&self, name: Name) -> Resolving {
let resolver = self.resolver.clone();
Box::pin(async move {
let ip = resolver(name.as_str().to_owned()).await;
let ip = ip
.into_iter()
.map(|ip| {
let ip_digested = ip.digest_ip();
SocketAddr::from_str(ip_digested.as_str()).map_err(|e| {
RhttpError::RhttpUnknownError(format!(
"Invalid IP address: {ip_digested}. {e:?}"
))
})
})
.filter_map(Result::ok)
.collect::<Vec<SocketAddr>>();
let addrs: Addrs = Box::new(ip.into_iter());
Ok(addrs)
})
}
}
#[frb(sync)]
pub fn create_static_resolver_sync(settings: StaticDnsSettings) -> DnsSettings {
DnsSettings::StaticDns(settings)
}
#[frb(sync)]
pub fn create_dynamic_resolver_sync(
resolver: impl Fn(String) -> DartFnFuture<Vec<String>> + 'static + Send + Sync,
) -> DnsSettings {
DnsSettings::DynamicDns(DynamicDnsSettings {
resolver: Arc::new(resolver),
})
}
// According to reqwest documentation,
// the port "0" will use the "conventional port for the given scheme"
// e.g. 80 for HTTP, 443 for HTTPS.
const FALLBACK_PORT: &'static str = "0";
pub(crate) trait SocketAddrDigester {
/// Adds the `FALLBACK_PORT` to the end of the string if it doesn't have a port.
fn digest_ip(self) -> String;
}
impl SocketAddrDigester for String {
fn digest_ip(self) -> String {
let has_dot = self.contains(".");
if has_dot && !self.contains(":") {
// IPv4 without port
return format!("{self}:{FALLBACK_PORT}");
}
if !has_dot && !self.contains("[") {
// IPv6 without port
return format!("[{self}]:{FALLBACK_PORT}");
}
self
}
}

View file

@ -39,7 +39,7 @@ flutter_rust_bridge::frb_generated_boilerplate!(
default_rust_auto_opaque = RustAutoOpaqueMoi,
);
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.7.0";
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 107666026;
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 885218533;
// Section: executor
@ -184,6 +184,73 @@ fn wire__crate__api__rhttp__client__client_settings_default_impl(
},
)
}
fn wire__crate__api__rhttp__client__create_dynamic_resolver_sync_impl(
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::<flutter_rust_bridge::for_generated::SseCodec, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "create_dynamic_resolver_sync",
port: None,
mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync,
},
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_resolver = decode_DartFn_Inputs_String_Output_list_String_AnyhowException(
<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer),
);
deserializer.end();
transform_result_sse::<_, ()>((move || {
let output_ok = Result::<_, ()>::Ok(
crate::api::rhttp::client::create_dynamic_resolver_sync(api_resolver),
)?;
Ok(output_ok)
})())
},
)
}
fn wire__crate__api__rhttp__client__create_static_resolver_sync_impl(
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::<flutter_rust_bridge::for_generated::SseCodec, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "create_static_resolver_sync",
port: None,
mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync,
},
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_settings =
<crate::api::rhttp::client::StaticDnsSettings>::sse_decode(&mut deserializer);
deserializer.end();
transform_result_sse::<_, ()>((move || {
let output_ok = Result::<_, ()>::Ok(
crate::api::rhttp::client::create_static_resolver_sync(api_settings),
)?;
Ok(output_ok)
})())
},
)
}
fn wire__crate__api__rhttp__http__make_http_request_receive_stream_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
@ -345,6 +412,38 @@ fn decode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRu
))
}
}
fn decode_DartFn_Inputs_String_Output_list_String_AnyhowException(
dart_opaque: flutter_rust_bridge::DartOpaque,
) -> impl Fn(String) -> flutter_rust_bridge::DartFnFuture<Vec<String>> {
use flutter_rust_bridge::IntoDart;
async fn body(dart_opaque: flutter_rust_bridge::DartOpaque, arg0: String) -> Vec<String> {
let args = vec![arg0.into_into_dart().into_dart()];
let message = FLUTTER_RUST_BRIDGE_HANDLER
.dart_fn_invoke(dart_opaque, args)
.await;
let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message);
let action = deserializer.cursor.read_u8().unwrap();
let ans = match action {
0 => std::result::Result::Ok(<Vec<String>>::sse_decode(&mut deserializer)),
1 => std::result::Result::Err(
<flutter_rust_bridge::for_generated::anyhow::Error>::sse_decode(&mut deserializer),
),
_ => unreachable!(),
};
deserializer.end();
let ans = ans.expect("Dart throws exception but Rust side assume it is not failable");
ans
}
move |arg0: String| {
flutter_rust_bridge::for_generated::convert_into_dart_fn_future(body(
dart_opaque.clone(),
arg0,
))
}
}
fn decode_DartFn_Inputs_http_response_Output_unit_AnyhowException(
dart_opaque: flutter_rust_bridge::DartOpaque,
) -> impl Fn(crate::api::rhttp::http::HttpResponse) -> flutter_rust_bridge::DartFnFuture<()> {
@ -418,6 +517,9 @@ fn decode_DartFn_Inputs_rhttp_error_Output_unit_AnyhowException(
flutter_rust_bridge::frb_generated_moi_arc_impl_value!(
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<CancellationToken>
);
flutter_rust_bridge::frb_generated_moi_arc_impl_value!(
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>
);
flutter_rust_bridge::frb_generated_moi_arc_impl_value!(
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<RequestClient>
);
@ -452,6 +554,16 @@ impl SseDecode for CancellationToken {
}
}
impl SseDecode for DnsSettings {
// 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::RustAutoOpaqueInner<DnsSettings>,
>>::sse_decode(deserializer);
return flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(inner);
}
}
impl SseDecode for RequestClient {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
@ -486,6 +598,14 @@ impl SseDecode for std::collections::HashMap<String, String> {
}
}
impl SseDecode for std::collections::HashMap<String, 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 inner = <Vec<(String, Vec<String>)>>::sse_decode(deserializer);
return inner.into_iter().collect();
}
}
impl SseDecode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<CancellationToken>>
{
@ -496,6 +616,16 @@ impl SseDecode
}
}
impl SseDecode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>>
{
// 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);
}
}
impl SseDecode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<RequestClient>>
{
@ -544,8 +674,8 @@ impl SseDecode for crate::api::rhttp::client::ClientCertificate {
impl SseDecode for crate::api::rhttp::client::ClientSettings {
// 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_timeout = <Option<chrono::Duration>>::sse_decode(deserializer);
let mut var_connectTimeout = <Option<chrono::Duration>>::sse_decode(deserializer);
let mut var_timeoutSettings =
<Option<crate::api::rhttp::client::TimeoutSettings>>::sse_decode(deserializer);
let mut var_throwOnStatusCode = <bool>::sse_decode(deserializer);
let mut var_proxySettings =
<Option<crate::api::rhttp::client::ProxySettings>>::sse_decode(deserializer);
@ -553,13 +683,27 @@ impl SseDecode for crate::api::rhttp::client::ClientSettings {
<Option<crate::api::rhttp::client::RedirectSettings>>::sse_decode(deserializer);
let mut var_tlsSettings =
<Option<crate::api::rhttp::client::TlsSettings>>::sse_decode(deserializer);
let mut var_dnsSettings = <Option<DnsSettings>>::sse_decode(deserializer);
return crate::api::rhttp::client::ClientSettings {
timeout: var_timeout,
connect_timeout: var_connectTimeout,
timeout_settings: var_timeoutSettings,
throw_on_status_code: var_throwOnStatusCode,
proxy_settings: var_proxySettings,
redirect_settings: var_redirectSettings,
tls_settings: var_tlsSettings,
dns_settings: var_dnsSettings,
};
}
}
impl SseDecode for crate::api::rhttp::client::CustomProxy {
// 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_url = <String>::sse_decode(deserializer);
let mut var_condition =
<crate::api::rhttp::client::ProxyCondition>::sse_decode(deserializer);
return crate::api::rhttp::client::CustomProxy {
url: var_url,
condition: var_condition,
};
}
}
@ -678,6 +822,32 @@ impl SseDecode for isize {
}
}
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_;
}
}
impl SseDecode for Vec<crate::api::rhttp::client::CustomProxy> {
// 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(<crate::api::rhttp::client::CustomProxy>::sse_decode(
deserializer,
));
}
return ans_;
}
}
impl SseDecode for Vec<Vec<u8>> {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
@ -702,6 +872,18 @@ impl SseDecode for Vec<u8> {
}
}
impl SseDecode for Vec<(String, 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, Vec<String>)>::sse_decode(deserializer));
}
return ans_;
}
}
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 {
@ -725,6 +907,28 @@ impl SseDecode for Option<RustAutoOpaqueMoi<RequestClient>> {
}
}
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;
}
}
}
impl SseDecode for Option<DnsSettings> {
// 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(<DnsSettings>::sse_decode(deserializer));
} else {
return None;
}
}
}
impl SseDecode for Option<chrono::Duration> {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
@ -801,6 +1005,19 @@ impl SseDecode for Option<crate::api::rhttp::client::RedirectSettings> {
}
}
impl SseDecode for Option<crate::api::rhttp::client::TimeoutSettings> {
// 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(<crate::api::rhttp::client::TimeoutSettings>::sse_decode(
deserializer,
));
} else {
return None;
}
}
}
impl SseDecode for Option<crate::api::rhttp::client::TlsSettings> {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
@ -849,17 +1066,48 @@ impl SseDecode for Option<Vec<(String, String)>> {
}
}
impl SseDecode for crate::api::rhttp::client::ProxySettings {
impl SseDecode for crate::api::rhttp::client::ProxyCondition {
// 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::rhttp::client::ProxySettings::NoProxy,
_ => unreachable!("Invalid variant for ProxySettings: {}", inner),
0 => crate::api::rhttp::client::ProxyCondition::Http,
1 => crate::api::rhttp::client::ProxyCondition::Https,
2 => crate::api::rhttp::client::ProxyCondition::All,
_ => unreachable!("Invalid variant for ProxyCondition: {}", inner),
};
}
}
impl SseDecode for crate::api::rhttp::client::ProxySettings {
// 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::api::rhttp::client::ProxySettings::NoProxy;
}
1 => {
let mut var_field0 =
<Vec<crate::api::rhttp::client::CustomProxy>>::sse_decode(deserializer);
return crate::api::rhttp::client::ProxySettings::CustomProxyList(var_field0);
}
_ => {
unimplemented!("");
}
}
}
}
impl SseDecode for (String, 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 var_field0 = <String>::sse_decode(deserializer);
let mut var_field1 = <Vec<String>>::sse_decode(deserializer);
return (var_field0, var_field1);
}
}
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 {
@ -932,6 +1180,35 @@ impl SseDecode for crate::api::rhttp::error::RhttpError {
}
}
impl SseDecode for crate::api::rhttp::client::StaticDnsSettings {
// 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_overrides =
<std::collections::HashMap<String, Vec<String>>>::sse_decode(deserializer);
let mut var_fallback = <Option<String>>::sse_decode(deserializer);
return crate::api::rhttp::client::StaticDnsSettings {
overrides: var_overrides,
fallback: var_fallback,
};
}
}
impl SseDecode for crate::api::rhttp::client::TimeoutSettings {
// 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_timeout = <Option<chrono::Duration>>::sse_decode(deserializer);
let mut var_connectTimeout = <Option<chrono::Duration>>::sse_decode(deserializer);
let mut var_keepAliveTimeout = <Option<chrono::Duration>>::sse_decode(deserializer);
let mut var_keepAlivePing = <Option<chrono::Duration>>::sse_decode(deserializer);
return crate::api::rhttp::client::TimeoutSettings {
timeout: var_timeout,
connect_timeout: var_connectTimeout,
keep_alive_timeout: var_keepAliveTimeout,
keep_alive_ping: var_keepAlivePing,
};
}
}
impl SseDecode for crate::api::rhttp::client::TlsSettings {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
@ -1002,26 +1279,26 @@ fn pde_ffi_dispatcher_primary_impl(
) {
// Codec=Pde (Serialization + dispatch), see doc to use other codecs
match func_id {
1 => wire__crate__api__rhttp__http__cancel_request_impl(port, ptr, rust_vec_len, data_len),
2 => wire__crate__api__rhttp__http__cancel_running_requests_impl(
2 => wire__crate__api__rhttp__http__cancel_request_impl(port, ptr, rust_vec_len, data_len),
3 => wire__crate__api__rhttp__http__cancel_running_requests_impl(
port,
ptr,
rust_vec_len,
data_len,
),
3 => wire__crate__api__rhttp__client__client_settings_default_impl(
4 => wire__crate__api__rhttp__client__client_settings_default_impl(
port,
ptr,
rust_vec_len,
data_len,
),
4 => wire__crate__api__rhttp__http__make_http_request_receive_stream_impl(
7 => wire__crate__api__rhttp__http__make_http_request_receive_stream_impl(
port,
ptr,
rust_vec_len,
data_len,
),
6 => wire__crate__api__rhttp__http__register_client_impl(port, ptr, rust_vec_len, data_len),
9 => wire__crate__api__rhttp__http__register_client_impl(port, ptr, rust_vec_len, data_len),
_ => unreachable!(),
}
}
@ -1034,8 +1311,18 @@ fn pde_ffi_dispatcher_sync_impl(
) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse {
// Codec=Pde (Serialization + dispatch), see doc to use other codecs
match func_id {
5 => wire__crate__api__image__process_crop_image_impl(ptr, rust_vec_len, data_len),
7 => wire__crate__api__rhttp__http__register_client_sync_impl(ptr, rust_vec_len, data_len),
5 => wire__crate__api__rhttp__client__create_dynamic_resolver_sync_impl(
ptr,
rust_vec_len,
data_len,
),
6 => wire__crate__api__rhttp__client__create_static_resolver_sync_impl(
ptr,
rust_vec_len,
data_len,
),
8 => wire__crate__api__image__process_crop_image_impl(ptr, rust_vec_len, data_len),
10 => wire__crate__api__rhttp__http__register_client_sync_impl(ptr, rust_vec_len, data_len),
_ => unreachable!(),
}
}
@ -1057,6 +1344,21 @@ impl flutter_rust_bridge::IntoIntoDart<FrbWrapper<CancellationToken>> for Cancel
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for FrbWrapper<DnsSettings> {
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 FrbWrapper<DnsSettings> {}
impl flutter_rust_bridge::IntoIntoDart<FrbWrapper<DnsSettings>> for DnsSettings {
fn into_into_dart(self) -> FrbWrapper<DnsSettings> {
self.into()
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for FrbWrapper<RequestClient> {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
@ -1097,12 +1399,12 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::client::ClientCertific
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::client::ClientSettings {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.timeout.into_into_dart().into_dart(),
self.connect_timeout.into_into_dart().into_dart(),
self.timeout_settings.into_into_dart().into_dart(),
self.throw_on_status_code.into_into_dart().into_dart(),
self.proxy_settings.into_into_dart().into_dart(),
self.redirect_settings.into_into_dart().into_dart(),
self.tls_settings.into_into_dart().into_dart(),
self.dns_settings.into_into_dart().into_dart(),
]
.into_dart()
}
@ -1119,6 +1421,27 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::client::ClientSettings
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::client::CustomProxy {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.url.into_into_dart().into_dart(),
self.condition.into_into_dart().into_dart(),
]
.into_dart()
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for crate::api::rhttp::client::CustomProxy
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::client::CustomProxy>
for crate::api::rhttp::client::CustomProxy
{
fn into_into_dart(self) -> crate::api::rhttp::client::CustomProxy {
self
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::http::HttpHeaders {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
match self {
@ -1248,11 +1571,38 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::http::HttpVersion>
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::client::ProxyCondition {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
match self {
Self::Http => 0.into_dart(),
Self::Https => 1.into_dart(),
Self::All => 2.into_dart(),
_ => unreachable!(),
}
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for crate::api::rhttp::client::ProxyCondition
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::client::ProxyCondition>
for crate::api::rhttp::client::ProxyCondition
{
fn into_into_dart(self) -> crate::api::rhttp::client::ProxyCondition {
self
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::client::ProxySettings {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
match self {
Self::NoProxy => 0.into_dart(),
_ => unreachable!(),
crate::api::rhttp::client::ProxySettings::NoProxy => [0.into_dart()].into_dart(),
crate::api::rhttp::client::ProxySettings::CustomProxyList(field0) => {
[1.into_dart(), field0.into_into_dart().into_dart()].into_dart()
}
_ => {
unimplemented!("");
}
}
}
}
@ -1333,6 +1683,50 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::error::RhttpError>
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::client::StaticDnsSettings {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.overrides.into_into_dart().into_dart(),
self.fallback.into_into_dart().into_dart(),
]
.into_dart()
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for crate::api::rhttp::client::StaticDnsSettings
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::client::StaticDnsSettings>
for crate::api::rhttp::client::StaticDnsSettings
{
fn into_into_dart(self) -> crate::api::rhttp::client::StaticDnsSettings {
self
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::client::TimeoutSettings {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.timeout.into_into_dart().into_dart(),
self.connect_timeout.into_into_dart().into_dart(),
self.keep_alive_timeout.into_into_dart().into_dart(),
self.keep_alive_ping.into_into_dart().into_dart(),
]
.into_dart()
}
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
for crate::api::rhttp::client::TimeoutSettings
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::rhttp::client::TimeoutSettings>
for crate::api::rhttp::client::TimeoutSettings
{
fn into_into_dart(self) -> crate::api::rhttp::client::TimeoutSettings {
self
}
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::rhttp::client::TlsSettings {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
@ -1400,6 +1794,13 @@ impl SseEncode for CancellationToken {
}
}
impl SseEncode for DnsSettings {
// 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::RustAutoOpaqueInner<DnsSettings>>>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, MoiArc<_>>(self), serializer);
}
}
impl SseEncode for RequestClient {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
@ -1432,6 +1833,13 @@ impl SseEncode for std::collections::HashMap<String, String> {
}
}
impl SseEncode for std::collections::HashMap<String, Vec<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, Vec<String>)>>::sse_encode(self.into_iter().collect(), serializer);
}
}
impl SseEncode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<CancellationToken>>
{
@ -1443,6 +1851,17 @@ impl SseEncode
}
}
impl SseEncode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>>
{
// 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);
}
}
impl SseEncode
for RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<RequestClient>>
{
@ -1486,8 +1905,10 @@ impl SseEncode for crate::api::rhttp::client::ClientCertificate {
impl SseEncode for crate::api::rhttp::client::ClientSettings {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<Option<chrono::Duration>>::sse_encode(self.timeout, serializer);
<Option<chrono::Duration>>::sse_encode(self.connect_timeout, serializer);
<Option<crate::api::rhttp::client::TimeoutSettings>>::sse_encode(
self.timeout_settings,
serializer,
);
<bool>::sse_encode(self.throw_on_status_code, serializer);
<Option<crate::api::rhttp::client::ProxySettings>>::sse_encode(
self.proxy_settings,
@ -1498,6 +1919,15 @@ impl SseEncode for crate::api::rhttp::client::ClientSettings {
serializer,
);
<Option<crate::api::rhttp::client::TlsSettings>>::sse_encode(self.tls_settings, serializer);
<Option<DnsSettings>>::sse_encode(self.dns_settings, serializer);
}
}
impl SseEncode for crate::api::rhttp::client::CustomProxy {
// 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.url, serializer);
<crate::api::rhttp::client::ProxyCondition>::sse_encode(self.condition, serializer);
}
}
@ -1617,6 +2047,26 @@ impl SseEncode for isize {
}
}
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);
}
}
}
impl SseEncode for Vec<crate::api::rhttp::client::CustomProxy> {
// 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 {
<crate::api::rhttp::client::CustomProxy>::sse_encode(item, serializer);
}
}
}
impl SseEncode for Vec<Vec<u8>> {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
@ -1637,6 +2087,16 @@ impl SseEncode for Vec<u8> {
}
}
impl SseEncode for Vec<(String, 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, Vec<String>)>::sse_encode(item, serializer);
}
}
}
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) {
@ -1657,6 +2117,26 @@ impl SseEncode for Option<RustAutoOpaqueMoi<RequestClient>> {
}
}
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);
}
}
}
impl SseEncode for Option<DnsSettings> {
// 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 {
<DnsSettings>::sse_encode(value, serializer);
}
}
}
impl SseEncode for Option<chrono::Duration> {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
@ -1717,6 +2197,16 @@ impl SseEncode for Option<crate::api::rhttp::client::RedirectSettings> {
}
}
impl SseEncode for Option<crate::api::rhttp::client::TimeoutSettings> {
// 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 {
<crate::api::rhttp::client::TimeoutSettings>::sse_encode(value, serializer);
}
}
}
impl SseEncode for Option<crate::api::rhttp::client::TlsSettings> {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
@ -1757,12 +2247,14 @@ impl SseEncode for Option<Vec<(String, String)>> {
}
}
impl SseEncode for crate::api::rhttp::client::ProxySettings {
impl SseEncode for crate::api::rhttp::client::ProxyCondition {
// 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::rhttp::client::ProxySettings::NoProxy => 0,
crate::api::rhttp::client::ProxyCondition::Http => 0,
crate::api::rhttp::client::ProxyCondition::Https => 1,
crate::api::rhttp::client::ProxyCondition::All => 2,
_ => {
unimplemented!("");
}
@ -1772,6 +2264,32 @@ impl SseEncode for crate::api::rhttp::client::ProxySettings {
}
}
impl SseEncode for crate::api::rhttp::client::ProxySettings {
// 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::api::rhttp::client::ProxySettings::NoProxy => {
<i32>::sse_encode(0, serializer);
}
crate::api::rhttp::client::ProxySettings::CustomProxyList(field0) => {
<i32>::sse_encode(1, serializer);
<Vec<crate::api::rhttp::client::CustomProxy>>::sse_encode(field0, serializer);
}
_ => {
unimplemented!("");
}
}
}
}
impl SseEncode for (String, Vec<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);
<Vec<String>>::sse_encode(self.1, serializer);
}
}
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) {
@ -1836,6 +2354,24 @@ impl SseEncode for crate::api::rhttp::error::RhttpError {
}
}
impl SseEncode for crate::api::rhttp::client::StaticDnsSettings {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<std::collections::HashMap<String, Vec<String>>>::sse_encode(self.overrides, serializer);
<Option<String>>::sse_encode(self.fallback, serializer);
}
}
impl SseEncode for crate::api::rhttp::client::TimeoutSettings {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<Option<chrono::Duration>>::sse_encode(self.timeout, serializer);
<Option<chrono::Duration>>::sse_encode(self.connect_timeout, serializer);
<Option<chrono::Duration>>::sse_encode(self.keep_alive_timeout, serializer);
<Option<chrono::Duration>>::sse_encode(self.keep_alive_ping, serializer);
}
}
impl SseEncode for crate::api::rhttp::client::TlsSettings {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
@ -1936,6 +2472,20 @@ mod io {
MoiArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<CancellationToken>>::decrement_strong_count(ptr as _);
}
#[no_mangle]
pub extern "C" fn frbgen_mangayomi_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr: *const std::ffi::c_void,
) {
MoiArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>>::increment_strong_count(ptr as _);
}
#[no_mangle]
pub extern "C" fn frbgen_mangayomi_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr: *const std::ffi::c_void,
) {
MoiArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>>::decrement_strong_count(ptr as _);
}
#[no_mangle]
pub extern "C" fn frbgen_mangayomi_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
ptr: *const std::ffi::c_void,
@ -1990,6 +2540,20 @@ mod web {
MoiArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<CancellationToken>>::decrement_strong_count(ptr as _);
}
#[wasm_bindgen]
pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr: *const std::ffi::c_void,
) {
MoiArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>>::increment_strong_count(ptr as _);
}
#[wasm_bindgen]
pub fn rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDnsSettings(
ptr: *const std::ffi::c_void,
) {
MoiArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<DnsSettings>>::decrement_strong_count(ptr as _);
}
#[wasm_bindgen]
pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRequestClient(
ptr: *const std::ffi::c_void,