// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.9.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/simple.dart';
import 'dart:async';
import 'dart:convert';
import 'frb_generated.dart';
import 'frb_generated.io.dart'
    if (dart.library.js_interop) 'frb_generated.web.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

/// Main entrypoint of the Rust API
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
  @internal
  static final instance = RustLib._();

  RustLib._();

  /// Initialize flutter_rust_bridge
  static Future<void> init({
    RustLibApi? api,
    BaseHandler? handler,
    ExternalLibrary? externalLibrary,
  }) async {
    await instance.initImpl(
      api: api,
      handler: handler,
      externalLibrary: externalLibrary,
    );
  }

  /// Initialize flutter_rust_bridge in mock mode.
  /// No libraries for FFI are loaded.
  static void initMock({
    required RustLibApi api,
  }) {
    instance.initMockImpl(
      api: api,
    );
  }

  /// Dispose flutter_rust_bridge
  ///
  /// The call to this function is optional, since flutter_rust_bridge (and everything else)
  /// is automatically disposed when the app stops.
  static void dispose() => instance.disposeImpl();

  @override
  ApiImplConstructor<RustLibApiImpl, RustLibWire> get apiImplConstructor =>
      RustLibApiImpl.new;

  @override
  WireConstructor<RustLibWire> get wireConstructor =>
      RustLibWire.fromExternalLibrary;

  @override
  Future<void> executeRustInitializers() async {}

  @override
  ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
      kDefaultExternalLibraryLoaderConfig;

  @override
  String get codegenVersion => '2.9.0';

  @override
  int get rustContentHash => 486890655;

  static const kDefaultExternalLibraryLoaderConfig =
      ExternalLibraryLoaderConfig(
    stem: 'rust_lib_fltier',
    ioDirectory: 'rust/target/release/',
    webPrefix: 'pkg/',
  );
}

abstract class RustLibApi extends BaseApi {
  Future<void> crateApiSimpleCloseAllServer();

  Future<void> crateApiSimpleCreateServer(
      {required String username,
      required bool enableDhcp,
      required String specifiedIp,
      required String roomName,
      required String roomPassword,
      required List<String> severurl,
      required FlagsC flag});

  Future<String> crateApiSimpleEasytierVersion();

  Future<KVNetworkStatus> crateApiSimpleGetNetworkStatus();

  Future<MyNodeInfo> crateApiSimpleGetNodeInfo();

  Future<List<PeerRoutePair>> crateApiSimpleGetPeerRoutePairs();

  Future<(List<PeerInfo>, List<Route>)> crateApiSimpleGetPeersAndRoutes();

  Future<String> crateApiSimpleGetRunningInfo();

  Future<void> crateApiSimpleInitApp();

  Future<bool> crateApiSimpleIsEasytierRunning();

  RustArcIncrementStrongCountFnType
      get rust_arc_increment_strong_count_MyNodeInfo;

  RustArcDecrementStrongCountFnType
      get rust_arc_decrement_strong_count_MyNodeInfo;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_MyNodeInfoPtr;

  RustArcIncrementStrongCountFnType
      get rust_arc_increment_strong_count_PeerInfo;

  RustArcDecrementStrongCountFnType
      get rust_arc_decrement_strong_count_PeerInfo;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_PeerInfoPtr;

  RustArcIncrementStrongCountFnType
      get rust_arc_increment_strong_count_PeerRoutePair;

  RustArcDecrementStrongCountFnType
      get rust_arc_decrement_strong_count_PeerRoutePair;

  CrossPlatformFinalizerArg
      get rust_arc_decrement_strong_count_PeerRoutePairPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Route;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Route;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RoutePtr;
}

