app/lib/common/rust/api/http_api.dart

60 lines
1.8 KiB
Dart
Raw Normal View History

2024-02-07 00:20:06 +08:00
// This file is automatically generated, so please do not edit it.
2024-02-15 21:24:39 +08:00
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.24.
2024-02-07 00:20:06 +08:00
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../frb_generated.dart';
2024-02-07 19:32:36 +08:00
import '../http_package.dart';
2024-02-07 00:20:06 +08:00
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
2024-02-07 19:32:36 +08:00
Future<void> setDefaultHeader(
{required Map<String, String> headers, dynamic hint}) =>
RustLib.instance.api.setDefaultHeader(headers: headers, hint: hint);
2024-02-07 00:20:06 +08:00
2024-02-07 19:32:36 +08:00
Future<RustHttpResponse> fetch(
{required MyMethod method,
required String url,
2024-02-07 00:20:06 +08:00
Map<String, String>? headers,
2024-02-07 19:32:36 +08:00
Uint8List? inputData,
2024-02-07 00:20:06 +08:00
dynamic hint}) =>
2024-02-07 19:32:36 +08:00
RustLib.instance.api.fetch(
method: method,
url: url,
headers: headers,
inputData: inputData,
hint: hint);
2024-02-07 22:19:43 +08:00
Future<List<String>> dnsLookupTxt({required String host, dynamic hint}) =>
RustLib.instance.api.dnsLookupTxt(host: host, hint: hint);
2024-02-07 19:32:36 +08:00
// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::rust_async::RwLock<reqwest :: Version>>
@sealed
class ReqwestVersion extends RustOpaque {
ReqwestVersion.dcoDecode(List<dynamic> wire)
: super.dcoDecode(wire, _kStaticData);
ReqwestVersion.sseDecode(int ptr, int externalSizeOnNative)
: super.sseDecode(ptr, externalSizeOnNative, _kStaticData);
static final _kStaticData = RustArcStaticData(
rustArcIncrementStrongCount:
RustLib.instance.api.rust_arc_increment_strong_count_ReqwestVersion,
rustArcDecrementStrongCount:
RustLib.instance.api.rust_arc_decrement_strong_count_ReqwestVersion,
rustArcDecrementStrongCountPtr:
RustLib.instance.api.rust_arc_decrement_strong_count_ReqwestVersionPtr,
);
}
enum MyMethod {
options,
gets,
post,
put,
delete,
head,
trace,
connect,
patch,
}