// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.10.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/astral_wfp.dart';
import 'api/firewall.dart';
import 'api/hops.dart';
import 'api/nt.dart';
import 'api/simple.dart';
import 'api/utils.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 'lib.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.10.0';

  @override
  int get rustContentHash => 294099415;

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

abstract class RustLibApi extends BaseApi {
  FilterAction crateApiAstralWfpFilterRuleAutoAccessorGetAction({
    required FilterRule that,
  });

  String? crateApiAstralWfpFilterRuleAutoAccessorGetAppPath({
    required FilterRule that,
  });

  Direction crateApiAstralWfpFilterRuleAutoAccessorGetDirection({
    required FilterRule that,
  });

  Uint64List crateApiAstralWfpFilterRuleAutoAccessorGetFilterIds({
    required FilterRule that,
  });

  String? crateApiAstralWfpFilterRuleAutoAccessorGetLocal({
    required FilterRule that,
  });

  int? crateApiAstralWfpFilterRuleAutoAccessorGetLocalPort({
    required FilterRule that,
  });

  (int, int)? crateApiAstralWfpFilterRuleAutoAccessorGetLocalPortRange({
    required FilterRule that,
  });

  String crateApiAstralWfpFilterRuleAutoAccessorGetName({
    required FilterRule that,
  });

  int crateApiAstralWfpFilterRuleAutoAccessorGetPriority({
    required FilterRule that,
  });

  Protocol? crateApiAstralWfpFilterRuleAutoAccessorGetProtocol({
    required FilterRule that,
  });

  String? crateApiAstralWfpFilterRuleAutoAccessorGetRemote({
    required FilterRule that,
  });

  int? crateApiAstralWfpFilterRuleAutoAccessorGetRemotePort({
    required FilterRule that,
  });

