// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.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 'dart:async';
import 'dart:convert';

import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:localsend_isolates/rust/api/crypto.dart';
import 'package:localsend_isolates/rust/api/http.dart';
import 'package:localsend_isolates/rust/api/logging.dart';
import 'package:localsend_isolates/rust/api/model.dart';
import 'package:localsend_isolates/rust/api/server.dart';
import 'package:localsend_isolates/rust/api/stream.dart';
import 'package:localsend_isolates/rust/api/webrtc.dart';
import 'package:localsend_isolates/rust/frb_generated.dart';
import 'package:localsend_isolates/rust/frb_generated.io.dart' if (dart.library.js_interop) 'frb_generated.web.dart';
import 'package:uuid/uuid.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,
    bool forceSameCodegenVersion = true,
  }) async {
    await instance.initImpl(
      api: api,
      handler: handler,
      externalLibrary: externalLibrary,
      forceSameCodegenVersion: forceSameCodegenVersion,
    );
  }

  /// 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.12.0';

  @override
  int get rustContentHash => 1916764705;

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

abstract class RustLibApi extends BaseApi {
  Future<void> crateApiStreamDart2RustStreamSinkAdd({required Dart2RustStreamSink that, required List<int> data});

  void crateApiStreamDart2RustStreamSinkClose({required Dart2RustStreamSink that});

  Future<RtcReceiveController> crateApiWebrtcLsSignalingConnectionAcceptOffer({
    required LsSignalingConnection that,
    required List<String> stunServers,
    required WsServerSdpMessage offer,
    required String privateKey,
    ExpectingPublicKey? expectingPublicKey,
    PinConfig? pin,
  });

  Future<RtcSendController> crateApiWebrtcLsSignalingConnectionSendOffer({
    required LsSignalingConnection that,
    required List<String> stunServers,
    required UuidValue target,
    required String privateKey,
    ExpectingPublicKey? expectingPublicKey,
    PinConfig? pin,
    required List<FileDto> files,
  });

  Future<void> crateApiWebrtcLsSignalingConnectionUpdateInfo({required LsSignalingConnection that, required ClientInfoWithoutId info});

  void crateApiHttpRsCancellationTokenCancel({required RsCancellationToken that});

  Future<void> crateApiHttpRsHttpClientCancel({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    required String sessionId,
  });

  Future<PrepareUploadResult> crateApiHttpRsHttpClientPrepareUpload({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    required PrepareUploadRequestDto payload,
    String? publicKey,
    String? pin,
  });

  Future<ResultWithPublicKeyRegisterResponseDto> crateApiHttpRsHttpClientRegister({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    required RegisterDto payload,
  });

  Stream<double> crateApiHttpRsHttpClientUpload({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    String? publicKey,
    required String sessionId,
    required String fileId,
    required String token,
    Dart2RustStreamReceiver? binary,
    String? path,
    int? fileDescriptor,
    required BigInt contentLength,
    required RsCancellationToken cancelToken,
  });

  Future<void> crateApiServerRsHttpServerCancelSession({required RsHttpServer that, required String sessionId});

  Stream<RsServerEvent> crateApiServerRsHttpServerListen({required RsHttpServer that});

  Future<void> crateApiServerRsHttpServerRejectFileDownload({required RsHttpServer that, required String sessionId, required String fileId});

  Future<void> crateApiServerRsHttpServerRejectFileUpload({required RsHttpServer that, required String sessionId, required String fileId});

  Future<void> crateApiServerRsHttpServerRespondFileDownload({
    required RsHttpServer that,
    required String sessionId,
    required String fileId,
    String? path,
    int? fileDescriptor,
  });

  Stream<double> crateApiServerRsHttpServerRespondFileUpload({
    required RsHttpServer that,
    required String sessionId,
    required String fileId,
    String? path,
    int? fileDescriptor,
    required BigInt fileSize,
  });

  Future<void> crateApiServerRsHttpServerRespondPrepareDownload({required RsHttpServer that, required String sessionId, required bool accept});

  Future<void> crateApiServerRsHttpServerRespondPrepareUpload({required RsHttpServer that, List<String>? acceptedFileIds});

  Future<void> crateApiServerRsHttpServerStop({required RsHttpServer that});

  Future<String> crateApiWebrtcRtcFileReceiverGetFileId({required RtcFileReceiver that});

  Stream<Uint8List> crateApiWebrtcRtcFileReceiverReceive({required RtcFileReceiver that});

  Future<void> crateApiWebrtcRtcFileSenderSend({required RtcFileSender that, required List<int> data});

  Future<void> crateApiWebrtcRtcReceiveControllerDecline({required RtcReceiveController that});

  Stream<RTCFileError> crateApiWebrtcRtcReceiveControllerListenError({required RtcReceiveController that});

  Future<List<FileDto>> crateApiWebrtcRtcReceiveControllerListenFiles({required RtcReceiveController that});

  Stream<RtcFileReceiver> crateApiWebrtcRtcReceiveControllerListenReceiving({required RtcReceiveController that});

  Stream<RTCStatus> crateApiWebrtcRtcReceiveControllerListenStatus({required RtcReceiveController that});

  Future<void> crateApiWebrtcRtcReceiveControllerSendFileStatus({required RtcReceiveController that, required RTCSendFileResponse status});

  Future<void> crateApiWebrtcRtcReceiveControllerSendPin({required RtcReceiveController that, required String pin});

  Future<void> crateApiWebrtcRtcReceiveControllerSendSelection({required RtcReceiveController that, required Set<String> selection});

  Stream<RTCFileError> crateApiWebrtcRtcSendControllerListenError({required RtcSendController that});

  Future<Set<String>> crateApiWebrtcRtcSendControllerListenSelectedFiles({required RtcSendController that});

  Stream<RTCStatus> crateApiWebrtcRtcSendControllerListenStatus({required RtcSendController that});

  Future<RtcFileSender> crateApiWebrtcRtcSendControllerSendFile({required RtcSendController that, required String fileId});

  Future<void> crateApiWebrtcRtcSendControllerSendPin({required RtcSendController that, required String pin});

  Stream<WsServerMessage> crateApiWebrtcConnect({
    required String uri,
    required ProposingClientInfo info,
    required String privateKey,
    required FutureOr<void> Function(LsSignalingConnection) onConnection,
  });

  RsCancellationToken crateApiHttpCreateCancellationToken();

  RsHttpClient crateApiHttpCreateClient({required String privateKey, required String cert, required LsHttpClientVersion version, int? timeoutMs});

  Future<(Dart2RustStreamSink, Dart2RustStreamReceiver)> crateApiStreamCreateStream();

  Future<void> crateApiLoggingEnableDebugLogging();

  Future<KeyPair> crateApiCryptoGenerateKeyPair();

  Future<RsHttpServer> crateApiServerStartServer({
    required int port,
    TlsConfig? tls,
    required String alias,
    required String version,
    String? deviceModel,
    DeviceType? deviceType,
    required String fingerprint,
    String? pin,
    WebSendParams? webSend,
    String? showToken,
  });