class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
  RustLibApiImpl({
    required super.handler,
    required super.wire,
    required super.generalizedFrbRustBinding,
    required super.portManager,
  });

  @override
  Future<void> crateApiSimpleCloseAllServer() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 1, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_unit,
        decodeErrorData: null,
      ),
      constMeta: kCrateApiSimpleCloseAllServerConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleCloseAllServerConstMeta =>
      const TaskConstMeta(
        debugName: "close_all_server",
        argNames: [],
      );

  @override
  Future<void> crateApiSimpleCreateServer(
      {required String username,
      required bool enableDhcp,
      required String specifiedIp,
      required String roomName,
      required String roomPassword,
      required List<String> severurl,
      required FlagsC flag}) {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        sse_encode_String(username, serializer);
        sse_encode_bool(enableDhcp, serializer);
        sse_encode_String(specifiedIp, serializer);
        sse_encode_String(roomName, serializer);
        sse_encode_String(roomPassword, serializer);
        sse_encode_list_String(severurl, serializer);
        sse_encode_box_autoadd_flags_c(flag, serializer);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 2, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_unit,
        decodeErrorData: null,
      ),
      constMeta: kCrateApiSimpleCreateServerConstMeta,
      argValues: [
        username,
        enableDhcp,
        specifiedIp,
        roomName,
        roomPassword,
        severurl,
        flag
      ],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleCreateServerConstMeta => const TaskConstMeta(
        debugName: "create_server",
        argNames: [
          "username",
          "enableDhcp",
          "specifiedIp",
          "roomName",
          "roomPassword",
          "severurl",
          "flag"
        ],
      );

  @override
  Future<String> crateApiSimpleEasytierVersion() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 3, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_String,
        decodeErrorData: sse_decode_String,
      ),
      constMeta: kCrateApiSimpleEasytierVersionConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleEasytierVersionConstMeta =>
      const TaskConstMeta(
        debugName: "easytier_version",
        argNames: [],
      );

  @override
  Future<KVNetworkStatus> crateApiSimpleGetNetworkStatus() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 4, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_kv_network_status,
        decodeErrorData: null,
      ),
      constMeta: kCrateApiSimpleGetNetworkStatusConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleGetNetworkStatusConstMeta =>
      const TaskConstMeta(
        debugName: "get_network_status",
        argNames: [],
      );

  @override
  Future<MyNodeInfo> crateApiSimpleGetNodeInfo() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 5, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData:
            sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo,
        decodeErrorData: sse_decode_String,
      ),
      constMeta: kCrateApiSimpleGetNodeInfoConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleGetNodeInfoConstMeta => const TaskConstMeta(
        debugName: "get_node_info",
        argNames: [],
      );

  @override
  Future<List<PeerRoutePair>> crateApiSimpleGetPeerRoutePairs() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 6, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData:
            sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair,
        decodeErrorData: sse_decode_String,
      ),
      constMeta: kCrateApiSimpleGetPeerRoutePairsConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleGetPeerRoutePairsConstMeta =>
      const TaskConstMeta(
        debugName: "get_peer_route_pairs",
        argNames: [],
      );

  @override
  Future<(List<PeerInfo>, List<Route>)> crateApiSimpleGetPeersAndRoutes() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 7, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData:
            sse_decode_record_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_peer_info_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_route,
        decodeErrorData: sse_decode_String,
      ),
      constMeta: kCrateApiSimpleGetPeersAndRoutesConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleGetPeersAndRoutesConstMeta =>
      const TaskConstMeta(
        debugName: "get_peers_and_routes",
        argNames: [],
      );

  @override
  Future<String> crateApiSimpleGetRunningInfo() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 8, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_String,
        decodeErrorData: null,
      ),
      constMeta: kCrateApiSimpleGetRunningInfoConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleGetRunningInfoConstMeta =>
      const TaskConstMeta(
        debugName: "get_running_info",
        argNames: [],
      );

  @override
  Future<void> crateApiSimpleInitApp() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 9, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_unit,
        decodeErrorData: null,
      ),
      constMeta: kCrateApiSimpleInitAppConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleInitAppConstMeta => const TaskConstMeta(
        debugName: "init_app",
        argNames: [],
      );

  @override
  Future<bool> crateApiSimpleIsEasytierRunning() {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 10, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_bool,
        decodeErrorData: null,
      ),
      constMeta: kCrateApiSimpleIsEasytierRunningConstMeta,
      argValues: [],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiSimpleIsEasytierRunningConstMeta =>
      const TaskConstMeta(
        debugName: "is_easytier_running",
        argNames: [],
      );

  RustArcIncrementStrongCountFnType
      get rust_arc_increment_strong_count_MyNodeInfo => wire
          .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo;

  RustArcDecrementStrongCountFnType
      get rust_arc_decrement_strong_count_MyNodeInfo => wire
          .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo;

  RustArcIncrementStrongCountFnType
      get rust_arc_increment_strong_count_PeerInfo => wire
          .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo;

  RustArcDecrementStrongCountFnType
      get rust_arc_decrement_strong_count_PeerInfo => wire
          .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo;

  RustArcIncrementStrongCountFnType
      get rust_arc_increment_strong_count_PeerRoutePair => wire
          .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair;

  RustArcDecrementStrongCountFnType
      get rust_arc_decrement_strong_count_PeerRoutePair => wire
          .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Route =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Route =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute;

  @protected
  MyNodeInfo
      dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return MyNodeInfoImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  PeerInfo
      dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return PeerInfoImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  PeerRoutePair
      dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return PeerRoutePairImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  Route
      dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return RouteImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  MyNodeInfo
      dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return MyNodeInfoImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  PeerInfo
      dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return PeerInfoImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  PeerRoutePair
      dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return PeerRoutePairImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  Route
      dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return RouteImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

  @protected
  String dco_decode_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as String;
  }

  @protected
  bool dco_decode_bool(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as bool;
  }

  @protected
  FlagsC dco_decode_box_autoadd_flags_c(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_flags_c(raw);
  }

  @protected
  double dco_decode_f_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as double;
  }

  @protected
  double dco_decode_f_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as double;
  }

  @protected
  FlagsC dco_decode_flags_c(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 20)
      throw Exception('unexpected arr length: expect 20 but see ${arr.length}');
    return FlagsC(
      defaultProtocol: dco_decode_String(arr[0]),
      devName: dco_decode_String(arr[1]),
      enableEncryption: dco_decode_bool(arr[2]),
      enableIpv6: dco_decode_bool(arr[3]),
      mtu: dco_decode_u_32(arr[4]),
      latencyFirst: dco_decode_bool(arr[5]),
      enableExitNode: dco_decode_bool(arr[6]),
      noTun: dco_decode_bool(arr[7]),
      useSmoltcp: dco_decode_bool(arr[8]),
      relayNetworkWhitelist: dco_decode_String(arr[9]),
      disableP2P: dco_decode_bool(arr[10]),
      relayAllPeerRpc: dco_decode_bool(arr[11]),
      disableUdpHolePunching: dco_decode_bool(arr[12]),
      multiThread: dco_decode_bool(arr[13]),
      dataCompressAlgo: dco_decode_i_32(arr[14]),
      bindDevice: dco_decode_bool(arr[15]),
      enableKcpProxy: dco_decode_bool(arr[16]),
      disableKcpInput: dco_decode_bool(arr[17]),
      disableRelayKcp: dco_decode_bool(arr[18]),
      proxyForwardBySystem: dco_decode_bool(arr[19]),
    );
  }

  @protected
  int dco_decode_i_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  KVNetworkStatus dco_decode_kv_network_status(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 2)
      throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
    return KVNetworkStatus(
      totalNodes: dco_decode_usize(arr[0]),
      nodes: dco_decode_list_kv_node_info(arr[1]),
    );
  }

  @protected
  KVNodeConnectionStats dco_decode_kv_node_connection_stats(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 5)
      throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
    return KVNodeConnectionStats(
      connType: dco_decode_String(arr[0]),
      rxBytes: dco_decode_u_64(arr[1]),
      txBytes: dco_decode_u_64(arr[2]),
      rxPackets: dco_decode_u_64(arr[3]),
      txPackets: dco_decode_u_64(arr[4]),
    );
  }

  @protected
  KVNodeInfo dco_decode_kv_node_info(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 8)
      throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
    return KVNodeInfo(
      hostname: dco_decode_String(arr[0]),
      ipv4: dco_decode_String(arr[1]),
      latencyMs: dco_decode_f_64(arr[2]),
      nat: dco_decode_String(arr[3]),
      lossRate: dco_decode_f_32(arr[4]),
      connections: dco_decode_list_kv_node_connection_stats(arr[5]),
      version: dco_decode_String(arr[6]),
      cost: dco_decode_i_32(arr[7]),
    );
  }

  @protected
  List<PeerInfo>
      dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>)
        .map(
            dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo)
        .toList();
  }

  @protected
  List<PeerRoutePair>
      dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>)
        .map(
            dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair)
        .toList();
  }

  @protected
  List<Route>
      dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>)
        .map(
            dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute)
        .toList();
  }

  @protected
  List<String> dco_decode_list_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_String).toList();
  }

  @protected
  List<KVNodeConnectionStats> dco_decode_list_kv_node_connection_stats(
      dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>)
        .map(dco_decode_kv_node_connection_stats)
        .toList();
  }

  @protected
  List<KVNodeInfo> dco_decode_list_kv_node_info(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_kv_node_info).toList();
  }

  @protected
  Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as Uint8List;
  }

  @protected
  (
    List<PeerInfo>,
    List<Route>
  ) dco_decode_record_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_peer_info_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_route(
      dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 2) {
      throw Exception('Expected 2 elements, got ${arr.length}');
    }
    return (
      dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          arr[0]),
      dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          arr[1]),
    );
  }

  @protected
  int dco_decode_u_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  BigInt dco_decode_u_64(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dcoDecodeU64(raw);
  }

  @protected
  int dco_decode_u_8(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  void dco_decode_unit(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return;
  }

  @protected
  BigInt dco_decode_usize(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dcoDecodeU64(raw);
  }

  @protected
  MyNodeInfo
      sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return MyNodeInfoImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  PeerInfo
      sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return PeerInfoImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  PeerRoutePair
      sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return PeerRoutePairImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  Route
      sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return RouteImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  MyNodeInfo
      sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return MyNodeInfoImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  PeerInfo
      sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return PeerInfoImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  PeerRoutePair
      sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return PeerRoutePairImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  Route
      sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return RouteImpl.frbInternalSseDecode(
        sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

  @protected
  String sse_decode_String(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_list_prim_u_8_strict(deserializer);
    return utf8.decoder.convert(inner);
  }

  @protected
  bool sse_decode_bool(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getUint8() != 0;
  }

  @protected
  FlagsC sse_decode_box_autoadd_flags_c(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_flags_c(deserializer));
  }

  @protected
  double sse_decode_f_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getFloat32();
  }

  @protected
  double sse_decode_f_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getFloat64();
  }

  @protected
  FlagsC sse_decode_flags_c(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_defaultProtocol = sse_decode_String(deserializer);
    var var_devName = sse_decode_String(deserializer);
    var var_enableEncryption = sse_decode_bool(deserializer);
    var var_enableIpv6 = sse_decode_bool(deserializer);
    var var_mtu = sse_decode_u_32(deserializer);
    var var_latencyFirst = sse_decode_bool(deserializer);
    var var_enableExitNode = sse_decode_bool(deserializer);
    var var_noTun = sse_decode_bool(deserializer);
    var var_useSmoltcp = sse_decode_bool(deserializer);
    var var_relayNetworkWhitelist = sse_decode_String(deserializer);
    var var_disableP2P = sse_decode_bool(deserializer);
    var var_relayAllPeerRpc = sse_decode_bool(deserializer);
    var var_disableUdpHolePunching = sse_decode_bool(deserializer);
    var var_multiThread = sse_decode_bool(deserializer);
    var var_dataCompressAlgo = sse_decode_i_32(deserializer);
    var var_bindDevice = sse_decode_bool(deserializer);
    var var_enableKcpProxy = sse_decode_bool(deserializer);
    var var_disableKcpInput = sse_decode_bool(deserializer);
    var var_disableRelayKcp = sse_decode_bool(deserializer);
    var var_proxyForwardBySystem = sse_decode_bool(deserializer);
    return FlagsC(
        defaultProtocol: var_defaultProtocol,
        devName: var_devName,
        enableEncryption: var_enableEncryption,
        enableIpv6: var_enableIpv6,
        mtu: var_mtu,
        latencyFirst: var_latencyFirst,
        enableExitNode: var_enableExitNode,
        noTun: var_noTun,
        useSmoltcp: var_useSmoltcp,
        relayNetworkWhitelist: var_relayNetworkWhitelist,
        disableP2P: var_disableP2P,
        relayAllPeerRpc: var_relayAllPeerRpc,
        disableUdpHolePunching: var_disableUdpHolePunching,
        multiThread: var_multiThread,
        dataCompressAlgo: var_dataCompressAlgo,
        bindDevice: var_bindDevice,
        enableKcpProxy: var_enableKcpProxy,
        disableKcpInput: var_disableKcpInput,
        disableRelayKcp: var_disableRelayKcp,
        proxyForwardBySystem: var_proxyForwardBySystem);
  }

  @protected
  int sse_decode_i_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getInt32();
  }

  @protected
  KVNetworkStatus sse_decode_kv_network_status(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_totalNodes = sse_decode_usize(deserializer);
    var var_nodes = sse_decode_list_kv_node_info(deserializer);
    return KVNetworkStatus(totalNodes: var_totalNodes, nodes: var_nodes);
  }

  @protected
  KVNodeConnectionStats sse_decode_kv_node_connection_stats(
      SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_connType = sse_decode_String(deserializer);
    var var_rxBytes = sse_decode_u_64(deserializer);
    var var_txBytes = sse_decode_u_64(deserializer);
    var var_rxPackets = sse_decode_u_64(deserializer);
    var var_txPackets = sse_decode_u_64(deserializer);
    return KVNodeConnectionStats(
        connType: var_connType,
        rxBytes: var_rxBytes,
        txBytes: var_txBytes,
        rxPackets: var_rxPackets,
        txPackets: var_txPackets);
  }

  @protected
  KVNodeInfo sse_decode_kv_node_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_hostname = sse_decode_String(deserializer);
    var var_ipv4 = sse_decode_String(deserializer);
    var var_latencyMs = sse_decode_f_64(deserializer);
    var var_nat = sse_decode_String(deserializer);
    var var_lossRate = sse_decode_f_32(deserializer);
    var var_connections =
        sse_decode_list_kv_node_connection_stats(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_cost = sse_decode_i_32(deserializer);
    return KVNodeInfo(
        hostname: var_hostname,
        ipv4: var_ipv4,
        latencyMs: var_latencyMs,
        nat: var_nat,
        lossRate: var_lossRate,
        connections: var_connections,
        version: var_version,
        cost: var_cost);
  }

  @protected
  List<PeerInfo>
      sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <PeerInfo>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(
          sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
              deserializer));
    }
    return ans_;
  }

  @protected
  List<PeerRoutePair>
      sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <PeerRoutePair>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(
          sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
              deserializer));
    }
    return ans_;
  }

  @protected
  List<Route>
      sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <Route>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(
          sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
              deserializer));
    }
    return ans_;
  }

  @protected
  List<String> sse_decode_list_String(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <String>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_String(deserializer));
    }
    return ans_;
  }

  @protected
  List<KVNodeConnectionStats> sse_decode_list_kv_node_connection_stats(
      SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <KVNodeConnectionStats>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_kv_node_connection_stats(deserializer));
    }
    return ans_;
  }

  @protected
  List<KVNodeInfo> sse_decode_list_kv_node_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <KVNodeInfo>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_kv_node_info(deserializer));
    }
    return ans_;
  }

  @protected
  Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var len_ = sse_decode_i_32(deserializer);
    return deserializer.buffer.getUint8List(len_);
  }

  @protected
  (
    List<PeerInfo>,
    List<Route>
  ) sse_decode_record_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_peer_info_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_route(
      SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_field0 =
        sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
            deserializer);
    var var_field1 =
        sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
            deserializer);
    return (var_field0, var_field1);
  }

  @protected
  int sse_decode_u_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getUint32();
  }

  @protected
  BigInt sse_decode_u_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getBigUint64();
  }

  @protected
  int sse_decode_u_8(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getUint8();
  }

  @protected
  void sse_decode_unit(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
  }

  @protected
  BigInt sse_decode_usize(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getBigUint64();
  }

  @protected
  void
      sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo(
          MyNodeInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as MyNodeInfoImpl).frbInternalSseEncode(move: true), serializer);
  }

  @protected
  void
      sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          PeerInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as PeerInfoImpl).frbInternalSseEncode(move: true), serializer);
  }

  @protected
  void
      sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          PeerRoutePair self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as PeerRoutePairImpl).frbInternalSseEncode(move: true),
        serializer);
  }

  @protected
  void
      sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          Route self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as RouteImpl).frbInternalSseEncode(move: true), serializer);
  }

  @protected
  void
      sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerMyNodeInfo(
          MyNodeInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as MyNodeInfoImpl).frbInternalSseEncode(move: null), serializer);
  }

  @protected
  void
      sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          PeerInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as PeerInfoImpl).frbInternalSseEncode(move: null), serializer);
  }

  @protected
  void
      sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          PeerRoutePair self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as PeerRoutePairImpl).frbInternalSseEncode(move: null),
        serializer);
  }

  @protected
  void
      sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          Route self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
        (self as RouteImpl).frbInternalSseEncode(move: null), serializer);
  }

  @protected
  void sse_encode_String(String self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer);
  }

  @protected
  void sse_encode_bool(bool self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putUint8(self ? 1 : 0);
  }

  @protected
  void sse_encode_box_autoadd_flags_c(FlagsC self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_flags_c(self, serializer);
  }

  @protected
  void sse_encode_f_32(double self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putFloat32(self);
  }

  @protected
  void sse_encode_f_64(double self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putFloat64(self);
  }

  @protected
  void sse_encode_flags_c(FlagsC self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.defaultProtocol, serializer);
    sse_encode_String(self.devName, serializer);
    sse_encode_bool(self.enableEncryption, serializer);
    sse_encode_bool(self.enableIpv6, serializer);
    sse_encode_u_32(self.mtu, serializer);
    sse_encode_bool(self.latencyFirst, serializer);
    sse_encode_bool(self.enableExitNode, serializer);
    sse_encode_bool(self.noTun, serializer);
    sse_encode_bool(self.useSmoltcp, serializer);
    sse_encode_String(self.relayNetworkWhitelist, serializer);
    sse_encode_bool(self.disableP2P, serializer);
    sse_encode_bool(self.relayAllPeerRpc, serializer);
    sse_encode_bool(self.disableUdpHolePunching, serializer);
    sse_encode_bool(self.multiThread, serializer);
    sse_encode_i_32(self.dataCompressAlgo, serializer);
    sse_encode_bool(self.bindDevice, serializer);
    sse_encode_bool(self.enableKcpProxy, serializer);
    sse_encode_bool(self.disableKcpInput, serializer);
    sse_encode_bool(self.disableRelayKcp, serializer);
    sse_encode_bool(self.proxyForwardBySystem, serializer);
  }

  @protected
  void sse_encode_i_32(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putInt32(self);
  }

  @protected
  void sse_encode_kv_network_status(
      KVNetworkStatus self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(self.totalNodes, serializer);
    sse_encode_list_kv_node_info(self.nodes, serializer);
  }

  @protected
  void sse_encode_kv_node_connection_stats(
      KVNodeConnectionStats self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.connType, serializer);
    sse_encode_u_64(self.rxBytes, serializer);
    sse_encode_u_64(self.txBytes, serializer);
    sse_encode_u_64(self.rxPackets, serializer);
    sse_encode_u_64(self.txPackets, serializer);
  }

  @protected
  void sse_encode_kv_node_info(KVNodeInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.hostname, serializer);
    sse_encode_String(self.ipv4, serializer);
    sse_encode_f_64(self.latencyMs, serializer);
    sse_encode_String(self.nat, serializer);
    sse_encode_f_32(self.lossRate, serializer);
    sse_encode_list_kv_node_connection_stats(self.connections, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_i_32(self.cost, serializer);
  }

  @protected
  void
      sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          List<PeerInfo> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
          item, serializer);
    }
  }

  @protected
  void
      sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          List<PeerRoutePair> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerRoutePair(
          item, serializer);
    }
  }

  @protected
  void
      sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          List<Route> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
          item, serializer);
    }
  }

  @protected
  void sse_encode_list_String(List<String> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_String(item, serializer);
    }
  }

  @protected
  void sse_encode_list_kv_node_connection_stats(
      List<KVNodeConnectionStats> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_kv_node_connection_stats(item, serializer);
    }
  }

  @protected
  void sse_encode_list_kv_node_info(
      List<KVNodeInfo> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    for (final item in self) {
      sse_encode_kv_node_info(item, serializer);
    }
  }

  @protected
  void sse_encode_list_prim_u_8_strict(
      Uint8List self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    serializer.buffer.putUint8List(self);
  }

  @protected
  void
      sse_encode_record_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_peer_info_list_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_route(
          (List<PeerInfo>, List<Route>) self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerPeerInfo(
        self.$1, serializer);
    sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRoute(
        self.$2, serializer);
  }

  @protected
  void sse_encode_u_32(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putUint32(self);
  }

  @protected
  void sse_encode_u_64(BigInt self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putBigUint64(self);
  }

  @protected
  void sse_encode_u_8(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putUint8(self);
  }

  @protected
  void sse_encode_unit(void self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
  }

  @protected
  void sse_encode_usize(BigInt self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putBigUint64(self);
  }
}

