// This file is automatically generated, so please do not edit it. // Generated by `flutter_rust_bridge`@ 2.3.0. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field import 'api/http_api.dart'; import 'dart:async'; import 'dart:convert'; import 'dart:ffi' as ffi; import 'frb_generated.dart'; import 'http_package.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart'; abstract class RustLibApiImplPlatform extends BaseApiImpl { RustLibApiImplPlatform({ required super.handler, required super.wire, required super.generalizedFrbRustBinding, required super.portManager, }); @protected AnyhowException dco_decode_AnyhowException(dynamic raw); @protected Map dco_decode_Map_String_String(dynamic raw); @protected String dco_decode_String(dynamic raw); @protected BigInt dco_decode_box_autoadd_u_64(dynamic raw); @protected int dco_decode_i_32(dynamic raw); @protected Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); @protected List<(String, String)> dco_decode_list_record_string_string(dynamic raw); @protected MyMethod dco_decode_my_method(dynamic raw); @protected Map? dco_decode_opt_Map_String_String(dynamic raw); @protected BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw); @protected Uint8List? dco_decode_opt_list_prim_u_8_strict(dynamic raw); @protected (String, String) dco_decode_record_string_string(dynamic raw); @protected RustHttpResponse dco_decode_rust_http_response(dynamic raw); @protected int dco_decode_u_16(dynamic raw); @protected BigInt dco_decode_u_64(dynamic raw); @protected int dco_decode_u_8(dynamic raw); @protected void dco_decode_unit(dynamic raw); @protected AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer); @protected Map sse_decode_Map_String_String( SseDeserializer deserializer); @protected String sse_decode_String(SseDeserializer deserializer); @protected BigInt sse_decode_box_autoadd_u_64(SseDeserializer deserializer); @protected int sse_decode_i_32(SseDeserializer deserializer); @protected Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); @protected List<(String, String)> sse_decode_list_record_string_string( SseDeserializer deserializer); @protected MyMethod sse_decode_my_method(SseDeserializer deserializer); @protected Map? sse_decode_opt_Map_String_String( SseDeserializer deserializer); @protected BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); @protected Uint8List? sse_decode_opt_list_prim_u_8_strict(SseDeserializer deserializer); @protected (String, String) sse_decode_record_string_string( SseDeserializer deserializer); @protected RustHttpResponse sse_decode_rust_http_response(SseDeserializer deserializer); @protected int sse_decode_u_16(SseDeserializer deserializer); @protected BigInt sse_decode_u_64(SseDeserializer deserializer); @protected int sse_decode_u_8(SseDeserializer deserializer); @protected void sse_decode_unit(SseDeserializer deserializer); @protected bool sse_decode_bool(SseDeserializer deserializer); @protected ffi.Pointer cst_encode_AnyhowException( AnyhowException raw) { // Codec=Cst (C-struct based), see doc to use other codecs throw UnimplementedError(); } @protected ffi.Pointer cst_encode_Map_String_String( Map raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_list_record_string_string( raw.entries.map((e) => (e.key, e.value)).toList()); } @protected ffi.Pointer cst_encode_String(String raw) { // Codec=Cst (C-struct based), see doc to use other codecs return cst_encode_list_prim_u_8_strict(utf8.encoder.convert(raw)); } @protected ffi.Pointer cst_encode_box_autoadd_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs return wire.cst_new_box_autoadd_u_64(cst_encode_u_64(raw)); } @protected ffi.Pointer cst_encode_list_prim_u_8_strict( Uint8List raw) { // Codec=Cst (C-struct based), see doc to use other codecs final ans = wire.cst_new_list_prim_u_8_strict(raw.length); ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); return ans; } @protected ffi.Pointer cst_encode_list_record_string_string(List<(String, String)> raw) { // Codec=Cst (C-struct based), see doc to use other codecs final ans = wire.cst_new_list_record_string_string(raw.length); for (var i = 0; i < raw.length; ++i) { cst_api_fill_to_wire_record_string_string(raw[i], ans.ref.ptr[i]); } return ans; } @protected ffi.Pointer cst_encode_opt_Map_String_String(Map? raw) { // Codec=Cst (C-struct based), see doc to use other codecs return raw == null ? ffi.nullptr : cst_encode_Map_String_String(raw); } @protected ffi.Pointer cst_encode_opt_box_autoadd_u_64(BigInt? raw) { // Codec=Cst (C-struct based), see doc to use other codecs return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_64(raw); } @protected ffi.Pointer cst_encode_opt_list_prim_u_8_strict(Uint8List? raw) { // Codec=Cst (C-struct based), see doc to use other codecs return raw == null ? ffi.nullptr : cst_encode_list_prim_u_8_strict(raw); } @protected int cst_encode_u_64(BigInt raw) { // Codec=Cst (C-struct based), see doc to use other codecs return raw.toSigned(64).toInt(); } @protected void cst_api_fill_to_wire_record_string_string( (String, String) apiObj, wire_cst_record_string_string wireObj) { wireObj.field0 = cst_encode_String(apiObj.$1); wireObj.field1 = cst_encode_String(apiObj.$2); } @protected void cst_api_fill_to_wire_rust_http_response( RustHttpResponse apiObj, wire_cst_rust_http_response wireObj) { wireObj.status_code = cst_encode_u_16(apiObj.statusCode); wireObj.headers = cst_encode_Map_String_String(apiObj.headers); wireObj.url = cst_encode_String(apiObj.url); wireObj.content_length = cst_encode_opt_box_autoadd_u_64(apiObj.contentLength); wireObj.data = cst_encode_opt_list_prim_u_8_strict(apiObj.data); } @protected int cst_encode_i_32(int raw); @protected int cst_encode_my_method(MyMethod raw); @protected int cst_encode_u_16(int raw); @protected int cst_encode_u_8(int raw); @protected void cst_encode_unit(void raw); @protected void sse_encode_AnyhowException( AnyhowException self, SseSerializer serializer); @protected void sse_encode_Map_String_String( Map self, SseSerializer serializer); @protected void sse_encode_String(String self, SseSerializer serializer); @protected void sse_encode_box_autoadd_u_64(BigInt self, SseSerializer serializer); @protected void sse_encode_i_32(int self, SseSerializer serializer); @protected void sse_encode_list_prim_u_8_strict( Uint8List self, SseSerializer serializer); @protected void sse_encode_list_record_string_string( List<(String, String)> self, SseSerializer serializer); @protected void sse_encode_my_method(MyMethod self, SseSerializer serializer); @protected void sse_encode_opt_Map_String_String( Map? self, SseSerializer serializer); @protected void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer); @protected void sse_encode_opt_list_prim_u_8_strict( Uint8List? self, SseSerializer serializer); @protected void sse_encode_record_string_string( (String, String) self, SseSerializer serializer); @protected void sse_encode_rust_http_response( RustHttpResponse self, SseSerializer serializer); @protected void sse_encode_u_16(int self, SseSerializer serializer); @protected void sse_encode_u_64(BigInt self, SseSerializer serializer); @protected void sse_encode_u_8(int self, SseSerializer serializer); @protected void sse_encode_unit(void self, SseSerializer serializer); @protected void sse_encode_bool(bool self, SseSerializer serializer); } // Section: wire_class // ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. // ignore_for_file: type=lint /// generated by flutter_rust_bridge class RustLibWire implements BaseWire { factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) => RustLibWire(lib.ffiDynamicLibrary); /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) _lookup; /// The symbols are looked up in [dynamicLibrary]. RustLibWire(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; /// The symbols are looked up with [lookup]. RustLibWire.fromLookup( ffi.Pointer Function(String symbolName) lookup) : _lookup = lookup; void store_dart_post_cobject( DartPostCObjectFnType ptr, ) { return _store_dart_post_cobject( ptr, ); } late final _store_dart_post_cobjectPtr = _lookup>( 'store_dart_post_cobject'); late final _store_dart_post_cobject = _store_dart_post_cobjectPtr .asFunction(); void wire__crate__api__http_api__fetch( int port_, int method, ffi.Pointer url, ffi.Pointer headers, ffi.Pointer input_data, ) { return _wire__crate__api__http_api__fetch( port_, method, url, headers, input_data, ); } late final _wire__crate__api__http_api__fetchPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, ffi.Int32, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( 'frbgen_starcitizen_doctor_wire__crate__api__http_api__fetch'); late final _wire__crate__api__http_api__fetch = _wire__crate__api__http_api__fetchPtr.asFunction< void Function( int, int, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void wire__crate__api__http_api__set_default_header( int port_, ffi.Pointer headers, ) { return _wire__crate__api__http_api__set_default_header( port_, headers, ); } late final _wire__crate__api__http_api__set_default_headerPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Int64, ffi.Pointer)>>( 'frbgen_starcitizen_doctor_wire__crate__api__http_api__set_default_header'); late final _wire__crate__api__http_api__set_default_header = _wire__crate__api__http_api__set_default_headerPtr.asFunction< void Function( int, ffi.Pointer)>(); ffi.Pointer cst_new_box_autoadd_u_64( int value, ) { return _cst_new_box_autoadd_u_64( value, ); } late final _cst_new_box_autoadd_u_64Ptr = _lookup Function(ffi.Uint64)>>( 'frbgen_starcitizen_doctor_cst_new_box_autoadd_u_64'); late final _cst_new_box_autoadd_u_64 = _cst_new_box_autoadd_u_64Ptr .asFunction Function(int)>(); ffi.Pointer cst_new_list_prim_u_8_strict( int len, ) { return _cst_new_list_prim_u_8_strict( len, ); } late final _cst_new_list_prim_u_8_strictPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Int32)>>( 'frbgen_starcitizen_doctor_cst_new_list_prim_u_8_strict'); late final _cst_new_list_prim_u_8_strict = _cst_new_list_prim_u_8_strictPtr .asFunction Function(int)>(); ffi.Pointer cst_new_list_record_string_string( int len, ) { return _cst_new_list_record_string_string( len, ); } late final _cst_new_list_record_string_stringPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( ffi.Int32)>>( 'frbgen_starcitizen_doctor_cst_new_list_record_string_string'); late final _cst_new_list_record_string_string = _cst_new_list_record_string_stringPtr.asFunction< ffi.Pointer Function(int)>(); int dummy_method_to_enforce_bundling() { return _dummy_method_to_enforce_bundling(); } late final _dummy_method_to_enforce_bundlingPtr = _lookup>( 'dummy_method_to_enforce_bundling'); late final _dummy_method_to_enforce_bundling = _dummy_method_to_enforce_bundlingPtr.asFunction(); } typedef DartPostCObjectFnType = ffi.Pointer>; typedef DartPostCObjectFnTypeFunction = ffi.Bool Function( DartPort port_id, ffi.Pointer message); typedef DartDartPostCObjectFnTypeFunction = bool Function( DartDartPort port_id, ffi.Pointer message); typedef DartPort = ffi.Int64; typedef DartDartPort = int; final class wire_cst_list_prim_u_8_strict extends ffi.Struct { external ffi.Pointer ptr; @ffi.Int32() external int len; } final class wire_cst_record_string_string extends ffi.Struct { external ffi.Pointer field0; external ffi.Pointer field1; } final class wire_cst_list_record_string_string extends ffi.Struct { external ffi.Pointer ptr; @ffi.Int32() external int len; } final class wire_cst_rust_http_response extends ffi.Struct { @ffi.Uint16() external int status_code; external ffi.Pointer headers; external ffi.Pointer url; external ffi.Pointer content_length; external ffi.Pointer data; }