  Future<void> crateApiCryptoVerifyCert({required String cert, required String publicKey});

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Dart2RustStreamReceiver;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Dart2RustStreamReceiver;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_Dart2RustStreamReceiverPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Dart2RustStreamSink;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Dart2RustStreamSink;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_Dart2RustStreamSinkPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_LsSignalingConnection;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_LsSignalingConnection;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_LsSignalingConnectionPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcFileReceiver;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcFileReceiver;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RtcFileReceiverPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcFileSender;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcFileSender;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RtcFileSenderPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcReceiveController;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcReceiveController;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RtcReceiveControllerPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcSendController;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcSendController;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RtcSendControllerPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RsCancellationToken;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RsCancellationToken;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RsCancellationTokenPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RsHttpClient;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RsHttpClient;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RsHttpClientPtr;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RsHttpServer;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RsHttpServer;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_RsHttpServerPtr;
}

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

  @override
  Future<void> crateApiStreamDart2RustStreamSinkAdd({required Dart2RustStreamSink that, required List<int> data}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink(that, serializer);
          sse_encode_list_prim_u_8_loose(data, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_String,
        ),
        constMeta: kCrateApiStreamDart2RustStreamSinkAddConstMeta,
        argValues: [that, data],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiStreamDart2RustStreamSinkAddConstMeta => const TaskConstMeta(
    debugName: 'Dart2RustStreamSink_add',
    argNames: ['that', 'data'],
  );

  @override
  void crateApiStreamDart2RustStreamSinkClose({required Dart2RustStreamSink that}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink(that, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 2)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiStreamDart2RustStreamSinkCloseConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiStreamDart2RustStreamSinkCloseConstMeta => const TaskConstMeta(
    debugName: 'Dart2RustStreamSink_close',
    argNames: ['that'],
  );

  @override
  Future<RtcReceiveController> crateApiWebrtcLsSignalingConnectionAcceptOffer({
    required LsSignalingConnection that,
    required List<String> stunServers,
    required WsServerSdpMessage offer,
    required String privateKey,
    ExpectingPublicKey? expectingPublicKey,
    PinConfig? pin,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection(that, serializer);
          sse_encode_list_String(stunServers, serializer);
          sse_encode_box_autoadd_ws_server_sdp_message(offer, serializer);
          sse_encode_String(privateKey, serializer);
          sse_encode_opt_box_autoadd_expecting_public_key(expectingPublicKey, serializer);
          sse_encode_opt_box_autoadd_pin_config(pin, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 3, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcLsSignalingConnectionAcceptOfferConstMeta,
        argValues: [that, stunServers, offer, privateKey, expectingPublicKey, pin],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcLsSignalingConnectionAcceptOfferConstMeta => const TaskConstMeta(
    debugName: 'LsSignalingConnection_accept_offer',
    argNames: ['that', 'stunServers', 'offer', 'privateKey', 'expectingPublicKey', 'pin'],
  );

  @override
  Future<RtcSendController> crateApiWebrtcLsSignalingConnectionSendOffer({
    required LsSignalingConnection that,
    required List<String> stunServers,
    required UuidValue target,
    required String privateKey,
    ExpectingPublicKey? expectingPublicKey,
    PinConfig? pin,
    required List<FileDto> files,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection(that, serializer);
          sse_encode_list_String(stunServers, serializer);
          sse_encode_Uuid(target, serializer);
          sse_encode_String(privateKey, serializer);
          sse_encode_opt_box_autoadd_expecting_public_key(expectingPublicKey, serializer);
          sse_encode_opt_box_autoadd_pin_config(pin, serializer);
          sse_encode_list_file_dto(files, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 4, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcLsSignalingConnectionSendOfferConstMeta,
        argValues: [that, stunServers, target, privateKey, expectingPublicKey, pin, files],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcLsSignalingConnectionSendOfferConstMeta => const TaskConstMeta(
    debugName: 'LsSignalingConnection_send_offer',
    argNames: ['that', 'stunServers', 'target', 'privateKey', 'expectingPublicKey', 'pin', 'files'],
  );

  @override
  Future<void> crateApiWebrtcLsSignalingConnectionUpdateInfo({required LsSignalingConnection that, required ClientInfoWithoutId info}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection(that, serializer);
          sse_encode_box_autoadd_client_info_without_id(info, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 5, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcLsSignalingConnectionUpdateInfoConstMeta,
        argValues: [that, info],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcLsSignalingConnectionUpdateInfoConstMeta => const TaskConstMeta(
    debugName: 'LsSignalingConnection_update_info',
    argNames: ['that', 'info'],
  );

  @override
  void crateApiHttpRsCancellationTokenCancel({required RsCancellationToken that}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsCancellationToken(that, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 6)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiHttpRsCancellationTokenCancelConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHttpRsCancellationTokenCancelConstMeta => const TaskConstMeta(
    debugName: 'RsCancellationToken_cancel',
    argNames: ['that'],
  );

  @override
  Future<void> crateApiHttpRsHttpClientCancel({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    required String sessionId,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpClient(that, serializer);
          sse_encode_protocol_type(protocol, serializer);
          sse_encode_String(ip, serializer);
          sse_encode_u_16(port, serializer);
          sse_encode_String(sessionId, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 7, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_rs_http_client_error,
        ),
        constMeta: kCrateApiHttpRsHttpClientCancelConstMeta,
        argValues: [that, protocol, ip, port, sessionId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHttpRsHttpClientCancelConstMeta => const TaskConstMeta(
    debugName: 'RsHttpClient_cancel',
    argNames: ['that', 'protocol', 'ip', 'port', 'sessionId'],
  );

  @override
  Future<PrepareUploadResult> crateApiHttpRsHttpClientPrepareUpload({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    required PrepareUploadRequestDto payload,
    String? publicKey,
    String? pin,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpClient(that, serializer);
          sse_encode_protocol_type(protocol, serializer);
          sse_encode_String(ip, serializer);
          sse_encode_u_16(port, serializer);
          sse_encode_box_autoadd_prepare_upload_request_dto(payload, serializer);
          sse_encode_opt_String(publicKey, serializer);
          sse_encode_opt_String(pin, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 8, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_prepare_upload_result,
          decodeErrorData: sse_decode_rs_http_client_error,
        ),
        constMeta: kCrateApiHttpRsHttpClientPrepareUploadConstMeta,
        argValues: [that, protocol, ip, port, payload, publicKey, pin],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHttpRsHttpClientPrepareUploadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpClient_prepare_upload',
    argNames: ['that', 'protocol', 'ip', 'port', 'payload', 'publicKey', 'pin'],
  );

  @override
  Future<ResultWithPublicKeyRegisterResponseDto> crateApiHttpRsHttpClientRegister({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    required RegisterDto payload,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpClient(that, serializer);
          sse_encode_protocol_type(protocol, serializer);
          sse_encode_String(ip, serializer);
          sse_encode_u_16(port, serializer);
          sse_encode_box_autoadd_register_dto(payload, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 9, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_result_with_public_key_register_response_dto,
          decodeErrorData: sse_decode_rs_http_client_error,
        ),
        constMeta: kCrateApiHttpRsHttpClientRegisterConstMeta,
        argValues: [that, protocol, ip, port, payload],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHttpRsHttpClientRegisterConstMeta => const TaskConstMeta(
    debugName: 'RsHttpClient_register',
    argNames: ['that', 'protocol', 'ip', 'port', 'payload'],
  );

  @override
  Stream<double> crateApiHttpRsHttpClientUpload({
    required RsHttpClient that,
    required ProtocolType protocol,
    required String ip,
    required int port,
    String? publicKey,
    required String sessionId,
    required String fileId,
    required String token,
    Dart2RustStreamReceiver? binary,
    String? path,
    int? fileDescriptor,
    required BigInt contentLength,
    required RsCancellationToken cancelToken,
  }) {
    final sink = RustStreamSink<double>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpClient(that, serializer);
            sse_encode_StreamSink_f_64_Sse(sink, serializer);
            sse_encode_protocol_type(protocol, serializer);
            sse_encode_String(ip, serializer);
            sse_encode_u_16(port, serializer);
            sse_encode_opt_String(publicKey, serializer);
            sse_encode_String(sessionId, serializer);
            sse_encode_String(fileId, serializer);
            sse_encode_String(token, serializer);
            sse_encode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(
              binary,
              serializer,
            );
            sse_encode_opt_String(path, serializer);
            sse_encode_opt_box_autoadd_i_32(fileDescriptor, serializer);
            sse_encode_u_64(contentLength, serializer);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsCancellationToken(cancelToken, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 10, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_rs_http_client_error,
          ),
          constMeta: kCrateApiHttpRsHttpClientUploadConstMeta,
          argValues: [that, sink, protocol, ip, port, publicKey, sessionId, fileId, token, binary, path, fileDescriptor, contentLength, cancelToken],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiHttpRsHttpClientUploadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpClient_upload',
    argNames: [
      'that',
      'sink',
      'protocol',
      'ip',
      'port',
      'publicKey',
      'sessionId',
      'fileId',
      'token',
      'binary',
      'path',
      'fileDescriptor',
      'contentLength',
      'cancelToken',
    ],
  );

  @override
  Future<void> crateApiServerRsHttpServerCancelSession({required RsHttpServer that, required String sessionId}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
          sse_encode_String(sessionId, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 11, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiServerRsHttpServerCancelSessionConstMeta,
        argValues: [that, sessionId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiServerRsHttpServerCancelSessionConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_cancel_session',
    argNames: ['that', 'sessionId'],
  );

  @override
  Stream<RsServerEvent> crateApiServerRsHttpServerListen({required RsHttpServer that}) {
    final sink = RustStreamSink<RsServerEvent>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
            sse_encode_StreamSink_rs_server_event_Sse(sink, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 12, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: null,
          ),
          constMeta: kCrateApiServerRsHttpServerListenConstMeta,
          argValues: [that, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiServerRsHttpServerListenConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_listen',
    argNames: ['that', 'sink'],
  );

  @override
  Future<void> crateApiServerRsHttpServerRejectFileDownload({required RsHttpServer that, required String sessionId, required String fileId}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
          sse_encode_String(sessionId, serializer);
          sse_encode_String(fileId, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 13, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiServerRsHttpServerRejectFileDownloadConstMeta,
        argValues: [that, sessionId, fileId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiServerRsHttpServerRejectFileDownloadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_reject_file_download',
    argNames: ['that', 'sessionId', 'fileId'],
  );

  @override
  Future<void> crateApiServerRsHttpServerRejectFileUpload({required RsHttpServer that, required String sessionId, required String fileId}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
          sse_encode_String(sessionId, serializer);
          sse_encode_String(fileId, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 14, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiServerRsHttpServerRejectFileUploadConstMeta,
        argValues: [that, sessionId, fileId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiServerRsHttpServerRejectFileUploadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_reject_file_upload',
    argNames: ['that', 'sessionId', 'fileId'],
  );

  @override
  Future<void> crateApiServerRsHttpServerRespondFileDownload({
    required RsHttpServer that,
    required String sessionId,
    required String fileId,
    String? path,
    int? fileDescriptor,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
          sse_encode_String(sessionId, serializer);
          sse_encode_String(fileId, serializer);
          sse_encode_opt_String(path, serializer);
          sse_encode_opt_box_autoadd_i_32(fileDescriptor, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 15, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiServerRsHttpServerRespondFileDownloadConstMeta,
        argValues: [that, sessionId, fileId, path, fileDescriptor],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiServerRsHttpServerRespondFileDownloadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_respond_file_download',
    argNames: ['that', 'sessionId', 'fileId', 'path', 'fileDescriptor'],
  );

  @override
  Stream<double> crateApiServerRsHttpServerRespondFileUpload({
    required RsHttpServer that,
    required String sessionId,
    required String fileId,
    String? path,
    int? fileDescriptor,
    required BigInt fileSize,
  }) {
    final sink = RustStreamSink<double>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
            sse_encode_StreamSink_f_64_Sse(sink, serializer);
            sse_encode_String(sessionId, serializer);
            sse_encode_String(fileId, serializer);
            sse_encode_opt_String(path, serializer);
            sse_encode_opt_box_autoadd_i_32(fileDescriptor, serializer);
            sse_encode_u_64(fileSize, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 16, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_AnyhowException,
          ),
          constMeta: kCrateApiServerRsHttpServerRespondFileUploadConstMeta,
          argValues: [that, sink, sessionId, fileId, path, fileDescriptor, fileSize],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiServerRsHttpServerRespondFileUploadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_respond_file_upload',
    argNames: ['that', 'sink', 'sessionId', 'fileId', 'path', 'fileDescriptor', 'fileSize'],
  );

  @override
  Future<void> crateApiServerRsHttpServerRespondPrepareDownload({required RsHttpServer that, required String sessionId, required bool accept}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
          sse_encode_String(sessionId, serializer);
          sse_encode_bool(accept, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 17, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiServerRsHttpServerRespondPrepareDownloadConstMeta,
        argValues: [that, sessionId, accept],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiServerRsHttpServerRespondPrepareDownloadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_respond_prepare_download',
    argNames: ['that', 'sessionId', 'accept'],
  );

  @override
  Future<void> crateApiServerRsHttpServerRespondPrepareUpload({required RsHttpServer that, List<String>? acceptedFileIds}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer(that, serializer);
          sse_encode_opt_list_String(acceptedFileIds, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 18, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiServerRsHttpServerRespondPrepareUploadConstMeta,
        argValues: [that, acceptedFileIds],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiServerRsHttpServerRespondPrepareUploadConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_respond_prepare_upload',
    argNames: ['that', 'acceptedFileIds'],
  );

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

  TaskConstMeta get kCrateApiServerRsHttpServerStopConstMeta => const TaskConstMeta(
    debugName: 'RsHttpServer_stop',
    argNames: ['that'],
  );

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

  TaskConstMeta get kCrateApiWebrtcRtcFileReceiverGetFileIdConstMeta => const TaskConstMeta(
    debugName: 'RtcFileReceiver_get_file_id',
    argNames: ['that'],
  );

  @override
  Stream<Uint8List> crateApiWebrtcRtcFileReceiverReceive({required RtcFileReceiver that}) {
    final sink = RustStreamSink<Uint8List>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver(that, serializer);
            sse_encode_StreamSink_list_prim_u_8_strict_Sse(sink, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 21, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_AnyhowException,
          ),
          constMeta: kCrateApiWebrtcRtcFileReceiverReceiveConstMeta,
          argValues: [that, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiWebrtcRtcFileReceiverReceiveConstMeta => const TaskConstMeta(
    debugName: 'RtcFileReceiver_receive',
    argNames: ['that', 'sink'],
  );

  @override
  Future<void> crateApiWebrtcRtcFileSenderSend({required RtcFileSender that, required List<int> data}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileSender(that, serializer);
          sse_encode_list_prim_u_8_loose(data, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 22, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcFileSenderSendConstMeta,
        argValues: [that, data],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcFileSenderSendConstMeta => const TaskConstMeta(
    debugName: 'RtcFileSender_send',
    argNames: ['that', 'data'],
  );

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

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerDeclineConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_decline',
    argNames: ['that'],
  );

  @override
  Stream<RTCFileError> crateApiWebrtcRtcReceiveControllerListenError({required RtcReceiveController that}) {
    final sink = RustStreamSink<RTCFileError>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController(that, serializer);
            sse_encode_StreamSink_rtc_file_error_Sse(sink, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 24, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: null,
          ),
          constMeta: kCrateApiWebrtcRtcReceiveControllerListenErrorConstMeta,
          argValues: [that, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerListenErrorConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_listen_error',
    argNames: ['that', 'sink'],
  );

  @override
  Future<List<FileDto>> crateApiWebrtcRtcReceiveControllerListenFiles({required RtcReceiveController that}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController(that, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 25, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_file_dto,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcReceiveControllerListenFilesConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerListenFilesConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_listen_files',
    argNames: ['that'],
  );

  @override
  Stream<RtcFileReceiver> crateApiWebrtcRtcReceiveControllerListenReceiving({required RtcReceiveController that}) {
    final sink = RustStreamSink<RtcFileReceiver>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController(that, serializer);
            sse_encode_StreamSink_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver_Sse(sink, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 26, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: null,
          ),
          constMeta: kCrateApiWebrtcRtcReceiveControllerListenReceivingConstMeta,
          argValues: [that, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerListenReceivingConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_listen_receiving',
    argNames: ['that', 'sink'],
  );

  @override
  Stream<RTCStatus> crateApiWebrtcRtcReceiveControllerListenStatus({required RtcReceiveController that}) {
    final sink = RustStreamSink<RTCStatus>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController(that, serializer);
            sse_encode_StreamSink_rtc_status_Sse(sink, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 27, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: null,
          ),
          constMeta: kCrateApiWebrtcRtcReceiveControllerListenStatusConstMeta,
          argValues: [that, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerListenStatusConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_listen_status',
    argNames: ['that', 'sink'],
  );

  @override
  Future<void> crateApiWebrtcRtcReceiveControllerSendFileStatus({required RtcReceiveController that, required RTCSendFileResponse status}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController(that, serializer);
          sse_encode_box_autoadd_rtc_send_file_response(status, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 28, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcReceiveControllerSendFileStatusConstMeta,
        argValues: [that, status],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerSendFileStatusConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_send_file_status',
    argNames: ['that', 'status'],
  );

  @override
  Future<void> crateApiWebrtcRtcReceiveControllerSendPin({required RtcReceiveController that, required String pin}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController(that, serializer);
          sse_encode_String(pin, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 29, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcReceiveControllerSendPinConstMeta,
        argValues: [that, pin],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerSendPinConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_send_pin',
    argNames: ['that', 'pin'],
  );

  @override
  Future<void> crateApiWebrtcRtcReceiveControllerSendSelection({required RtcReceiveController that, required Set<String> selection}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController(that, serializer);
          sse_encode_Set_String_None(selection, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 30, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcReceiveControllerSendSelectionConstMeta,
        argValues: [that, selection],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcReceiveControllerSendSelectionConstMeta => const TaskConstMeta(
    debugName: 'RtcReceiveController_send_selection',
    argNames: ['that', 'selection'],
  );

  @override
  Stream<RTCFileError> crateApiWebrtcRtcSendControllerListenError({required RtcSendController that}) {
    final sink = RustStreamSink<RTCFileError>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController(that, serializer);
            sse_encode_StreamSink_rtc_file_error_Sse(sink, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 31, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: null,
          ),
          constMeta: kCrateApiWebrtcRtcSendControllerListenErrorConstMeta,
          argValues: [that, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiWebrtcRtcSendControllerListenErrorConstMeta => const TaskConstMeta(
    debugName: 'RtcSendController_listen_error',
    argNames: ['that', 'sink'],
  );

  @override
  Future<Set<String>> crateApiWebrtcRtcSendControllerListenSelectedFiles({required RtcSendController that}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController(that, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 32, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_Set_String_None,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcSendControllerListenSelectedFilesConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcSendControllerListenSelectedFilesConstMeta => const TaskConstMeta(
    debugName: 'RtcSendController_listen_selected_files',
    argNames: ['that'],
  );

  @override
  Stream<RTCStatus> crateApiWebrtcRtcSendControllerListenStatus({required RtcSendController that}) {
    final sink = RustStreamSink<RTCStatus>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController(that, serializer);
            sse_encode_StreamSink_rtc_status_Sse(sink, serializer);
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 33, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: null,
          ),
          constMeta: kCrateApiWebrtcRtcSendControllerListenStatusConstMeta,
          argValues: [that, sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiWebrtcRtcSendControllerListenStatusConstMeta => const TaskConstMeta(
    debugName: 'RtcSendController_listen_status',
    argNames: ['that', 'sink'],
  );

  @override
  Future<RtcFileSender> crateApiWebrtcRtcSendControllerSendFile({required RtcSendController that, required String fileId}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController(that, serializer);
          sse_encode_String(fileId, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 34, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileSender,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcSendControllerSendFileConstMeta,
        argValues: [that, fileId],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcSendControllerSendFileConstMeta => const TaskConstMeta(
    debugName: 'RtcSendController_send_file',
    argNames: ['that', 'fileId'],
  );

  @override
  Future<void> crateApiWebrtcRtcSendControllerSendPin({required RtcSendController that, required String pin}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController(that, serializer);
          sse_encode_String(pin, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 35, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiWebrtcRtcSendControllerSendPinConstMeta,
        argValues: [that, pin],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiWebrtcRtcSendControllerSendPinConstMeta => const TaskConstMeta(
    debugName: 'RtcSendController_send_pin',
    argNames: ['that', 'pin'],
  );

  @override
  Stream<WsServerMessage> crateApiWebrtcConnect({
    required String uri,
    required ProposingClientInfo info,
    required String privateKey,
    required FutureOr<void> Function(LsSignalingConnection) onConnection,
  }) {
    final sink = RustStreamSink<WsServerMessage>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_StreamSink_ws_server_message_Sse(sink, serializer);
            sse_encode_String(uri, serializer);
            sse_encode_box_autoadd_proposing_client_info(info, serializer);
            sse_encode_String(privateKey, serializer);
            sse_encode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection_Output_unit_AnyhowException(
              onConnection,
              serializer,
            );
            pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 36, port: port_);
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: null,
          ),
          constMeta: kCrateApiWebrtcConnectConstMeta,
          argValues: [sink, uri, info, privateKey, onConnection],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiWebrtcConnectConstMeta => const TaskConstMeta(
    debugName: 'connect',
    argNames: ['sink', 'uri', 'info', 'privateKey', 'onConnection'],
  );

  @override
  RsCancellationToken crateApiHttpCreateCancellationToken() {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 37)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsCancellationToken,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiHttpCreateCancellationTokenConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHttpCreateCancellationTokenConstMeta => const TaskConstMeta(
    debugName: 'create_cancellation_token',
    argNames: [],
  );

  @override
  RsHttpClient crateApiHttpCreateClient({required String privateKey, required String cert, required LsHttpClientVersion version, int? timeoutMs}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(privateKey, serializer);
          sse_encode_String(cert, serializer);
          sse_encode_ls_http_client_version(version, serializer);
          sse_encode_opt_box_autoadd_u_32(timeoutMs, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 38)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpClient,
          decodeErrorData: sse_decode_rs_http_client_error,
        ),
        constMeta: kCrateApiHttpCreateClientConstMeta,
        argValues: [privateKey, cert, version, timeoutMs],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiHttpCreateClientConstMeta => const TaskConstMeta(
    debugName: 'create_client',
    argNames: ['privateKey', 'cert', 'version', 'timeoutMs'],
  );

  @override
  Future<(Dart2RustStreamSink, Dart2RustStreamReceiver)> crateApiStreamCreateStream() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 39, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_record_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_sink_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_receiver,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiStreamCreateStreamConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiStreamCreateStreamConstMeta => const TaskConstMeta(
    debugName: 'create_stream',
    argNames: [],
  );

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

  TaskConstMeta get kCrateApiLoggingEnableDebugLoggingConstMeta => const TaskConstMeta(
    debugName: 'enable_debug_logging',
    argNames: [],
  );

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

  TaskConstMeta get kCrateApiCryptoGenerateKeyPairConstMeta => const TaskConstMeta(
    debugName: 'generate_key_pair',
    argNames: [],
  );

  @override
  Future<RsHttpServer> crateApiServerStartServer({
    required int port,
    TlsConfig? tls,
    required String alias,
    required String version,
    String? deviceModel,
    DeviceType? deviceType,
    required String fingerprint,
    String? pin,
    WebSendParams? webSend,
    String? showToken,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_16(port, serializer);
          sse_encode_opt_box_autoadd_tls_config(tls, serializer);
          sse_encode_String(alias, serializer);
          sse_encode_String(version, serializer);
          sse_encode_opt_String(deviceModel, serializer);
          sse_encode_opt_box_autoadd_device_type(deviceType, serializer);
          sse_encode_String(fingerprint, serializer);
          sse_encode_opt_String(pin, serializer);
          sse_encode_opt_box_autoadd_web_send_params(webSend, serializer);
          sse_encode_opt_String(showToken, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 42, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiServerStartServerConstMeta,
        argValues: [port, tls, alias, version, deviceModel, deviceType, fingerprint, pin, webSend, showToken],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiServerStartServerConstMeta => const TaskConstMeta(
    debugName: 'start_server',
    argNames: ['port', 'tls', 'alias', 'version', 'deviceModel', 'deviceType', 'fingerprint', 'pin', 'webSend', 'showToken'],
  );

  @override
  Future<void> crateApiCryptoVerifyCert({required String cert, required String publicKey}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(cert, serializer);
          sse_encode_String(publicKey, serializer);
          pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 43, port: port_);
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiCryptoVerifyCertConstMeta,
        argValues: [cert, publicKey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiCryptoVerifyCertConstMeta => const TaskConstMeta(
    debugName: 'verify_cert',
    argNames: ['cert', 'publicKey'],
  );

  Future<void> Function(int, dynamic)
  encode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection_Output_unit_AnyhowException(
    FutureOr<void> Function(LsSignalingConnection) raw,
  ) {
    return (callId, rawArg0) async {
      final arg0 = dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection(rawArg0);

      Box<void>? rawOutput;
      Box<AnyhowException>? rawError;
      try {
        rawOutput = Box(await raw(arg0));
      } catch (e, s) {
        rawError = Box(AnyhowException('$e\n\n$s'));
      }

      final serializer = SseSerializer(generalizedFrbRustBinding);
      assert((rawOutput != null) ^ (rawError != null));
      if (rawOutput != null) {
        serializer.buffer.putUint8(0);
        sse_encode_unit(rawOutput.value, serializer);
      } else {
        serializer.buffer.putUint8(1);
        sse_encode_AnyhowException(rawError!.value, serializer);
      }
      final output = serializer.intoRaw();

      generalizedFrbRustBinding.dartFnDeliverOutput(callId: callId, ptr: output.ptr, rustVecLen: output.rustVecLen, dataLen: output.dataLen);
    };
  }

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Dart2RustStreamReceiver =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Dart2RustStreamReceiver =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Dart2RustStreamSink =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Dart2RustStreamSink =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_LsSignalingConnection =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_LsSignalingConnection =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcFileReceiver =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcFileReceiver =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcFileSender =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileSender;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcFileSender =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileSender;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcReceiveController =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcReceiveController =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCReceiveController;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RtcSendController =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RtcSendController =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCSendController;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RsCancellationToken =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsCancellationToken;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RsCancellationToken =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsCancellationToken;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RsHttpClient =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpClient;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RsHttpClient =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpClient;

  RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_RsHttpServer =>
      wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer;

  RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_RsHttpServer =>
      wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRsHttpServer;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  FutureOr<void> Function(LsSignalingConnection)
  dco_decode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection_Output_unit_AnyhowException(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError('');
  }

  @protected
  Object dco_decode_DartOpaque(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return decodeDartOpaque(raw, generalizedFrbRustBinding);
  }

  @protected
  Map<String, String> dco_decode_Map_String_String_None(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return Map.fromEntries(dco_decode_list_record_string_string(raw).map((e) => MapEntry(e.$1, e.$2)));
  }

  @protected
  Map<String, FileDto> dco_decode_Map_String_file_dto_None(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return Map.fromEntries(dco_decode_list_record_string_file_dto(raw).map((e) => MapEntry(e.$1, e.$2)));
  }

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

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

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

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

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

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

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

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

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

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

  @protected
  Set<String> dco_decode_Set_String_None(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return Set.from(dco_decode_list_String(raw));
  }

  @protected
  RustStreamSink<RtcFileReceiver> dco_decode_StreamSink_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver_Sse(
    dynamic raw,
  ) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

  @protected
  RustStreamSink<double> dco_decode_StreamSink_f_64_Sse(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

  @protected
  RustStreamSink<Uint8List> dco_decode_StreamSink_list_prim_u_8_strict_Sse(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

  @protected
  RustStreamSink<RsServerEvent> dco_decode_StreamSink_rs_server_event_Sse(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

  @protected
  RustStreamSink<RTCFileError> dco_decode_StreamSink_rtc_file_error_Sse(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

  @protected
  RustStreamSink<RTCStatus> dco_decode_StreamSink_rtc_status_Sse(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

  @protected
  RustStreamSink<WsServerMessage> dco_decode_StreamSink_ws_server_message_Sse(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    throw UnimplementedError();
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @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
  WebSendParams dco_decode_box_autoadd_web_send_params(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return dco_decode_web_send_params(raw);
  }

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

  @protected
  ClientInfo dco_decode_client_info(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 6) throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
    return ClientInfo(
      id: dco_decode_Uuid(arr[0]),
      alias: dco_decode_String(arr[1]),
      version: dco_decode_String(arr[2]),
      deviceModel: dco_decode_opt_String(arr[3]),
      deviceType: dco_decode_opt_box_autoadd_device_type(arr[4]),
      token: dco_decode_String(arr[5]),
    );
  }

  @protected
  ClientInfoWithoutId dco_decode_client_info_without_id(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 ClientInfoWithoutId(
      alias: dco_decode_String(arr[0]),
      version: dco_decode_String(arr[1]),
      deviceModel: dco_decode_opt_String(arr[2]),
      deviceType: dco_decode_opt_box_autoadd_device_type(arr[3]),
      token: dco_decode_String(arr[4]),
    );
  }

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

  @protected
  ExpectingPublicKey dco_decode_expecting_public_key(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 ExpectingPublicKey(
      publicKey: dco_decode_String(arr[0]),
      kind: dco_decode_String(arr[1]),
    );
  }

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

  @protected
  FileDto dco_decode_file_dto(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 7) throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
    return FileDto(
      id: dco_decode_String(arr[0]),
      fileName: dco_decode_String(arr[1]),
      size: dco_decode_u_64(arr[2]),
      fileType: dco_decode_String(arr[3]),
      sha256: dco_decode_opt_String(arr[4]),
      preview: dco_decode_opt_String(arr[5]),
      metadata: dco_decode_opt_box_autoadd_file_metadata(arr[6]),
    );
  }

  @protected
  FileMetadata dco_decode_file_metadata(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 FileMetadata(
      modified: dco_decode_opt_String(arr[0]),
      accessed: dco_decode_opt_String(arr[1]),
    );
  }

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

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

  @protected
  KeyPair dco_decode_key_pair(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 KeyPair(
      privateKey: dco_decode_String(arr[0]),
      publicKey: dco_decode_String(arr[1]),
    );
  }

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

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

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

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

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

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

  @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
  Dart2RustStreamReceiver?
  dco_decode_opt_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null
        ? null
        : dco_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(raw);
  }

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

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

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

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

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

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

  @protected
  TlsConfig? dco_decode_opt_box_autoadd_tls_config(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_tls_config(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
  WebSendParams? dco_decode_opt_box_autoadd_web_send_params(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_box_autoadd_web_send_params(raw);
  }

  @protected
  List<String>? dco_decode_opt_list_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw == null ? null : dco_decode_list_String(raw);
  }

  @protected
  PinConfig dco_decode_pin_config(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 PinConfig(
      pin: dco_decode_String(arr[0]),
      maxTries: dco_decode_u_8(arr[1]),
    );
  }

  @protected
  PrepareUploadRequestDto dco_decode_prepare_upload_request_dto(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 PrepareUploadRequestDto(
      info: dco_decode_register_dto(arr[0]),
      files: dco_decode_Map_String_file_dto_None(arr[1]),
    );
  }

  @protected
  PrepareUploadResponseDto dco_decode_prepare_upload_response_dto(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 PrepareUploadResponseDto(
      sessionId: dco_decode_String(arr[0]),
      files: dco_decode_Map_String_String_None(arr[1]),
    );
  }

  @protected
  PrepareUploadResult dco_decode_prepare_upload_result(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 PrepareUploadResult(
      statusCode: dco_decode_u_16(arr[0]),
      response: dco_decode_opt_box_autoadd_prepare_upload_response_dto(arr[1]),
    );
  }

  @protected
  ProposingClientInfo dco_decode_proposing_client_info(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 ProposingClientInfo(
      alias: dco_decode_String(arr[0]),
      version: dco_decode_String(arr[1]),
      deviceModel: dco_decode_opt_String(arr[2]),
      deviceType: dco_decode_opt_box_autoadd_device_type(arr[3]),
    );
  }

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

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

  @protected
  (Dart2RustStreamSink, Dart2RustStreamReceiver)
  dco_decode_record_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_sink_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_receiver(
    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_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink(arr[0]),
      dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(arr[1]),
    );
  }

  @protected
  (String, FileDto) dco_decode_record_string_file_dto(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_file_dto(arr[1]),
    );
  }

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

  @protected
  RegisterDto dco_decode_register_dto(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 8) throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
    return RegisterDto(
      alias: dco_decode_String(arr[0]),
      version: dco_decode_String(arr[1]),
      deviceModel: dco_decode_opt_String(arr[2]),
      deviceType: dco_decode_opt_box_autoadd_device_type(arr[3]),
      token: dco_decode_String(arr[4]),
      port: dco_decode_u_16(arr[5]),
      protocol: dco_decode_protocol_type(arr[6]),
      hasWebInterface: dco_decode_bool(arr[7]),
    );
  }

  @protected
  RegisterDtoV2 dco_decode_register_dto_v_2(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 8) throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
    return RegisterDtoV2(
      alias: dco_decode_String(arr[0]),
      version: dco_decode_String(arr[1]),
      deviceModel: dco_decode_opt_String(arr[2]),
      deviceType: dco_decode_opt_box_autoadd_device_type(arr[3]),
      fingerprint: dco_decode_String(arr[4]),
      port: dco_decode_u_16(arr[5]),
      protocol: dco_decode_protocol_type_v_2(arr[6]),
      download: dco_decode_bool(arr[7]),
    );
  }

  @protected
  RegisterResponseDto dco_decode_register_response_dto(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 6) throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
    return RegisterResponseDto(
      alias: dco_decode_String(arr[0]),
      version: dco_decode_String(arr[1]),
      deviceModel: dco_decode_opt_String(arr[2]),
      deviceType: dco_decode_opt_box_autoadd_device_type(arr[3]),
      token: dco_decode_String(arr[4]),
      hasWebInterface: dco_decode_bool(arr[5]),
    );
  }

  @protected
  ResultWithPublicKeyRegisterResponseDto dco_decode_result_with_public_key_register_response_dto(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 ResultWithPublicKeyRegisterResponseDto(
      publicKey: dco_decode_opt_String(arr[0]),
      body: dco_decode_register_response_dto(arr[1]),
    );
  }

  @protected
  RsHttpClientError dco_decode_rs_http_client_error(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return RsHttpClientError_StatusCode(
          status: dco_decode_u_16(raw[1]),
          message: dco_decode_opt_String(raw[2]),
        );
      case 1:
        return RsHttpClientError_Reqwest(
          dco_decode_String(raw[1]),
        );
      case 2:
        return RsHttpClientError_Json(
          dco_decode_String(raw[1]),
        );
      case 3:
        return RsHttpClientError_Io(
          dco_decode_String(raw[1]),
        );
      case 4:
        return RsHttpClientError_Other(
          dco_decode_String(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  RsServerEvent dco_decode_rs_server_event(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return RsServerEvent_Register(
          ip: dco_decode_String(raw[1]),
          info: dco_decode_box_autoadd_register_dto_v_2(raw[2]),
        );
      case 1:
        return RsServerEvent_PrepareUpload(
          sessionId: dco_decode_String(raw[1]),
          ip: dco_decode_String(raw[2]),
          info: dco_decode_box_autoadd_register_dto_v_2(raw[3]),
          certFingerprint: dco_decode_opt_String(raw[4]),
          files: dco_decode_Map_String_file_dto_None(raw[5]),
        );
      case 2:
        return RsServerEvent_FileUpload(
          sessionId: dco_decode_String(raw[1]),
          fileId: dco_decode_String(raw[2]),
          file: dco_decode_box_autoadd_file_dto(raw[3]),
        );
      case 3:
        return RsServerEvent_SessionEnd(
          sessionId: dco_decode_String(raw[1]),
          reason: dco_decode_session_end_reason_v_2(raw[2]),
        );
      case 4:
        return RsServerEvent_PrepareUploadAborted(
          sessionId: dco_decode_String(raw[1]),
        );
      case 5:
        return RsServerEvent_CancelReceived(
          ip: dco_decode_String(raw[1]),
          sessionId: dco_decode_String(raw[2]),
        );
      case 6:
        return RsServerEvent_WebPrepareDownload(
          ip: dco_decode_String(raw[1]),
          sessionId: dco_decode_String(raw[2]),
          userAgent: dco_decode_opt_String(raw[3]),
        );
      case 7:
        return RsServerEvent_WebFileDownload(
          sessionId: dco_decode_String(raw[1]),
          fileId: dco_decode_String(raw[2]),
          file: dco_decode_box_autoadd_file_dto(raw[3]),
        );
      case 8:
        return RsServerEvent_Show(
          args: dco_decode_list_String(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  RTCFileError dco_decode_rtc_file_error(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 RTCFileError(
      fileId: dco_decode_String(arr[0]),
      error: dco_decode_String(arr[1]),
    );
  }

  @protected
  RTCSendFileResponse dco_decode_rtc_send_file_response(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 RTCSendFileResponse(
      id: dco_decode_String(arr[0]),
      success: dco_decode_bool(arr[1]),
      error: dco_decode_opt_String(arr[2]),
    );
  }

  @protected
  RTCStatus dco_decode_rtc_status(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return RTCStatus_SdpExchanged();
      case 1:
        return RTCStatus_Connected();
      case 2:
        return RTCStatus_PinRequired();
      case 3:
        return RTCStatus_TooManyAttempts();
      case 4:
        return RTCStatus_Declined();
      case 5:
        return RTCStatus_Sending();
      case 6:
        return RTCStatus_Finished();
      case 7:
        return RTCStatus_Error(
          dco_decode_String(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

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

  @protected
  TlsConfig dco_decode_tls_config(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 TlsConfig(
      cert: dco_decode_String(arr[0]),
      privateKey: dco_decode_String(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
  WebSendI18n dco_decode_web_send_i_18_n(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    final arr = raw as List<dynamic>;
    if (arr.length != 8) throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
    return WebSendI18n(
      waiting: dco_decode_String(arr[0]),
      enterPin: dco_decode_String(arr[1]),
      invalidPin: dco_decode_String(arr[2]),
      tooManyAttempts: dco_decode_String(arr[3]),
      rejected: dco_decode_String(arr[4]),
      files: dco_decode_String(arr[5]),
      fileName: dco_decode_String(arr[6]),
      size: dco_decode_String(arr[7]),
    );
  }

  @protected
  WebSendParams dco_decode_web_send_params(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 WebSendParams(
      files: dco_decode_Map_String_file_dto_None(arr[0]),
      pin: dco_decode_opt_String(arr[1]),
      i18N: dco_decode_web_send_i_18_n(arr[2]),
    );
  }

  @protected
  WsServerMessage dco_decode_ws_server_message(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return WsServerMessage_Hello(
          client: dco_decode_box_autoadd_client_info(raw[1]),
          peers: dco_decode_list_client_info(raw[2]),
        );
      case 1:
        return WsServerMessage_Join(
          peer: dco_decode_box_autoadd_client_info(raw[1]),
        );
      case 2:
        return WsServerMessage_Update(
          peer: dco_decode_box_autoadd_client_info(raw[1]),
        );
      case 3:
        return WsServerMessage_Left(
          peerId: dco_decode_Uuid(raw[1]),
        );
      case 4:
        return WsServerMessage_Offer(
          dco_decode_box_autoadd_ws_server_sdp_message(raw[1]),
        );
      case 5:
        return WsServerMessage_Answer(
          dco_decode_box_autoadd_ws_server_sdp_message(raw[1]),
        );
      case 6:
        return WsServerMessage_Error(
          code: dco_decode_u_16(raw[1]),
        );
      default:
        throw Exception('unreachable');
    }
  }

  @protected
  WsServerSdpMessage dco_decode_ws_server_sdp_message(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 WsServerSdpMessage(
      peer: dco_decode_client_info(arr[0]),
      sessionId: dco_decode_String(arr[1]),
      sdp: dco_decode_String(arr[2]),
    );
  }

  @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
  Dart2RustStreamReceiver sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return Dart2RustStreamReceiverImpl.frbInternalSseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  Object sse_decode_DartOpaque(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_isize(deserializer);
    return decodeDartOpaque(inner, generalizedFrbRustBinding);
  }

  @protected
  Map<String, String> sse_decode_Map_String_String_None(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_list_record_string_string(deserializer);
    return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2)));
  }

  @protected
  Map<String, FileDto> sse_decode_Map_String_file_dto_None(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_list_record_string_file_dto(deserializer);
    return Map.fromEntries(inner.map((e) => MapEntry(e.$1, e.$2)));
  }

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

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

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

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

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

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

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

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

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

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

  @protected
  Set<String> sse_decode_Set_String_None(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_list_String(deserializer);
    return Set.from(inner);
  }

  @protected
  RustStreamSink<RtcFileReceiver> sse_decode_StreamSink_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver_Sse(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

  @protected
  RustStreamSink<double> sse_decode_StreamSink_f_64_Sse(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

  @protected
  RustStreamSink<Uint8List> sse_decode_StreamSink_list_prim_u_8_strict_Sse(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

  @protected
  RustStreamSink<RsServerEvent> sse_decode_StreamSink_rs_server_event_Sse(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

  @protected
  RustStreamSink<RTCFileError> sse_decode_StreamSink_rtc_file_error_Sse(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

  @protected
  RustStreamSink<RTCStatus> sse_decode_StreamSink_rtc_status_Sse(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

  @protected
  RustStreamSink<WsServerMessage> sse_decode_StreamSink_ws_server_message_Sse(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    throw UnimplementedError('Unreachable ()');
  }

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

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

  @protected
  Dart2RustStreamReceiver sse_decode_box_autoadd_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(deserializer));
  }

  @protected
  ClientInfo sse_decode_box_autoadd_client_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_client_info(deserializer));
  }

  @protected
  ClientInfoWithoutId sse_decode_box_autoadd_client_info_without_id(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_client_info_without_id(deserializer));
  }

  @protected
  DeviceType sse_decode_box_autoadd_device_type(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_device_type(deserializer));
  }

  @protected
  ExpectingPublicKey sse_decode_box_autoadd_expecting_public_key(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_expecting_public_key(deserializer));
  }

  @protected
  FileDto sse_decode_box_autoadd_file_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_file_dto(deserializer));
  }

  @protected
  FileMetadata sse_decode_box_autoadd_file_metadata(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_file_metadata(deserializer));
  }

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

  @protected
  PinConfig sse_decode_box_autoadd_pin_config(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_pin_config(deserializer));
  }

  @protected
  PrepareUploadRequestDto sse_decode_box_autoadd_prepare_upload_request_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_prepare_upload_request_dto(deserializer));
  }

  @protected
  PrepareUploadResponseDto sse_decode_box_autoadd_prepare_upload_response_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_prepare_upload_response_dto(deserializer));
  }

  @protected
  ProposingClientInfo sse_decode_box_autoadd_proposing_client_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_proposing_client_info(deserializer));
  }

  @protected
  RegisterDto sse_decode_box_autoadd_register_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_register_dto(deserializer));
  }

  @protected
  RegisterDtoV2 sse_decode_box_autoadd_register_dto_v_2(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_register_dto_v_2(deserializer));
  }

  @protected
  RTCSendFileResponse sse_decode_box_autoadd_rtc_send_file_response(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_rtc_send_file_response(deserializer));
  }

  @protected
  TlsConfig sse_decode_box_autoadd_tls_config(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_tls_config(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
  WebSendParams sse_decode_box_autoadd_web_send_params(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_web_send_params(deserializer));
  }

  @protected
  WsServerSdpMessage sse_decode_box_autoadd_ws_server_sdp_message(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_ws_server_sdp_message(deserializer));
  }

  @protected
  ClientInfo sse_decode_client_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_Uuid(deserializer);
    var var_alias = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_deviceModel = sse_decode_opt_String(deserializer);
    var var_deviceType = sse_decode_opt_box_autoadd_device_type(deserializer);
    var var_token = sse_decode_String(deserializer);
    return ClientInfo(id: var_id, alias: var_alias, version: var_version, deviceModel: var_deviceModel, deviceType: var_deviceType, token: var_token);
  }

  @protected
  ClientInfoWithoutId sse_decode_client_info_without_id(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_alias = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_deviceModel = sse_decode_opt_String(deserializer);
    var var_deviceType = sse_decode_opt_box_autoadd_device_type(deserializer);
    var var_token = sse_decode_String(deserializer);
    return ClientInfoWithoutId(alias: var_alias, version: var_version, deviceModel: var_deviceModel, deviceType: var_deviceType, token: var_token);
  }

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

  @protected
  ExpectingPublicKey sse_decode_expecting_public_key(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_publicKey = sse_decode_String(deserializer);
    var var_kind = sse_decode_String(deserializer);
    return ExpectingPublicKey(publicKey: var_publicKey, kind: var_kind);
  }

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

  @protected
  FileDto sse_decode_file_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_String(deserializer);
    var var_fileName = sse_decode_String(deserializer);
    var var_size = sse_decode_u_64(deserializer);
    var var_fileType = sse_decode_String(deserializer);
    var var_sha256 = sse_decode_opt_String(deserializer);
    var var_preview = sse_decode_opt_String(deserializer);
    var var_metadata = sse_decode_opt_box_autoadd_file_metadata(deserializer);
    return FileDto(
      id: var_id,
      fileName: var_fileName,
      size: var_size,
      fileType: var_fileType,
      sha256: var_sha256,
      preview: var_preview,
      metadata: var_metadata,
    );
  }

  @protected
  FileMetadata sse_decode_file_metadata(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_modified = sse_decode_opt_String(deserializer);
    var var_accessed = sse_decode_opt_String(deserializer);
    return FileMetadata(modified: var_modified, accessed: var_accessed);
  }

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

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

  @protected
  KeyPair sse_decode_key_pair(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_privateKey = sse_decode_String(deserializer);
    var var_publicKey = sse_decode_String(deserializer);
    return KeyPair(privateKey: var_privateKey, publicKey: var_publicKey);
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if (sse_decode_bool(deserializer)) {
      return (sse_decode_box_autoadd_tls_config(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
  WebSendParams? sse_decode_opt_box_autoadd_web_send_params(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs

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

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

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

  @protected
  PinConfig sse_decode_pin_config(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_pin = sse_decode_String(deserializer);
    var var_maxTries = sse_decode_u_8(deserializer);
    return PinConfig(pin: var_pin, maxTries: var_maxTries);
  }

  @protected
  PrepareUploadRequestDto sse_decode_prepare_upload_request_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_info = sse_decode_register_dto(deserializer);
    var var_files = sse_decode_Map_String_file_dto_None(deserializer);
    return PrepareUploadRequestDto(info: var_info, files: var_files);
  }

  @protected
  PrepareUploadResponseDto sse_decode_prepare_upload_response_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_sessionId = sse_decode_String(deserializer);
    var var_files = sse_decode_Map_String_String_None(deserializer);
    return PrepareUploadResponseDto(sessionId: var_sessionId, files: var_files);
  }

  @protected
  PrepareUploadResult sse_decode_prepare_upload_result(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_statusCode = sse_decode_u_16(deserializer);
    var var_response = sse_decode_opt_box_autoadd_prepare_upload_response_dto(deserializer);
    return PrepareUploadResult(statusCode: var_statusCode, response: var_response);
  }

  @protected
  ProposingClientInfo sse_decode_proposing_client_info(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_alias = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_deviceModel = sse_decode_opt_String(deserializer);
    var var_deviceType = sse_decode_opt_box_autoadd_device_type(deserializer);
    return ProposingClientInfo(alias: var_alias, version: var_version, deviceModel: var_deviceModel, deviceType: var_deviceType);
  }

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

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

  @protected
  (Dart2RustStreamSink, Dart2RustStreamReceiver)
  sse_decode_record_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_sink_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_receiver(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_field0 = sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink(deserializer);
    var var_field1 = sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(deserializer);
    return (var_field0, var_field1);
  }

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

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

  @protected
  RegisterDto sse_decode_register_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_alias = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_deviceModel = sse_decode_opt_String(deserializer);
    var var_deviceType = sse_decode_opt_box_autoadd_device_type(deserializer);
    var var_token = sse_decode_String(deserializer);
    var var_port = sse_decode_u_16(deserializer);
    var var_protocol = sse_decode_protocol_type(deserializer);
    var var_hasWebInterface = sse_decode_bool(deserializer);
    return RegisterDto(
      alias: var_alias,
      version: var_version,
      deviceModel: var_deviceModel,
      deviceType: var_deviceType,
      token: var_token,
      port: var_port,
      protocol: var_protocol,
      hasWebInterface: var_hasWebInterface,
    );
  }

  @protected
  RegisterDtoV2 sse_decode_register_dto_v_2(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_alias = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_deviceModel = sse_decode_opt_String(deserializer);
    var var_deviceType = sse_decode_opt_box_autoadd_device_type(deserializer);
    var var_fingerprint = sse_decode_String(deserializer);
    var var_port = sse_decode_u_16(deserializer);
    var var_protocol = sse_decode_protocol_type_v_2(deserializer);
    var var_download = sse_decode_bool(deserializer);
    return RegisterDtoV2(
      alias: var_alias,
      version: var_version,
      deviceModel: var_deviceModel,
      deviceType: var_deviceType,
      fingerprint: var_fingerprint,
      port: var_port,
      protocol: var_protocol,
      download: var_download,
    );
  }

  @protected
  RegisterResponseDto sse_decode_register_response_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_alias = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_deviceModel = sse_decode_opt_String(deserializer);
    var var_deviceType = sse_decode_opt_box_autoadd_device_type(deserializer);
    var var_token = sse_decode_String(deserializer);
    var var_hasWebInterface = sse_decode_bool(deserializer);
    return RegisterResponseDto(
      alias: var_alias,
      version: var_version,
      deviceModel: var_deviceModel,
      deviceType: var_deviceType,
      token: var_token,
      hasWebInterface: var_hasWebInterface,
    );
  }

  @protected
  ResultWithPublicKeyRegisterResponseDto sse_decode_result_with_public_key_register_response_dto(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_publicKey = sse_decode_opt_String(deserializer);
    var var_body = sse_decode_register_response_dto(deserializer);
    return ResultWithPublicKeyRegisterResponseDto(publicKey: var_publicKey, body: var_body);
  }

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

    var tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        var var_status = sse_decode_u_16(deserializer);
        var var_message = sse_decode_opt_String(deserializer);
        return RsHttpClientError_StatusCode(status: var_status, message: var_message);
      case 1:
        var var_field0 = sse_decode_String(deserializer);
        return RsHttpClientError_Reqwest(var_field0);
      case 2:
        var var_field0 = sse_decode_String(deserializer);
        return RsHttpClientError_Json(var_field0);
      case 3:
        var var_field0 = sse_decode_String(deserializer);
        return RsHttpClientError_Io(var_field0);
      case 4:
        var var_field0 = sse_decode_String(deserializer);
        return RsHttpClientError_Other(var_field0);
      default:
        throw UnimplementedError('');
    }
  }

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

    var tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        var var_ip = sse_decode_String(deserializer);
        var var_info = sse_decode_box_autoadd_register_dto_v_2(deserializer);
        return RsServerEvent_Register(ip: var_ip, info: var_info);
      case 1:
        var var_sessionId = sse_decode_String(deserializer);
        var var_ip = sse_decode_String(deserializer);
        var var_info = sse_decode_box_autoadd_register_dto_v_2(deserializer);
        var var_certFingerprint = sse_decode_opt_String(deserializer);
        var var_files = sse_decode_Map_String_file_dto_None(deserializer);
        return RsServerEvent_PrepareUpload(
          sessionId: var_sessionId,
          ip: var_ip,
          info: var_info,
          certFingerprint: var_certFingerprint,
          files: var_files,
        );
      case 2:
        var var_sessionId = sse_decode_String(deserializer);
        var var_fileId = sse_decode_String(deserializer);
        var var_file = sse_decode_box_autoadd_file_dto(deserializer);
        return RsServerEvent_FileUpload(sessionId: var_sessionId, fileId: var_fileId, file: var_file);
      case 3:
        var var_sessionId = sse_decode_String(deserializer);
        var var_reason = sse_decode_session_end_reason_v_2(deserializer);
        return RsServerEvent_SessionEnd(sessionId: var_sessionId, reason: var_reason);
      case 4:
        var var_sessionId = sse_decode_String(deserializer);
        return RsServerEvent_PrepareUploadAborted(sessionId: var_sessionId);
      case 5:
        var var_ip = sse_decode_String(deserializer);
        var var_sessionId = sse_decode_String(deserializer);
        return RsServerEvent_CancelReceived(ip: var_ip, sessionId: var_sessionId);
      case 6:
        var var_ip = sse_decode_String(deserializer);
        var var_sessionId = sse_decode_String(deserializer);
        var var_userAgent = sse_decode_opt_String(deserializer);
        return RsServerEvent_WebPrepareDownload(ip: var_ip, sessionId: var_sessionId, userAgent: var_userAgent);
      case 7:
        var var_sessionId = sse_decode_String(deserializer);
        var var_fileId = sse_decode_String(deserializer);
        var var_file = sse_decode_box_autoadd_file_dto(deserializer);
        return RsServerEvent_WebFileDownload(sessionId: var_sessionId, fileId: var_fileId, file: var_file);
      case 8:
        var var_args = sse_decode_list_String(deserializer);
        return RsServerEvent_Show(args: var_args);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  RTCFileError sse_decode_rtc_file_error(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_fileId = sse_decode_String(deserializer);
    var var_error = sse_decode_String(deserializer);
    return RTCFileError(fileId: var_fileId, error: var_error);
  }

  @protected
  RTCSendFileResponse sse_decode_rtc_send_file_response(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_String(deserializer);
    var var_success = sse_decode_bool(deserializer);
    var var_error = sse_decode_opt_String(deserializer);
    return RTCSendFileResponse(id: var_id, success: var_success, error: var_error);
  }

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

    var tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        return RTCStatus_SdpExchanged();
      case 1:
        return RTCStatus_Connected();
      case 2:
        return RTCStatus_PinRequired();
      case 3:
        return RTCStatus_TooManyAttempts();
      case 4:
        return RTCStatus_Declined();
      case 5:
        return RTCStatus_Sending();
      case 6:
        return RTCStatus_Finished();
      case 7:
        var var_field0 = sse_decode_String(deserializer);
        return RTCStatus_Error(var_field0);
      default:
        throw UnimplementedError('');
    }
  }

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

  @protected
  TlsConfig sse_decode_tls_config(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_cert = sse_decode_String(deserializer);
    var var_privateKey = sse_decode_String(deserializer);
    return TlsConfig(cert: var_cert, privateKey: var_privateKey);
  }

  @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
  WebSendI18n sse_decode_web_send_i_18_n(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_waiting = sse_decode_String(deserializer);
    var var_enterPin = sse_decode_String(deserializer);
    var var_invalidPin = sse_decode_String(deserializer);
    var var_tooManyAttempts = sse_decode_String(deserializer);
    var var_rejected = sse_decode_String(deserializer);
    var var_files = sse_decode_String(deserializer);
    var var_fileName = sse_decode_String(deserializer);
    var var_size = sse_decode_String(deserializer);
    return WebSendI18n(
      waiting: var_waiting,
      enterPin: var_enterPin,
      invalidPin: var_invalidPin,
      tooManyAttempts: var_tooManyAttempts,
      rejected: var_rejected,
      files: var_files,
      fileName: var_fileName,
      size: var_size,
    );
  }

  @protected
  WebSendParams sse_decode_web_send_params(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_files = sse_decode_Map_String_file_dto_None(deserializer);
    var var_pin = sse_decode_opt_String(deserializer);
    var var_i18N = sse_decode_web_send_i_18_n(deserializer);
    return WebSendParams(files: var_files, pin: var_pin, i18N: var_i18N);
  }

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

    var tag_ = sse_decode_i_32(deserializer);
    switch (tag_) {
      case 0:
        var var_client = sse_decode_box_autoadd_client_info(deserializer);
        var var_peers = sse_decode_list_client_info(deserializer);
        return WsServerMessage_Hello(client: var_client, peers: var_peers);
      case 1:
        var var_peer = sse_decode_box_autoadd_client_info(deserializer);
        return WsServerMessage_Join(peer: var_peer);
      case 2:
        var var_peer = sse_decode_box_autoadd_client_info(deserializer);
        return WsServerMessage_Update(peer: var_peer);
      case 3:
        var var_peerId = sse_decode_Uuid(deserializer);
        return WsServerMessage_Left(peerId: var_peerId);
      case 4:
        var var_field0 = sse_decode_box_autoadd_ws_server_sdp_message(deserializer);
        return WsServerMessage_Offer(var_field0);
      case 5:
        var var_field0 = sse_decode_box_autoadd_ws_server_sdp_message(deserializer);
        return WsServerMessage_Answer(var_field0);
      case 6:
        var var_code = sse_decode_u_16(deserializer);
        return WsServerMessage_Error(code: var_code);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  WsServerSdpMessage sse_decode_ws_server_sdp_message(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_peer = sse_decode_client_info(deserializer);
    var var_sessionId = sse_decode_String(deserializer);
    var var_sdp = sse_decode_String(deserializer);
    return WsServerSdpMessage(peer: var_peer, sessionId: var_sessionId, sdp: var_sdp);
  }

  @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_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(
    Dart2RustStreamReceiver self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_usize((self as Dart2RustStreamReceiverImpl).frbInternalSseEncode(move: true), serializer);
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  void
  sse_encode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection_Output_unit_AnyhowException(
    FutureOr<void> Function(LsSignalingConnection) self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_DartOpaque(
      encode_DartFn_Inputs_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLsSignalingConnection_Output_unit_AnyhowException(
        self,
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_DartOpaque(Object self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_isize(
      PlatformPointerUtil.ptrToPlatformInt64(encodeDartOpaque(self, portManager.dartHandlerPort, generalizedFrbRustBinding)),
      serializer,
    );
  }

  @protected
  void sse_encode_Map_String_String_None(Map<String, String> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_record_string_string(self.entries.map((e) => (e.key, e.value)).toList(), serializer);
  }

  @protected
  void sse_encode_Map_String_file_dto_None(Map<String, FileDto> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_record_string_file_dto(self.entries.map((e) => (e.key, e.value)).toList(), serializer);
  }

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

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

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

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

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

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

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

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

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

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

  @protected
  void sse_encode_Set_String_None(Set<String> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_String(self.toList(), serializer);
  }

  @protected
  void sse_encode_StreamSink_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver_Sse(
    RustStreamSink<RtcFileReceiver> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerRTCFileReceiver,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_StreamSink_f_64_Sse(RustStreamSink<double> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_f_64,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_StreamSink_list_prim_u_8_strict_Sse(RustStreamSink<Uint8List> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_prim_u_8_strict,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_StreamSink_rs_server_event_Sse(RustStreamSink<RsServerEvent> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_rs_server_event,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_StreamSink_rtc_file_error_Sse(RustStreamSink<RTCFileError> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_rtc_file_error,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_StreamSink_rtc_status_Sse(RustStreamSink<RTCStatus> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_rtc_status,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      serializer,
    );
  }

  @protected
  void sse_encode_StreamSink_ws_server_message_Sse(RustStreamSink<WsServerMessage> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_ws_server_message,
          decodeErrorData: sse_decode_AnyhowException,
        ),
      ),
      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_Uuid(UuidValue self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_list_prim_u_8_strict(self.toBytes(), 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_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(
    Dart2RustStreamReceiver self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(self, serializer);
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  void sse_encode_box_autoadd_tls_config(TlsConfig self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_tls_config(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_box_autoadd_web_send_params(WebSendParams self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_web_send_params(self, serializer);
  }

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

  @protected
  void sse_encode_client_info(ClientInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_Uuid(self.id, serializer);
    sse_encode_String(self.alias, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_opt_String(self.deviceModel, serializer);
    sse_encode_opt_box_autoadd_device_type(self.deviceType, serializer);
    sse_encode_String(self.token, serializer);
  }

  @protected
  void sse_encode_client_info_without_id(ClientInfoWithoutId self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.alias, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_opt_String(self.deviceModel, serializer);
    sse_encode_opt_box_autoadd_device_type(self.deviceType, serializer);
    sse_encode_String(self.token, serializer);
  }

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

  @protected
  void sse_encode_expecting_public_key(ExpectingPublicKey self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.publicKey, serializer);
    sse_encode_String(self.kind, serializer);
  }

  @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_file_dto(FileDto self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.id, serializer);
    sse_encode_String(self.fileName, serializer);
    sse_encode_u_64(self.size, serializer);
    sse_encode_String(self.fileType, serializer);
    sse_encode_opt_String(self.sha256, serializer);
    sse_encode_opt_String(self.preview, serializer);
    sse_encode_opt_box_autoadd_file_metadata(self.metadata, serializer);
  }

  @protected
  void sse_encode_file_metadata(FileMetadata self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_opt_String(self.modified, serializer);
    sse_encode_opt_String(self.accessed, 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_isize(PlatformInt64 self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putPlatformInt64(self);
  }

  @protected
  void sse_encode_key_pair(KeyPair self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.privateKey, serializer);
    sse_encode_String(self.publicKey, 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_client_info(List<ClientInfo> 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_client_info(item, serializer);
    }
  }

  @protected
  void sse_encode_list_file_dto(List<FileDto> 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_file_dto(item, serializer);
    }
  }

  @protected
  void sse_encode_list_prim_u_8_loose(List<int> self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.length, serializer);
    serializer.buffer.putUint8List(self is Uint8List ? self : Uint8List.fromList(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_file_dto(List<(String, FileDto)> 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_file_dto(item, serializer);
    }
  }

  @protected
  void sse_encode_list_record_string_string(List<(String, 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_record_string_string(item, serializer);
    }
  }

  @protected
  void sse_encode_ls_http_client_version(LsHttpClientVersion self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_32(self.index, 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_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(
    Dart2RustStreamReceiver? 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_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_device_type(DeviceType? 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_device_type(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_expecting_public_key(ExpectingPublicKey? 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_expecting_public_key(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_file_metadata(FileMetadata? 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_file_metadata(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_i_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_i_32(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_pin_config(PinConfig? 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_pin_config(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_prepare_upload_response_dto(PrepareUploadResponseDto? 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_prepare_upload_response_dto(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_box_autoadd_tls_config(TlsConfig? 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_tls_config(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_opt_box_autoadd_web_send_params(WebSendParams? 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_web_send_params(self, serializer);
    }
  }

  @protected
  void sse_encode_opt_list_String(List<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_list_String(self, serializer);
    }
  }

  @protected
  void sse_encode_pin_config(PinConfig self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.pin, serializer);
    sse_encode_u_8(self.maxTries, serializer);
  }

  @protected
  void sse_encode_prepare_upload_request_dto(PrepareUploadRequestDto self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_register_dto(self.info, serializer);
    sse_encode_Map_String_file_dto_None(self.files, serializer);
  }

  @protected
  void sse_encode_prepare_upload_response_dto(PrepareUploadResponseDto self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.sessionId, serializer);
    sse_encode_Map_String_String_None(self.files, serializer);
  }

  @protected
  void sse_encode_prepare_upload_result(PrepareUploadResult self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_16(self.statusCode, serializer);
    sse_encode_opt_box_autoadd_prepare_upload_response_dto(self.response, serializer);
  }

  @protected
  void sse_encode_proposing_client_info(ProposingClientInfo self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.alias, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_opt_String(self.deviceModel, serializer);
    sse_encode_opt_box_autoadd_device_type(self.deviceType, serializer);
  }

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

  @protected
  void sse_encode_protocol_type_v_2(ProtocolTypeV2 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_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_sink_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_dart_2_rust_stream_receiver(
    (Dart2RustStreamSink, Dart2RustStreamReceiver) self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamSink(self.$1, serializer);
    sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDart2RustStreamReceiver(self.$2, serializer);
  }

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

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

  @protected
  void sse_encode_register_dto(RegisterDto self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.alias, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_opt_String(self.deviceModel, serializer);
    sse_encode_opt_box_autoadd_device_type(self.deviceType, serializer);
    sse_encode_String(self.token, serializer);
    sse_encode_u_16(self.port, serializer);
    sse_encode_protocol_type(self.protocol, serializer);
    sse_encode_bool(self.hasWebInterface, serializer);
  }

  @protected
  void sse_encode_register_dto_v_2(RegisterDtoV2 self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.alias, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_opt_String(self.deviceModel, serializer);
    sse_encode_opt_box_autoadd_device_type(self.deviceType, serializer);
    sse_encode_String(self.fingerprint, serializer);
    sse_encode_u_16(self.port, serializer);
    sse_encode_protocol_type_v_2(self.protocol, serializer);
    sse_encode_bool(self.download, serializer);
  }

  @protected
  void sse_encode_register_response_dto(RegisterResponseDto self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.alias, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_opt_String(self.deviceModel, serializer);
    sse_encode_opt_box_autoadd_device_type(self.deviceType, serializer);
    sse_encode_String(self.token, serializer);
    sse_encode_bool(self.hasWebInterface, serializer);
  }

  @protected
  void sse_encode_result_with_public_key_register_response_dto(ResultWithPublicKeyRegisterResponseDto self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_opt_String(self.publicKey, serializer);
    sse_encode_register_response_dto(self.body, serializer);
  }

  @protected
  void sse_encode_rs_http_client_error(RsHttpClientError self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case RsHttpClientError_StatusCode(status: final status, message: final message):
        sse_encode_i_32(0, serializer);
        sse_encode_u_16(status, serializer);
        sse_encode_opt_String(message, serializer);
      case RsHttpClientError_Reqwest(field0: final field0):
        sse_encode_i_32(1, serializer);
        sse_encode_String(field0, serializer);
      case RsHttpClientError_Json(field0: final field0):
        sse_encode_i_32(2, serializer);
        sse_encode_String(field0, serializer);
      case RsHttpClientError_Io(field0: final field0):
        sse_encode_i_32(3, serializer);
        sse_encode_String(field0, serializer);
      case RsHttpClientError_Other(field0: final field0):
        sse_encode_i_32(4, serializer);
        sse_encode_String(field0, serializer);
    }
  }

  @protected
  void sse_encode_rs_server_event(RsServerEvent self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case RsServerEvent_Register(ip: final ip, info: final info):
        sse_encode_i_32(0, serializer);
        sse_encode_String(ip, serializer);
        sse_encode_box_autoadd_register_dto_v_2(info, serializer);
      case RsServerEvent_PrepareUpload(
        sessionId: final sessionId,
        ip: final ip,
        info: final info,
        certFingerprint: final certFingerprint,
        files: final files,
      ):
        sse_encode_i_32(1, serializer);
        sse_encode_String(sessionId, serializer);
        sse_encode_String(ip, serializer);
        sse_encode_box_autoadd_register_dto_v_2(info, serializer);
        sse_encode_opt_String(certFingerprint, serializer);
        sse_encode_Map_String_file_dto_None(files, serializer);
      case RsServerEvent_FileUpload(sessionId: final sessionId, fileId: final fileId, file: final file):
        sse_encode_i_32(2, serializer);
        sse_encode_String(sessionId, serializer);
        sse_encode_String(fileId, serializer);
        sse_encode_box_autoadd_file_dto(file, serializer);
      case RsServerEvent_SessionEnd(sessionId: final sessionId, reason: final reason):
        sse_encode_i_32(3, serializer);
        sse_encode_String(sessionId, serializer);
        sse_encode_session_end_reason_v_2(reason, serializer);
      case RsServerEvent_PrepareUploadAborted(sessionId: final sessionId):
        sse_encode_i_32(4, serializer);
        sse_encode_String(sessionId, serializer);
      case RsServerEvent_CancelReceived(ip: final ip, sessionId: final sessionId):
        sse_encode_i_32(5, serializer);
        sse_encode_String(ip, serializer);
        sse_encode_String(sessionId, serializer);
      case RsServerEvent_WebPrepareDownload(ip: final ip, sessionId: final sessionId, userAgent: final userAgent):
        sse_encode_i_32(6, serializer);
        sse_encode_String(ip, serializer);
        sse_encode_String(sessionId, serializer);
        sse_encode_opt_String(userAgent, serializer);
      case RsServerEvent_WebFileDownload(sessionId: final sessionId, fileId: final fileId, file: final file):
        sse_encode_i_32(7, serializer);
        sse_encode_String(sessionId, serializer);
        sse_encode_String(fileId, serializer);
        sse_encode_box_autoadd_file_dto(file, serializer);
      case RsServerEvent_Show(args: final args):
        sse_encode_i_32(8, serializer);
        sse_encode_list_String(args, serializer);
    }
  }

  @protected
  void sse_encode_rtc_file_error(RTCFileError self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.fileId, serializer);
    sse_encode_String(self.error, serializer);
  }

  @protected
  void sse_encode_rtc_send_file_response(RTCSendFileResponse self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.id, serializer);
    sse_encode_bool(self.success, serializer);
    sse_encode_opt_String(self.error, serializer);
  }

  @protected
  void sse_encode_rtc_status(RTCStatus self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case RTCStatus_SdpExchanged():
        sse_encode_i_32(0, serializer);
      case RTCStatus_Connected():
        sse_encode_i_32(1, serializer);
      case RTCStatus_PinRequired():
        sse_encode_i_32(2, serializer);
      case RTCStatus_TooManyAttempts():
        sse_encode_i_32(3, serializer);
      case RTCStatus_Declined():
        sse_encode_i_32(4, serializer);
      case RTCStatus_Sending():
        sse_encode_i_32(5, serializer);
      case RTCStatus_Finished():
        sse_encode_i_32(6, serializer);
      case RTCStatus_Error(field0: final field0):
        sse_encode_i_32(7, serializer);
        sse_encode_String(field0, serializer);
    }
  }

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

  @protected
  void sse_encode_tls_config(TlsConfig self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.cert, serializer);
    sse_encode_String(self.privateKey, 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);
  }

  @protected
  void sse_encode_web_send_i_18_n(WebSendI18n self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.waiting, serializer);
    sse_encode_String(self.enterPin, serializer);
    sse_encode_String(self.invalidPin, serializer);
    sse_encode_String(self.tooManyAttempts, serializer);
    sse_encode_String(self.rejected, serializer);
    sse_encode_String(self.files, serializer);
    sse_encode_String(self.fileName, serializer);
    sse_encode_String(self.size, serializer);
  }

  @protected
  void sse_encode_web_send_params(WebSendParams self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_Map_String_file_dto_None(self.files, serializer);
    sse_encode_opt_String(self.pin, serializer);
    sse_encode_web_send_i_18_n(self.i18N, serializer);
  }

  @protected
  void sse_encode_ws_server_message(WsServerMessage self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case WsServerMessage_Hello(client: final client, peers: final peers):
        sse_encode_i_32(0, serializer);
        sse_encode_box_autoadd_client_info(client, serializer);
        sse_encode_list_client_info(peers, serializer);
      case WsServerMessage_Join(peer: final peer):
        sse_encode_i_32(1, serializer);
        sse_encode_box_autoadd_client_info(peer, serializer);
      case WsServerMessage_Update(peer: final peer):
        sse_encode_i_32(2, serializer);
        sse_encode_box_autoadd_client_info(peer, serializer);
      case WsServerMessage_Left(peerId: final peerId):
        sse_encode_i_32(3, serializer);
        sse_encode_Uuid(peerId, serializer);
      case WsServerMessage_Offer(field0: final field0):
        sse_encode_i_32(4, serializer);
        sse_encode_box_autoadd_ws_server_sdp_message(field0, serializer);
      case WsServerMessage_Answer(field0: final field0):
        sse_encode_i_32(5, serializer);
        sse_encode_box_autoadd_ws_server_sdp_message(field0, serializer);
      case WsServerMessage_Error(code: final code):
        sse_encode_i_32(6, serializer);
        sse_encode_u_16(code, serializer);
    }
  }

  @protected
  void sse_encode_ws_server_sdp_message(WsServerSdpMessage self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_client_info(self.peer, serializer);
    sse_encode_String(self.sessionId, serializer);
    sse_encode_String(self.sdp, serializer);
  }
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_Dart2RustStreamReceiver,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_Dart2RustStreamReceiver,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_Dart2RustStreamReceiverPtr,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_Dart2RustStreamSink,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_Dart2RustStreamSink,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_Dart2RustStreamSinkPtr,
  );

  Future<void> add({required List<int> data}) => RustLib.instance.api.crateApiStreamDart2RustStreamSinkAdd(that: this, data: data);

  /// Closes the stream, signaling the end of data to the Rust side.
  void close() => RustLib.instance.api.crateApiStreamDart2RustStreamSinkClose(
    that: this,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_LsSignalingConnection,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_LsSignalingConnection,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_LsSignalingConnectionPtr,
  );

  Future<RtcReceiveController> acceptOffer({
    required List<String> stunServers,
    required WsServerSdpMessage offer,
    required String privateKey,
    ExpectingPublicKey? expectingPublicKey,
    PinConfig? pin,
  }) => RustLib.instance.api.crateApiWebrtcLsSignalingConnectionAcceptOffer(
    that: this,
    stunServers: stunServers,
    offer: offer,
    privateKey: privateKey,
    expectingPublicKey: expectingPublicKey,
    pin: pin,
  );

  Future<RtcSendController> sendOffer({
    required List<String> stunServers,
    required UuidValue target,
    required String privateKey,
    ExpectingPublicKey? expectingPublicKey,
    PinConfig? pin,
    required List<FileDto> files,
  }) => RustLib.instance.api.crateApiWebrtcLsSignalingConnectionSendOffer(
    that: this,
    stunServers: stunServers,
    target: target,
    privateKey: privateKey,
    expectingPublicKey: expectingPublicKey,
    pin: pin,
    files: files,
  );

  Future<void> updateInfo({required ClientInfoWithoutId info}) =>
      RustLib.instance.api.crateApiWebrtcLsSignalingConnectionUpdateInfo(that: this, info: info);
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RsCancellationToken,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RsCancellationToken,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_RsCancellationTokenPtr,
  );

  void cancel() => RustLib.instance.api.crateApiHttpRsCancellationTokenCancel(
    that: this,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RsHttpClient,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RsHttpClient,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_RsHttpClientPtr,
  );

  Future<void> cancel({required ProtocolType protocol, required String ip, required int port, required String sessionId}) =>
      RustLib.instance.api.crateApiHttpRsHttpClientCancel(that: this, protocol: protocol, ip: ip, port: port, sessionId: sessionId);

  Future<PrepareUploadResult> prepareUpload({
    required ProtocolType protocol,
    required String ip,
    required int port,
    required PrepareUploadRequestDto payload,
    String? publicKey,
    String? pin,
  }) => RustLib.instance.api.crateApiHttpRsHttpClientPrepareUpload(
    that: this,
    protocol: protocol,
    ip: ip,
    port: port,
    payload: payload,
    publicKey: publicKey,
    pin: pin,
  );

  Future<ResultWithPublicKeyRegisterResponseDto> register({
    required ProtocolType protocol,
    required String ip,
    required int port,
    required RegisterDto payload,
  }) => RustLib.instance.api.crateApiHttpRsHttpClientRegister(that: this, protocol: protocol, ip: ip, port: port, payload: payload);

  Stream<double> upload({
    required ProtocolType protocol,
    required String ip,
    required int port,
    String? publicKey,
    required String sessionId,
    required String fileId,
    required String token,
    Dart2RustStreamReceiver? binary,
    String? path,
    int? fileDescriptor,
    required BigInt contentLength,
    required RsCancellationToken cancelToken,
  }) => RustLib.instance.api.crateApiHttpRsHttpClientUpload(
    that: this,
    protocol: protocol,
    ip: ip,
    port: port,
    publicKey: publicKey,
    sessionId: sessionId,
    fileId: fileId,
    token: token,
    binary: binary,
    path: path,
    fileDescriptor: fileDescriptor,
    contentLength: contentLength,
    cancelToken: cancelToken,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RsHttpServer,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RsHttpServer,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_RsHttpServerPtr,
  );

  /// Cancels the active upload session, e.g. because the user aborted the
  /// transfer on the receiving side.
  ///
  /// Uploads that are already in progress still run to completion, but new
  /// upload requests are rejected and a new session can be created.
  /// No [RsServerEvent::SessionEnd] is emitted: the application initiated
  /// the cancellation itself.
  Future<void> cancelSession({required String sessionId}) =>
      RustLib.instance.api.crateApiServerRsHttpServerCancelSession(that: this, sessionId: sessionId);

  /// Emits server events until the server is stopped.
  /// Can only be listened to once.
  ///
  /// The v2 protocol, the web send (download API), and the internal endpoint
  /// events are all emitted on the same stream.
  Stream<RsServerEvent> listen() => RustLib.instance.api.crateApiServerRsHttpServerListen(
    that: this,
  );

  /// Rejects the pending [RsServerEvent::WebFileDownload] event, e.g. because
  /// the application failed to resolve a source for the file content.
  ///
  /// The download request fails with an error response.
  /// Does nothing if the download was already answered.
  Future<void> rejectFileDownload({required String sessionId, required String fileId}) =>
      RustLib.instance.api.crateApiServerRsHttpServerRejectFileDownload(that: this, sessionId: sessionId, fileId: fileId);

  /// Rejects the pending [RsServerEvent::FileUpload] event, e.g. because
  /// the application failed to prepare a save target for the file.
  ///
  /// The upload request fails with an error response and the file is marked
  /// as failed. Does nothing if the upload was already answered.
  Future<void> rejectFileUpload({required String sessionId, required String fileId}) =>
      RustLib.instance.api.crateApiServerRsHttpServerRejectFileUpload(that: this, sessionId: sessionId, fileId: fileId);

  /// Answers the pending [RsServerEvent::WebFileDownload] event with the source
  /// the file content should be read from (either a path or a file descriptor).
  ///
  /// The server reads the content and streams it to the web client.
  Future<void> respondFileDownload({required String sessionId, required String fileId, String? path, int? fileDescriptor}) => RustLib.instance.api
      .crateApiServerRsHttpServerRespondFileDownload(that: this, sessionId: sessionId, fileId: fileId, path: path, fileDescriptor: fileDescriptor);

  /// Answers the pending [RsServerEvent::FileUpload] event with the target
  /// the file should be saved to (either a path or a file descriptor)
  /// and waits until the file has been received completely.
  ///
  /// The progress (fraction of [file_size]) is emitted on [sink]
  /// while the file is being received.
  Stream<double> respondFileUpload({
    required String sessionId,
    required String fileId,
    String? path,
    int? fileDescriptor,
    required BigInt fileSize,
  }) => RustLib.instance.api.crateApiServerRsHttpServerRespondFileUpload(
    that: this,
    sessionId: sessionId,
    fileId: fileId,
    path: path,
    fileDescriptor: fileDescriptor,
    fileSize: fileSize,
  );

  /// Answers the pending [RsServerEvent::WebPrepareDownload] event.
  ///
  /// Passing `true` accepts the download request, `false` declines it.
  Future<void> respondPrepareDownload({required String sessionId, required bool accept}) =>
      RustLib.instance.api.crateApiServerRsHttpServerRespondPrepareDownload(that: this, sessionId: sessionId, accept: accept);

  /// Answers the pending [RsServerEvent::PrepareUpload] event.
  ///
  /// Passing the accepted file IDs (a subset of the offered files) accepts the request.
  /// Passing `None` declines the request.
  Future<void> respondPrepareUpload({List<String>? acceptedFileIds}) =>
      RustLib.instance.api.crateApiServerRsHttpServerRespondPrepareUpload(that: this, acceptedFileIds: acceptedFileIds);

  /// Stops the server.
  /// Returns after the listeners are closed, so the port can be bound again.
  Future<void> stop() => RustLib.instance.api.crateApiServerRsHttpServerStop(
    that: this,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RtcFileReceiver,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RtcFileReceiver,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_RtcFileReceiverPtr,
  );

  Future<String> getFileId() => RustLib.instance.api.crateApiWebrtcRtcFileReceiverGetFileId(
    that: this,
  );

  Stream<Uint8List> receive() => RustLib.instance.api.crateApiWebrtcRtcFileReceiverReceive(
    that: this,
  );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RtcFileSender,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RtcFileSender,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_RtcFileSenderPtr,
  );

  Future<void> send({required List<int> data}) => RustLib.instance.api.crateApiWebrtcRtcFileSenderSend(that: this, data: data);
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RtcReceiveController,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RtcReceiveController,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_RtcReceiveControllerPtr,
  );

  Future<void> decline() => RustLib.instance.api.crateApiWebrtcRtcReceiveControllerDecline(
    that: this,
  );

  Stream<RTCFileError> listenError() => RustLib.instance.api.crateApiWebrtcRtcReceiveControllerListenError(
    that: this,
  );

  Future<List<FileDto>> listenFiles() => RustLib.instance.api.crateApiWebrtcRtcReceiveControllerListenFiles(
    that: this,
  );

  Stream<RtcFileReceiver> listenReceiving() => RustLib.instance.api.crateApiWebrtcRtcReceiveControllerListenReceiving(
    that: this,
  );

  Stream<RTCStatus> listenStatus() => RustLib.instance.api.crateApiWebrtcRtcReceiveControllerListenStatus(
    that: this,
  );

  Future<void> sendFileStatus({required RTCSendFileResponse status}) =>
      RustLib.instance.api.crateApiWebrtcRtcReceiveControllerSendFileStatus(that: this, status: status);

  Future<void> sendPin({required String pin}) => RustLib.instance.api.crateApiWebrtcRtcReceiveControllerSendPin(that: this, pin: pin);

  Future<void> sendSelection({required Set<String> selection}) =>
      RustLib.instance.api.crateApiWebrtcRtcReceiveControllerSendSelection(that: this, selection: selection);
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_RtcSendController,
    rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_RtcSendController,
    rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_RtcSendControllerPtr,
  );

  Stream<RTCFileError> listenError() => RustLib.instance.api.crateApiWebrtcRtcSendControllerListenError(
    that: this,
  );

  Future<Set<String>> listenSelectedFiles() => RustLib.instance.api.crateApiWebrtcRtcSendControllerListenSelectedFiles(
    that: this,
  );

  Stream<RTCStatus> listenStatus() => RustLib.instance.api.crateApiWebrtcRtcSendControllerListenStatus(
    that: this,
  );

  Future<RtcFileSender> sendFile({required String fileId}) =>
      RustLib.instance.api.crateApiWebrtcRtcSendControllerSendFile(that: this, fileId: fileId);

  Future<void> sendPin({required String pin}) => RustLib.instance.api.crateApiWebrtcRtcSendControllerSendPin(that: this, pin: pin);
}