@sealed
class MyNodeInfoImpl extends RustOpaque implements MyNodeInfo {
  // Not to be used by end users
  MyNodeInfoImpl.frbInternalDcoDecode(List<dynamic> wire)
      : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  MyNodeInfoImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
      : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_MyNodeInfo,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_MyNodeInfo,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_MyNodeInfoPtr,
  );
}

@sealed
class PeerInfoImpl extends RustOpaque implements PeerInfo {
  // Not to be used by end users
  PeerInfoImpl.frbInternalDcoDecode(List<dynamic> wire)
      : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  PeerInfoImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
      : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_PeerInfo,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_PeerInfo,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_PeerInfoPtr,
  );
}

@sealed
class PeerRoutePairImpl extends RustOpaque implements PeerRoutePair {
  // Not to be used by end users
  PeerRoutePairImpl.frbInternalDcoDecode(List<dynamic> wire)
      : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  PeerRoutePairImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
      : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_PeerRoutePair,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_PeerRoutePair,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_PeerRoutePairPtr,
  );
}

@sealed
class RouteImpl extends RustOpaque implements Route {
  // Not to be used by end users
  RouteImpl.frbInternalDcoDecode(List<dynamic> wire)
      : super.frbInternalDcoDecode(wire, _kStaticData);

  // Not to be used by end users
  RouteImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative)
      : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData);

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_Route,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_Route,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_RoutePtr,
  );
}