  (int, int)? crateApiAstralWfpFilterRuleAutoAccessorGetRemotePortRange({
    required FilterRule that,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetAction({
    required FilterRule that,
    required FilterAction action,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetAppPath({
    required FilterRule that,
    String? appPath,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetDirection({
    required FilterRule that,
    required Direction direction,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetFilterIds({
    required FilterRule that,
    required Uint64List filterIds,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetLocal({
    required FilterRule that,
    String? local,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetLocalPort({
    required FilterRule that,
    int? localPort,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetLocalPortRange({
    required FilterRule that,
    (int, int)? localPortRange,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetName({
    required FilterRule that,
    required String name,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetPriority({
    required FilterRule that,
    required int priority,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetProtocol({
    required FilterRule that,
    Protocol? protocol,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetRemote({
    required FilterRule that,
    String? remote,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetRemotePort({
    required FilterRule that,
    int? remotePort,
  });

  void crateApiAstralWfpFilterRuleAutoAccessorSetRemotePortRange({
    required FilterRule that,
    (int, int)? remotePortRange,
  });

  Future<FilterRule> crateApiAstralWfpFilterRuleNewWithParams({
    required String name,
    String? appPath,
    String? local,
    String? remote,
    int? localPort,
    int? remotePort,
    (int, int)? localPortRange,
    (int, int)? remotePortRange,
    Protocol? protocol,
    required Direction direction,
    required FilterAction action,
    int? priority,
    String? description,
  });

  Future<void> crateApiAstralWfpFilterRuleValidate({required FilterRule that});

  IpAddr crateApiAstralWfpIpNetworkAutoAccessorGetIp({required IpNetwork that});

  int crateApiAstralWfpIpNetworkAutoAccessorGetPrefixLen({
    required IpNetwork that,
  });

  void crateApiAstralWfpIpNetworkAutoAccessorSetIp({
    required IpNetwork that,
    required IpAddr ip,
  });

  void crateApiAstralWfpIpNetworkAutoAccessorSetPrefixLen({
    required IpNetwork that,
    required int prefixLen,
  });

  Future<IpNetwork> crateApiAstralWfpIpNetworkFromCidr({required String cidr});

  Future<Uint64List> crateApiAstralWfpWfpControllerAddFilters({
    required WfpController that,
    required List<FilterRule> rules,
  });

  Uint64List crateApiAstralWfpWfpControllerAutoAccessorGetFilterIds({
    required WfpController that,
  });

  void crateApiAstralWfpWfpControllerAutoAccessorSetFilterIds({
    required WfpController that,
    required Uint64List filterIds,
  });

  Future<void> crateApiAstralWfpWfpControllerCleanup({
    required WfpController that,
  });

  Future<int> crateApiAstralWfpWfpControllerDeleteFilters({
    required WfpController that,
    required Uint64List filterIds,
  });

  Future<void> crateApiAstralWfpWfpControllerGetLayerName({
    required WfpController that,
    required Guid layerKey,
  });

  Future<void> crateApiAstralWfpWfpControllerInitialize({
    required WfpController that,
  });

  Future<WfpController> crateApiAstralWfpWfpControllerNew();

  Future<bool> crateApiUtilsCheckSudo();

  Future<void> crateApiSimpleCloseServer();

  Future<JoinHandleResultString> crateApiSimpleCreateServer({
    required String username,
    required bool enableDhcp,
    required String specifiedIp,
    required String roomName,
    required String roomPassword,
    required List<String> severurl,
    required List<String> onurl,
    required List<String> cidrs,
    required List<Forward> forwards,
    required FlagsC flag,
  });

  Future<String> crateApiSimpleEasytierVersion();

  Future<List<(String, int)>> crateApiHopsGetAllInterfacesMetrics();

  Future<bool> crateApiFirewallGetFirewallStatus({required int profileIndex});

  Future<List<String>> crateApiSimpleGetIps();

  Future<KVNetworkStatus> crateApiSimpleGetNetworkStatus();

  Future<String?> crateApiNtGetNtPath({required String dosPath});

  Future<List<PeerRoutePair>> crateApiSimpleGetPeerRoutePairs();

  Future<String> crateApiSimpleGetRunningInfo();

  Future<JoinHandle> crateApiSimpleHandleEvent({
    required EventBusSubscriber events,
  });

  Future<void> crateApiSimpleInitApp();

  Future<bool> crateApiSimpleIsEasytierRunning();

  Future<void> crateApiSimpleSendUdpToLocalhost({required String message});

  Future<void> crateApiFirewallSetFirewallStatus({
    required int profileIndex,
    required bool enable,
  });

  Future<void> crateApiHopsSetInterfaceMetric({
    required String interfaceName,
    required int metric,
  });

  Future<void> crateApiSimpleSetTunFd({required int fd});

  Future<Uint16List> crateApiAstralWfpToWideString({required String s});

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_EventBusSubscriber;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_EventBusSubscriber;

  CrossPlatformFinalizerArg
  get rust_arc_decrement_strong_count_EventBusSubscriberPtr;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_FilterRule;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_FilterRule;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_FilterRulePtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Guid;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Guid;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_GuidPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_IpAddr;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_IpAddr;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_IpAddrPtr;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_IpNetwork;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_IpNetwork;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_IpNetworkPtr;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_JoinHandle;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_JoinHandle;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_JoinHandlePtr;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_JoinHandleResultString;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_JoinHandleResultString;

  CrossPlatformFinalizerArg
  get rust_arc_decrement_strong_count_JoinHandleResultStringPtr;

  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_WfpController;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_WfpController;

  CrossPlatformFinalizerArg
  get rust_arc_decrement_strong_count_WfpControllerPtr;
}

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

  @override
  FilterAction crateApiAstralWfpFilterRuleAutoAccessorGetAction({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_filter_action,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorGetActionConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetActionConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_action",
        argNames: ["that"],
      );

  @override
  String? crateApiAstralWfpFilterRuleAutoAccessorGetAppPath({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 2)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorGetAppPathConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetAppPathConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_app_path",
        argNames: ["that"],
      );

  @override
  Direction crateApiAstralWfpFilterRuleAutoAccessorGetDirection({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 3)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_direction,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorGetDirectionConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetDirectionConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_direction",
        argNames: ["that"],
      );

  @override
  Uint64List crateApiAstralWfpFilterRuleAutoAccessorGetFilterIds({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 4)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_prim_u_64_strict,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorGetFilterIdsConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetFilterIdsConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_filter_ids",
        argNames: ["that"],
      );

  @override
  String? crateApiAstralWfpFilterRuleAutoAccessorGetLocal({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 5)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorGetLocalConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpFilterRuleAutoAccessorGetLocalConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_local",
        argNames: ["that"],
      );

  @override
  int? crateApiAstralWfpFilterRuleAutoAccessorGetLocalPort({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 6)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_u_16,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorGetLocalPortConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetLocalPortConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_local_port",
        argNames: ["that"],
      );

  @override
  (int, int)? crateApiAstralWfpFilterRuleAutoAccessorGetLocalPortRange({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 7)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_record_u_16_u_16,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorGetLocalPortRangeConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetLocalPortRangeConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_local_port_range",
        argNames: ["that"],
      );

  @override
  String crateApiAstralWfpFilterRuleAutoAccessorGetName({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 8)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorGetNameConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpFilterRuleAutoAccessorGetNameConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_name",
        argNames: ["that"],
      );

  @override
  int crateApiAstralWfpFilterRuleAutoAccessorGetPriority({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 9)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_u_32,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorGetPriorityConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetPriorityConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_priority",
        argNames: ["that"],
      );

  @override
  Protocol? crateApiAstralWfpFilterRuleAutoAccessorGetProtocol({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 10)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_protocol,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorGetProtocolConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetProtocolConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_protocol",
        argNames: ["that"],
      );

  @override
  String? crateApiAstralWfpFilterRuleAutoAccessorGetRemote({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 11)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorGetRemoteConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetRemoteConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_remote",
        argNames: ["that"],
      );

  @override
  int? crateApiAstralWfpFilterRuleAutoAccessorGetRemotePort({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 12)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_u_16,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorGetRemotePortConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetRemotePortConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_remote_port",
        argNames: ["that"],
      );

  @override
  (int, int)? crateApiAstralWfpFilterRuleAutoAccessorGetRemotePortRange({
    required FilterRule that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 13)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_box_autoadd_record_u_16_u_16,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorGetRemotePortRangeConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorGetRemotePortRangeConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_get_remote_port_range",
        argNames: ["that"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetAction({
    required FilterRule that,
    required FilterAction action,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_filter_action(action, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 14)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorSetActionConstMeta,
        argValues: [that, action],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetActionConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_action",
        argNames: ["that", "action"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetAppPath({
    required FilterRule that,
    String? appPath,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_String(appPath, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 15)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorSetAppPathConstMeta,
        argValues: [that, appPath],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetAppPathConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_app_path",
        argNames: ["that", "appPath"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetDirection({
    required FilterRule that,
    required Direction direction,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_direction(direction, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 16)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorSetDirectionConstMeta,
        argValues: [that, direction],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetDirectionConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_direction",
        argNames: ["that", "direction"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetFilterIds({
    required FilterRule that,
    required Uint64List filterIds,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_list_prim_u_64_strict(filterIds, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 17)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorSetFilterIdsConstMeta,
        argValues: [that, filterIds],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetFilterIdsConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_filter_ids",
        argNames: ["that", "filterIds"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetLocal({
    required FilterRule that,
    String? local,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_String(local, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 18)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorSetLocalConstMeta,
        argValues: [that, local],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpFilterRuleAutoAccessorSetLocalConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_local",
        argNames: ["that", "local"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetLocalPort({
    required FilterRule that,
    int? localPort,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_box_autoadd_u_16(localPort, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 19)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorSetLocalPortConstMeta,
        argValues: [that, localPort],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetLocalPortConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_local_port",
        argNames: ["that", "localPort"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetLocalPortRange({
    required FilterRule that,
    (int, int)? localPortRange,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_box_autoadd_record_u_16_u_16(
            localPortRange,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 20)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorSetLocalPortRangeConstMeta,
        argValues: [that, localPortRange],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetLocalPortRangeConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_local_port_range",
        argNames: ["that", "localPortRange"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetName({
    required FilterRule that,
    required String name,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_String(name, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 21)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorSetNameConstMeta,
        argValues: [that, name],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpFilterRuleAutoAccessorSetNameConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_name",
        argNames: ["that", "name"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetPriority({
    required FilterRule that,
    required int priority,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_u_32(priority, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 22)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorSetPriorityConstMeta,
        argValues: [that, priority],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetPriorityConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_priority",
        argNames: ["that", "priority"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetProtocol({
    required FilterRule that,
    Protocol? protocol,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_box_autoadd_protocol(protocol, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 23)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorSetProtocolConstMeta,
        argValues: [that, protocol],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetProtocolConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_protocol",
        argNames: ["that", "protocol"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetRemote({
    required FilterRule that,
    String? remote,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_String(remote, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 24)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleAutoAccessorSetRemoteConstMeta,
        argValues: [that, remote],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetRemoteConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_remote",
        argNames: ["that", "remote"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetRemotePort({
    required FilterRule that,
    int? remotePort,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_box_autoadd_u_16(remotePort, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 25)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorSetRemotePortConstMeta,
        argValues: [that, remotePort],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetRemotePortConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_remote_port",
        argNames: ["that", "remotePort"],
      );

  @override
  void crateApiAstralWfpFilterRuleAutoAccessorSetRemotePortRange({
    required FilterRule that,
    (int, int)? remotePortRange,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          sse_encode_opt_box_autoadd_record_u_16_u_16(
            remotePortRange,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 26)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpFilterRuleAutoAccessorSetRemotePortRangeConstMeta,
        argValues: [that, remotePortRange],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpFilterRuleAutoAccessorSetRemotePortRangeConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_auto_accessor_set_remote_port_range",
        argNames: ["that", "remotePortRange"],
      );

  @override
  Future<FilterRule> crateApiAstralWfpFilterRuleNewWithParams({
    required String name,
    String? appPath,
    String? local,
    String? remote,
    int? localPort,
    int? remotePort,
    (int, int)? localPortRange,
    (int, int)? remotePortRange,
    Protocol? protocol,
    required Direction direction,
    required FilterAction action,
    int? priority,
    String? description,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(name, serializer);
          sse_encode_opt_String(appPath, serializer);
          sse_encode_opt_String(local, serializer);
          sse_encode_opt_String(remote, serializer);
          sse_encode_opt_box_autoadd_u_16(localPort, serializer);
          sse_encode_opt_box_autoadd_u_16(remotePort, serializer);
          sse_encode_opt_box_autoadd_record_u_16_u_16(
            localPortRange,
            serializer,
          );
          sse_encode_opt_box_autoadd_record_u_16_u_16(
            remotePortRange,
            serializer,
          );
          sse_encode_opt_box_autoadd_protocol(protocol, serializer);
          sse_encode_direction(direction, serializer);
          sse_encode_filter_action(action, serializer);
          sse_encode_opt_box_autoadd_u_32(priority, serializer);
          sse_encode_opt_String(description, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 27,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleNewWithParamsConstMeta,
        argValues: [
          name,
          appPath,
          local,
          remote,
          localPort,
          remotePort,
          localPortRange,
          remotePortRange,
          protocol,
          direction,
          action,
          priority,
          description,
        ],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpFilterRuleNewWithParamsConstMeta =>
      const TaskConstMeta(
        debugName: "FilterRule_new_with_params",
        argNames: [
          "name",
          "appPath",
          "local",
          "remote",
          "localPort",
          "remotePort",
          "localPortRange",
          "remotePortRange",
          "protocol",
          "direction",
          "action",
          "priority",
          "description",
        ],
      );

  @override
  Future<void> crateApiAstralWfpFilterRuleValidate({required FilterRule that}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            that,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 28,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_String,
        ),
        constMeta: kCrateApiAstralWfpFilterRuleValidateConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpFilterRuleValidateConstMeta =>
      const TaskConstMeta(debugName: "FilterRule_validate", argNames: ["that"]);

  @override
  IpAddr crateApiAstralWfpIpNetworkAutoAccessorGetIp({
    required IpNetwork that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 29)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpAddr,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpIpNetworkAutoAccessorGetIpConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpIpNetworkAutoAccessorGetIpConstMeta =>
      const TaskConstMeta(
        debugName: "IpNetwork_auto_accessor_get_ip",
        argNames: ["that"],
      );

  @override
  int crateApiAstralWfpIpNetworkAutoAccessorGetPrefixLen({
    required IpNetwork that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 30)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_u_8,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpIpNetworkAutoAccessorGetPrefixLenConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpIpNetworkAutoAccessorGetPrefixLenConstMeta =>
      const TaskConstMeta(
        debugName: "IpNetwork_auto_accessor_get_prefix_len",
        argNames: ["that"],
      );

  @override
  void crateApiAstralWfpIpNetworkAutoAccessorSetIp({
    required IpNetwork that,
    required IpAddr ip,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork(
            that,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpAddr(
            ip,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 31)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpIpNetworkAutoAccessorSetIpConstMeta,
        argValues: [that, ip],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpIpNetworkAutoAccessorSetIpConstMeta =>
      const TaskConstMeta(
        debugName: "IpNetwork_auto_accessor_set_ip",
        argNames: ["that", "ip"],
      );

  @override
  void crateApiAstralWfpIpNetworkAutoAccessorSetPrefixLen({
    required IpNetwork that,
    required int prefixLen,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork(
            that,
            serializer,
          );
          sse_encode_u_8(prefixLen, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 32)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpIpNetworkAutoAccessorSetPrefixLenConstMeta,
        argValues: [that, prefixLen],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpIpNetworkAutoAccessorSetPrefixLenConstMeta =>
      const TaskConstMeta(
        debugName: "IpNetwork_auto_accessor_set_prefix_len",
        argNames: ["that", "prefixLen"],
      );

  @override
  Future<IpNetwork> crateApiAstralWfpIpNetworkFromCidr({required String cidr}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(cidr, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 33,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork,
          decodeErrorData: sse_decode_String,
        ),
        constMeta: kCrateApiAstralWfpIpNetworkFromCidrConstMeta,
        argValues: [cidr],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpIpNetworkFromCidrConstMeta =>
      const TaskConstMeta(debugName: "IpNetwork_from_cidr", argNames: ["cidr"]);

  @override
  Future<Uint64List> crateApiAstralWfpWfpControllerAddFilters({
    required WfpController that,
    required List<FilterRule> rules,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
            that,
            serializer,
          );
          sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
            rules,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 34,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_prim_u_64_strict,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiAstralWfpWfpControllerAddFiltersConstMeta,
        argValues: [that, rules],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpWfpControllerAddFiltersConstMeta =>
      const TaskConstMeta(
        debugName: "WfpController_add_filters",
        argNames: ["that", "rules"],
      );

  @override
  Uint64List crateApiAstralWfpWfpControllerAutoAccessorGetFilterIds({
    required WfpController that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 35)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_prim_u_64_strict,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpWfpControllerAutoAccessorGetFilterIdsConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpWfpControllerAutoAccessorGetFilterIdsConstMeta =>
      const TaskConstMeta(
        debugName: "WfpController_auto_accessor_get_filter_ids",
        argNames: ["that"],
      );

  @override
  void crateApiAstralWfpWfpControllerAutoAccessorSetFilterIds({
    required WfpController that,
    required Uint64List filterIds,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
            that,
            serializer,
          );
          sse_encode_list_prim_u_64_strict(filterIds, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 36)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiAstralWfpWfpControllerAutoAccessorSetFilterIdsConstMeta,
        argValues: [that, filterIds],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiAstralWfpWfpControllerAutoAccessorSetFilterIdsConstMeta =>
      const TaskConstMeta(
        debugName: "WfpController_auto_accessor_set_filter_ids",
        argNames: ["that", "filterIds"],
      );

  @override
  Future<void> crateApiAstralWfpWfpControllerCleanup({
    required WfpController that,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
            that,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 37,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiAstralWfpWfpControllerCleanupConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpWfpControllerCleanupConstMeta =>
      const TaskConstMeta(
        debugName: "WfpController_cleanup",
        argNames: ["that"],
      );

  @override
  Future<int> crateApiAstralWfpWfpControllerDeleteFilters({
    required WfpController that,
    required Uint64List filterIds,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
            that,
            serializer,
          );
          sse_encode_list_prim_u_64_strict(filterIds, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 38,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_u_32,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiAstralWfpWfpControllerDeleteFiltersConstMeta,
        argValues: [that, filterIds],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpWfpControllerDeleteFiltersConstMeta =>
      const TaskConstMeta(
        debugName: "WfpController_delete_filters",
        argNames: ["that", "filterIds"],
      );

  @override
  Future<void> crateApiAstralWfpWfpControllerGetLayerName({
    required WfpController that,
    required Guid layerKey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
            that,
            serializer,
          );
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGUID(
            layerKey,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 39,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpWfpControllerGetLayerNameConstMeta,
        argValues: [that, layerKey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpWfpControllerGetLayerNameConstMeta =>
      const TaskConstMeta(
        debugName: "WfpController_get_layer_name",
        argNames: ["that", "layerKey"],
      );

  @override
  Future<void> crateApiAstralWfpWfpControllerInitialize({
    required WfpController that,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
            that,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 40,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiAstralWfpWfpControllerInitializeConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpWfpControllerInitializeConstMeta =>
      const TaskConstMeta(
        debugName: "WfpController_initialize",
        argNames: ["that"],
      );

  @override
  Future<WfpController> crateApiAstralWfpWfpControllerNew() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 41,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiAstralWfpWfpControllerNewConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpWfpControllerNewConstMeta =>
      const TaskConstMeta(debugName: "WfpController_new", argNames: []);

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

  TaskConstMeta get kCrateApiUtilsCheckSudoConstMeta =>
      const TaskConstMeta(debugName: "check_sudo", argNames: []);

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

  TaskConstMeta get kCrateApiSimpleCloseServerConstMeta =>
      const TaskConstMeta(debugName: "close_server", argNames: []);

  @override
  Future<JoinHandleResultString> crateApiSimpleCreateServer({
    required String username,
    required bool enableDhcp,
    required String specifiedIp,
    required String roomName,
    required String roomPassword,
    required List<String> severurl,
    required List<String> onurl,
    required List<String> cidrs,
    required List<Forward> forwards,
    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_list_String(onurl, serializer);
          sse_encode_list_String(cidrs, serializer);
          sse_encode_list_forward(forwards, serializer);
          sse_encode_box_autoadd_flags_c(flag, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 44,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiSimpleCreateServerConstMeta,
        argValues: [
          username,
          enableDhcp,
          specifiedIp,
          roomName,
          roomPassword,
          severurl,
          onurl,
          cidrs,
          forwards,
          flag,
        ],
        apiImpl: this,
      ),
    );
  }

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

  @override
  Future<String> crateApiSimpleEasytierVersion() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 45,
            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<List<(String, int)>> crateApiHopsGetAllInterfacesMetrics() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 46,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_record_string_u_32,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiHopsGetAllInterfacesMetricsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHopsGetAllInterfacesMetricsConstMeta =>
      const TaskConstMeta(
        debugName: "get_all_interfaces_metrics",
        argNames: [],
      );

  @override
  Future<bool> crateApiFirewallGetFirewallStatus({required int profileIndex}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_32(profileIndex, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 47,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiFirewallGetFirewallStatusConstMeta,
        argValues: [profileIndex],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiFirewallGetFirewallStatusConstMeta =>
      const TaskConstMeta(
        debugName: "get_firewall_status",
        argNames: ["profileIndex"],
      );

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

  TaskConstMeta get kCrateApiSimpleGetIpsConstMeta =>
      const TaskConstMeta(debugName: "get_ips", argNames: []);

  @override
  Future<KVNetworkStatus> crateApiSimpleGetNetworkStatus() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 49,
            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<String?> crateApiNtGetNtPath({required String dosPath}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(dosPath, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 50,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_opt_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiNtGetNtPathConstMeta,
        argValues: [dosPath],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiNtGetNtPathConstMeta =>
      const TaskConstMeta(debugName: "get_nt_path", argNames: ["dosPath"]);

  @override
  Future<List<PeerRoutePair>> crateApiSimpleGetPeerRoutePairs() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 51,
            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<String> crateApiSimpleGetRunningInfo() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 52,
            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<JoinHandle> crateApiSimpleHandleEvent({
    required EventBusSubscriber events,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerEventBusSubscriber(
            events,
            serializer,
          );
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 53,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandle,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiSimpleHandleEventConstMeta,
        argValues: [events],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSimpleHandleEventConstMeta =>
      const TaskConstMeta(debugName: "handle_event", argNames: ["events"]);

  @override
  Future<void> crateApiSimpleInitApp() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 54,
            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: 55,
            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: []);

  @override
  Future<void> crateApiSimpleSendUdpToLocalhost({required String message}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(message, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 56,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_String,
        ),
        constMeta: kCrateApiSimpleSendUdpToLocalhostConstMeta,
        argValues: [message],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSimpleSendUdpToLocalhostConstMeta =>
      const TaskConstMeta(
        debugName: "send_udp_to_localhost",
        argNames: ["message"],
      );

  @override
  Future<void> crateApiFirewallSetFirewallStatus({
    required int profileIndex,
    required bool enable,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_32(profileIndex, serializer);
          sse_encode_bool(enable, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 57,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiFirewallSetFirewallStatusConstMeta,
        argValues: [profileIndex, enable],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiFirewallSetFirewallStatusConstMeta =>
      const TaskConstMeta(
        debugName: "set_firewall_status",
        argNames: ["profileIndex", "enable"],
      );

  @override
  Future<void> crateApiHopsSetInterfaceMetric({
    required String interfaceName,
    required int metric,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(interfaceName, serializer);
          sse_encode_u_32(metric, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 58,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiHopsSetInterfaceMetricConstMeta,
        argValues: [interfaceName, metric],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHopsSetInterfaceMetricConstMeta =>
      const TaskConstMeta(
        debugName: "set_interface_metric",
        argNames: ["interfaceName", "metric"],
      );

  @override
  Future<void> crateApiSimpleSetTunFd({required int fd}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_i_32(fd, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 59,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_String,
        ),
        constMeta: kCrateApiSimpleSetTunFdConstMeta,
        argValues: [fd],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSimpleSetTunFdConstMeta =>
      const TaskConstMeta(debugName: "set_tun_fd", argNames: ["fd"]);

  @override
  Future<Uint16List> crateApiAstralWfpToWideString({required String s}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(s, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 60,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_prim_u_16_strict,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiAstralWfpToWideStringConstMeta,
        argValues: [s],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAstralWfpToWideStringConstMeta =>
      const TaskConstMeta(debugName: "to_wide_string", argNames: ["s"]);

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_EventBusSubscriber =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerEventBusSubscriber;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_EventBusSubscriber =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerEventBusSubscriber;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_FilterRule =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_FilterRule =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Guid =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGUID;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Guid =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGUID;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_IpAddr =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpAddr;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_IpAddr =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpAddr;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_IpNetwork =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_IpNetwork =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_JoinHandle =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandle;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_JoinHandle =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandle;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_JoinHandleResultString =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_JoinHandleResultString =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString;

  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_WfpController =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_WfpController =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController;

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

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

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

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

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

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

  @protected
  JoinHandleResultString
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return JoinHandleResultStringImpl.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
  WfpController
  dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return WfpControllerImpl.frbInternalDcoDecode(raw as List<dynamic>);
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  JoinHandleResultString
  dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return JoinHandleResultStringImpl.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
  WfpController
  dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return WfpControllerImpl.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
  Protocol dco_decode_box_autoadd_protocol(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_protocol(raw);
  }

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

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

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

  @protected
  Direction dco_decode_direction(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return Direction.values[raw as int];
  }

  @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
  FilterAction dco_decode_filter_action(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return FilterAction.values[raw as int];
  }

  @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 != 24)
      throw Exception('unexpected arr length: expect 24 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]),
      acceptDns: dco_decode_bool(arr[20]),
      privateMode: dco_decode_bool(arr[21]),
      enableQuicProxy: dco_decode_bool(arr[22]),
      disableQuicInput: dco_decode_bool(arr[23]),
    );
  }

  @protected
  Forward dco_decode_forward(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 3)
      throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
    return Forward(
      bindAddr: dco_decode_String(arr[0]),
      dstAddr: dco_decode_String(arr[1]),
      proto: dco_decode_String(arr[2]),
    );
  }

  @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 != 13)
      throw Exception('unexpected arr length: expect 13 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]),
      hops: dco_decode_list_node_hop_stats(arr[4]),
      lossRate: dco_decode_f_32(arr[5]),
      connections: dco_decode_list_kv_node_connection_stats(arr[6]),
      tunnelProto: dco_decode_String(arr[7]),
      connType: dco_decode_String(arr[8]),
      rxBytes: dco_decode_u_64(arr[9]),
      txBytes: dco_decode_u_64(arr[10]),
      version: dco_decode_String(arr[11]),
      cost: dco_decode_i_32(arr[12]),
    );
  }

  @protected
  List<FilterRule>
  dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
    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_generatedRustAutoOpaqueInnerFilterRule,
        )
        .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<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<Forward> dco_decode_list_forward(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_forward).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
  List<NodeHopStats> dco_decode_list_node_hop_stats(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_node_hop_stats).toList();
  }

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

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

  @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<(String, int)> dco_decode_list_record_string_u_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return (raw as List<dynamic>).map(dco_decode_record_string_u_32).toList();
  }

  @protected
  NodeHopStats dco_decode_node_hop_stats(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 4)
      throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
    return NodeHopStats(
      targetIp: dco_decode_String(arr[0]),
      latencyMs: dco_decode_f_64(arr[1]),
      packetLoss: dco_decode_f_32(arr[2]),
      nodeName: dco_decode_String(arr[3]),
    );
  }

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

  @protected
  Protocol? dco_decode_opt_box_autoadd_protocol(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_protocol(raw);
  }

  @protected
  (int, int)? dco_decode_opt_box_autoadd_record_u_16_u_16(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_record_u_16_u_16(raw);
  }

  @protected
  int? dco_decode_opt_box_autoadd_u_16(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_u_16(raw);
  }

  @protected
  int? dco_decode_opt_box_autoadd_u_32(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_u_32(raw);
  }

  @protected
  Protocol dco_decode_protocol(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return Protocol.values[raw as int];
  }

  @protected
  (String, int) dco_decode_record_string_u_32(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_String(arr[0]), dco_decode_u_32(arr[1]));
  }

  @protected
  (int, int) dco_decode_record_u_16_u_16(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_u_16(arr[0]), dco_decode_u_16(arr[1]));
  }

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

  @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
  AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_String(deserializer);
    return AnyhowException(inner);
  }

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

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

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

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

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

  @protected
  JoinHandleResultString
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return JoinHandleResultStringImpl.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
  WfpController
  sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return WfpControllerImpl.frbInternalSseDecode(
      sse_decode_usize(deserializer),
      sse_decode_i_32(deserializer),
    );
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  JoinHandleResultString
  sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return JoinHandleResultStringImpl.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
  WfpController
  sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return WfpControllerImpl.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
  Protocol sse_decode_box_autoadd_protocol(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_protocol(deserializer));
  }

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

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

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

  @protected
  Direction sse_decode_direction(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return Direction.values[inner];
  }

  @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
  FilterAction sse_decode_filter_action(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return FilterAction.values[inner];
  }

  @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);
    var var_acceptDns = sse_decode_bool(deserializer);
    var var_privateMode = sse_decode_bool(deserializer);
    var var_enableQuicProxy = sse_decode_bool(deserializer);
    var var_disableQuicInput = 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,
      acceptDns: var_acceptDns,
      privateMode: var_privateMode,
      enableQuicProxy: var_enableQuicProxy,
      disableQuicInput: var_disableQuicInput,
    );
  }

  @protected
  Forward sse_decode_forward(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_bindAddr = sse_decode_String(deserializer);
    var var_dstAddr = sse_decode_String(deserializer);
    var var_proto = sse_decode_String(deserializer);
    return Forward(
      bindAddr: var_bindAddr,
      dstAddr: var_dstAddr,
      proto: var_proto,
    );
  }

  @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_hops = sse_decode_list_node_hop_stats(deserializer);
    var var_lossRate = sse_decode_f_32(deserializer);
    var var_connections = sse_decode_list_kv_node_connection_stats(
      deserializer,
    );
    var var_tunnelProto = sse_decode_String(deserializer);
    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_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,
      hops: var_hops,
      lossRate: var_lossRate,
      connections: var_connections,
      tunnelProto: var_tunnelProto,
      connType: var_connType,
      rxBytes: var_rxBytes,
      txBytes: var_txBytes,
      version: var_version,
      cost: var_cost,
    );
  }

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

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <FilterRule>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(
        sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
          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<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<Forward> sse_decode_list_forward(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    var len_ = sse_decode_i_32(deserializer);
    var ans_ = <Forward>[];
    for (var idx_ = 0; idx_ < len_; ++idx_) {
      ans_.add(sse_decode_forward(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
  List<NodeHopStats> sse_decode_list_node_hop_stats(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

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

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

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

  @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<(String, int)> sse_decode_list_record_string_u_32(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

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

  @protected
  NodeHopStats sse_decode_node_hop_stats(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_targetIp = sse_decode_String(deserializer);
    var var_latencyMs = sse_decode_f_64(deserializer);
    var var_packetLoss = sse_decode_f_32(deserializer);
    var var_nodeName = sse_decode_String(deserializer);
    return NodeHopStats(
      targetIp: var_targetIp,
      latencyMs: var_latencyMs,
      packetLoss: var_packetLoss,
      nodeName: var_nodeName,
    );
  }

  @protected
  String? sse_decode_opt_String(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_String(deserializer));
    } else {
      return null;
    }
  }

  @protected
  Protocol? sse_decode_opt_box_autoadd_protocol(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_protocol(deserializer));
    } else {
      return null;
    }
  }

  @protected
  (int, int)? sse_decode_opt_box_autoadd_record_u_16_u_16(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_record_u_16_u_16(deserializer));
    } else {
      return null;
    }
  }

  @protected
  int? sse_decode_opt_box_autoadd_u_16(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_u_16(deserializer));
    } else {
      return null;
    }
  }

  @protected
  int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_u_32(deserializer));
    } else {
      return null;
    }
  }

  @protected
  Protocol sse_decode_protocol(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_i_32(deserializer);
    return Protocol.values[inner];
  }

  @protected
  (String, int) sse_decode_record_string_u_32(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_field0 = sse_decode_String(deserializer);
    var var_field1 = sse_decode_u_32(deserializer);
    return (var_field0, var_field1);
  }

  @protected
  (int, int) sse_decode_record_u_16_u_16(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_field0 = sse_decode_u_16(deserializer);
    var var_field1 = sse_decode_u_16(deserializer);
    return (var_field0, var_field1);
  }

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

  @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_AnyhowException(
    AnyhowException self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.message, serializer);
  }

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

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

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

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

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

  @protected
  void
  sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString(
    JoinHandleResultString self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as JoinHandleResultStringImpl).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_generatedRustAutoOpaqueInnerWfpController(
    WfpController self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as WfpControllerImpl).frbInternalSseEncode(move: true),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
    FilterRule self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as FilterRuleImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork(
    IpNetwork self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as IpNetworkImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
    WfpController self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as WfpControllerImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFilterRule(
    FilterRule self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as FilterRuleImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerGUID(
    Guid self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as GuidImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerIpNetwork(
    IpNetwork self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as IpNetworkImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

  @protected
  void
  sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerWfpController(
    WfpController self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as WfpControllerImpl).frbInternalSseEncode(move: false),
      serializer,
    );
  }

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

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

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

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

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

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

  @protected
  void
  sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerJoinHandleResultString(
    JoinHandleResultString self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as JoinHandleResultStringImpl).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_generatedRustAutoOpaqueInnerWfpController(
    WfpController self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize(
      (self as WfpControllerImpl).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_box_autoadd_protocol(
    Protocol self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_protocol(self, serializer);
  }

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

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

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

  @protected
  void sse_encode_direction(Direction self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, 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_filter_action(FilterAction self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, serializer);
  }

  @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);
    sse_encode_bool(self.acceptDns, serializer);
    sse_encode_bool(self.privateMode, serializer);
    sse_encode_bool(self.enableQuicProxy, serializer);
    sse_encode_bool(self.disableQuicInput, serializer);
  }

  @protected
  void sse_encode_forward(Forward self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.bindAddr, serializer);
    sse_encode_String(self.dstAddr, serializer);
    sse_encode_String(self.proto, 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_list_node_hop_stats(self.hops, serializer);
    sse_encode_f_32(self.lossRate, serializer);
    sse_encode_list_kv_node_connection_stats(self.connections, serializer);
    sse_encode_String(self.tunnelProto, serializer);
    sse_encode_String(self.connType, serializer);
    sse_encode_u_64(self.rxBytes, serializer);
    sse_encode_u_64(self.txBytes, 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_generatedRustAutoOpaqueInnerFilterRule(
    List<FilterRule> 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_generatedRustAutoOpaqueInnerFilterRule(
        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_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_forward(List<Forward> 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_forward(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_node_hop_stats(
    List<NodeHopStats> 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_node_hop_stats(item, serializer);
    }
  }

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

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

  @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_list_record_string_u_32(
    List<(String, int)> 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_record_string_u_32(item, serializer);
    }
  }

  @protected
  void sse_encode_node_hop_stats(NodeHopStats self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.targetIp, serializer);
    sse_encode_f_64(self.latencyMs, serializer);
    sse_encode_f_32(self.packetLoss, serializer);
    sse_encode_String(self.nodeName, serializer);
  }

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

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_String(self, serializer);
    }
  }

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

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_protocol(self, serializer);
    }
  }

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

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_record_u_16_u_16(self, serializer);
    }
  }

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

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_u_16(self, serializer);
    }
  }

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

    sse_encode_bool(self != null, serializer);
    if (self != null) {
      sse_encode_box_autoadd_u_32(self, serializer);
    }
  }

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

  @protected
  void sse_encode_record_string_u_32(
    (String, int) self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.$1, serializer);
    sse_encode_u_32(self.$2, serializer);
  }

  @protected
  void sse_encode_record_u_16_u_16((int, int) self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_16(self.$1, serializer);
    sse_encode_u_16(self.$2, serializer);
  }

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

  @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 EventBusSubscriberImpl extends RustOpaque implements EventBusSubscriber {
  // Not to be used by end users
  EventBusSubscriberImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_EventBusSubscriber,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_EventBusSubscriber,
    rustArcDecrementStrongCountPtr:
        RustLib
            .instance
            .api
            .rust_arc_decrement_strong_count_EventBusSubscriberPtr,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_FilterRule,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_FilterRule,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_FilterRulePtr,
  );

  FilterAction get action => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetAction(that: this);

  String? get appPath => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetAppPath(that: this);

  Direction get direction => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetDirection(that: this);

  Uint64List get filterIds => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetFilterIds(that: this);

  String? get local => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetLocal(that: this);

  int? get localPort => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetLocalPort(that: this);

  (int, int)? get localPortRange => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetLocalPortRange(that: this);

  String get name => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetName(that: this);

  int get priority => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetPriority(that: this);

  Protocol? get protocol => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetProtocol(that: this);

  String? get remote => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetRemote(that: this);

  int? get remotePort => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetRemotePort(that: this);

  (int, int)? get remotePortRange => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorGetRemotePortRange(that: this);

  set action(FilterAction action) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetAction(
        that: this,
        action: action,
      );

  set appPath(String? appPath) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetAppPath(
        that: this,
        appPath: appPath,
      );

  set direction(Direction direction) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetDirection(
        that: this,
        direction: direction,
      );

  set filterIds(Uint64List filterIds) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetFilterIds(
        that: this,
        filterIds: filterIds,
      );

  set local(String? local) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetLocal(
        that: this,
        local: local,
      );

  set localPort(int? localPort) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetLocalPort(
        that: this,
        localPort: localPort,
      );

  set localPortRange((int, int)? localPortRange) => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorSetLocalPortRange(
        that: this,
        localPortRange: localPortRange,
      );

  set name(String name) => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorSetName(that: this, name: name);

  set priority(int priority) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetPriority(
        that: this,
        priority: priority,
      );

  set protocol(Protocol? protocol) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetProtocol(
        that: this,
        protocol: protocol,
      );

  set remote(String? remote) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetRemote(
        that: this,
        remote: remote,
      );

  set remotePort(int? remotePort) =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleAutoAccessorSetRemotePort(
        that: this,
        remotePort: remotePort,
      );

  set remotePortRange((int, int)? remotePortRange) => RustLib.instance.api
      .crateApiAstralWfpFilterRuleAutoAccessorSetRemotePortRange(
        that: this,
        remotePortRange: remotePortRange,
      );

  Future<void> validate() =>
      RustLib.instance.api.crateApiAstralWfpFilterRuleValidate(that: this);
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_Guid,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_Guid,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_GuidPtr,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_IpAddr,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_IpAddr,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_IpAddrPtr,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_IpNetwork,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_IpNetwork,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_IpNetworkPtr,
  );

  IpAddr get ip => RustLib.instance.api
      .crateApiAstralWfpIpNetworkAutoAccessorGetIp(that: this);

  int get prefixLen => RustLib.instance.api
      .crateApiAstralWfpIpNetworkAutoAccessorGetPrefixLen(that: this);

  set ip(IpAddr ip) => RustLib.instance.api
      .crateApiAstralWfpIpNetworkAutoAccessorSetIp(that: this, ip: ip);

  set prefixLen(int prefixLen) =>
      RustLib.instance.api.crateApiAstralWfpIpNetworkAutoAccessorSetPrefixLen(
        that: this,
        prefixLen: prefixLen,
      );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_JoinHandle,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_JoinHandle,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_JoinHandlePtr,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib
            .instance
            .api
            .rust_arc_increment_strong_count_JoinHandleResultString,
    rustArcDecrementStrongCount:
        RustLib
            .instance
            .api
            .rust_arc_decrement_strong_count_JoinHandleResultString,
    rustArcDecrementStrongCountPtr:
        RustLib
            .instance
            .api
            .rust_arc_decrement_strong_count_JoinHandleResultStringPtr,
  );
}

@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 WfpControllerImpl extends RustOpaque implements WfpController {
  // Not to be used by end users
  WfpControllerImpl.frbInternalDcoDecode(List<dynamic> wire)
    : super.frbInternalDcoDecode(wire, _kStaticData);

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_WfpController,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_WfpController,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_WfpControllerPtr,
  );

  Future<Uint64List> addFilters({required List<FilterRule> rules}) => RustLib
      .instance
      .api
      .crateApiAstralWfpWfpControllerAddFilters(that: this, rules: rules);

  Uint64List get filterIds => RustLib.instance.api
      .crateApiAstralWfpWfpControllerAutoAccessorGetFilterIds(that: this);

  set filterIds(Uint64List filterIds) => RustLib.instance.api
      .crateApiAstralWfpWfpControllerAutoAccessorSetFilterIds(
        that: this,
        filterIds: filterIds,
      );

  Future<void> cleanup() =>
      RustLib.instance.api.crateApiAstralWfpWfpControllerCleanup(that: this);

  Future<int> deleteFilters({required Uint64List filterIds}) =>
      RustLib.instance.api.crateApiAstralWfpWfpControllerDeleteFilters(
        that: this,
        filterIds: filterIds,
      );

  Future<void> getLayerName({required Guid layerKey}) =>
      RustLib.instance.api.crateApiAstralWfpWfpControllerGetLayerName(
        that: this,
        layerKey: layerKey,
      );

  Future<void> initialize() =>
      RustLib.instance.api.crateApiAstralWfpWfpControllerInitialize(that: this);
}
