// 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 'api.dart';
import 'dart:async';
import 'dart:convert';
import 'frb_generated.dart';
import 'frb_generated.io.dart'
    if (dart.library.js_interop) 'frb_generated.web.dart';
import 'lib.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

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

  RustLib._();

  /// Initialize flutter_rust_bridge
  static Future<void> init({
    RustLibApi? api,
    BaseHandler? handler,
    ExternalLibrary? externalLibrary,
    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 {
    await api.crateApiBridgeInit();
  }

  @override
  ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
      kDefaultExternalLibraryLoaderConfig;

  @override
  String get codegenVersion => '2.12.0';

  @override
  int get rustContentHash => -427953414;

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

abstract class RustLibApi extends BaseApi {
  Future<PlatformInt64> crateApiAddBookmark({required BridgeBookmark b});

  Future<BridgeAudioStats> crateApiAudioStats();

  Future<void> crateApiBridgeInit();

  Future<BridgeSnapshot> crateApiConnect({
    required String host,
    required String nickname,
    required String password,
  });

  Future<void> crateApiDeleteBookmark({required PlatformInt64 id});

  Future<void> crateApiDisconnect();

  Stream<BridgeEvent> crateApiEventsStream();

  String crateApiExportDiagnostics();

  Future<void> crateApiInitStorage({required String dir});

  Future<bool> crateApiIsConnected();

  Future<List<BridgeBookmark>> crateApiListBookmarks();

  Future<void> crateApiMoveToChannel({
    required BigInt channelId,
    required String password,
  });

  Future<(String, String, String)> crateApiPttDescriptor();

  Future<void> crateApiSetInputMuted({required bool muted});

  void crateApiSetNetworkState({required BridgeNetworkState state});

  Future<void> crateApiSetOutputGain({required double gain});

  Future<void> crateApiSetOutputMuted({required bool muted});

  Future<void> crateApiSetPtt({required bool active});

  Future<void> crateApiSetPttBinding({
    required BridgePttInputClass inputClass,
    required String platformKey,
  });

  Future<BridgeSnapshot> crateApiSnapshot();

  Future<void> crateApiStartAudio();

  Future<void> crateApiUpdateBookmark({required BridgeBookmark b});
}

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

  @override
  Future<PlatformInt64> crateApiAddBookmark({required BridgeBookmark b}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_bridge_bookmark(b, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 1,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_i_64,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiAddBookmarkConstMeta,
        argValues: [b],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAddBookmarkConstMeta =>
      const TaskConstMeta(debugName: "add_bookmark", argNames: ["b"]);

  @override
  Future<BridgeAudioStats> crateApiAudioStats() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 2,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_audio_stats,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiAudioStatsConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiAudioStatsConstMeta =>
      const TaskConstMeta(debugName: "audio_stats", argNames: []);

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

  TaskConstMeta get kCrateApiBridgeInitConstMeta =>
      const TaskConstMeta(debugName: "bridge_init", argNames: []);

  @override
  Future<BridgeSnapshot> crateApiConnect({
    required String host,
    required String nickname,
    required String password,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(host, serializer);
          sse_encode_String(nickname, serializer);
          sse_encode_String(password, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 4,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_snapshot,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiConnectConstMeta,
        argValues: [host, nickname, password],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiConnectConstMeta => const TaskConstMeta(
    debugName: "connect",
    argNames: ["host", "nickname", "password"],
  );

  @override
  Future<void> crateApiDeleteBookmark({required PlatformInt64 id}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_i_64(id, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 5,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiDeleteBookmarkConstMeta,
        argValues: [id],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiDeleteBookmarkConstMeta =>
      const TaskConstMeta(debugName: "delete_bookmark", argNames: ["id"]);

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

  TaskConstMeta get kCrateApiDisconnectConstMeta =>
      const TaskConstMeta(debugName: "disconnect", argNames: []);

  @override
  Stream<BridgeEvent> crateApiEventsStream() {
    final sink = RustStreamSink<BridgeEvent>();
    unawaited(
      handler.executeNormal(
        NormalTask(
          callFfi: (port_) {
            final serializer = SseSerializer(generalizedFrbRustBinding);
            sse_encode_StreamSink_bridge_event_Sse(sink, serializer);
            pdeCallFfi(
              generalizedFrbRustBinding,
              serializer,
              funcId: 7,
              port: port_,
            );
          },
          codec: SseCodec(
            decodeSuccessData: sse_decode_unit,
            decodeErrorData: sse_decode_bridge_error,
          ),
          constMeta: kCrateApiEventsStreamConstMeta,
          argValues: [sink],
          apiImpl: this,
        ),
      ),
    );
    return sink.stream;
  }

  TaskConstMeta get kCrateApiEventsStreamConstMeta =>
      const TaskConstMeta(debugName: "events_stream", argNames: ["sink"]);

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

  TaskConstMeta get kCrateApiExportDiagnosticsConstMeta =>
      const TaskConstMeta(debugName: "export_diagnostics", argNames: []);

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

  TaskConstMeta get kCrateApiInitStorageConstMeta =>
      const TaskConstMeta(debugName: "init_storage", argNames: ["dir"]);

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

  TaskConstMeta get kCrateApiIsConnectedConstMeta =>
      const TaskConstMeta(debugName: "is_connected", argNames: []);

  @override
  Future<List<BridgeBookmark>> crateApiListBookmarks() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 11,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_list_bridge_bookmark,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiListBookmarksConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiListBookmarksConstMeta =>
      const TaskConstMeta(debugName: "list_bookmarks", argNames: []);

  @override
  Future<void> crateApiMoveToChannel({
    required BigInt channelId,
    required String password,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_u_64(channelId, serializer);
          sse_encode_String(password, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 12,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiMoveToChannelConstMeta,
        argValues: [channelId, password],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiMoveToChannelConstMeta => const TaskConstMeta(
    debugName: "move_to_channel",
    argNames: ["channelId", "password"],
  );

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

  TaskConstMeta get kCrateApiPttDescriptorConstMeta =>
      const TaskConstMeta(debugName: "ptt_descriptor", argNames: []);

  @override
  Future<void> crateApiSetInputMuted({required bool muted}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(muted, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 14,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetInputMutedConstMeta,
        argValues: [muted],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetInputMutedConstMeta =>
      const TaskConstMeta(debugName: "set_input_muted", argNames: ["muted"]);

  @override
  void crateApiSetNetworkState({required BridgeNetworkState state}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_network_state(state, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 15)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiSetNetworkStateConstMeta,
        argValues: [state],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetNetworkStateConstMeta =>
      const TaskConstMeta(debugName: "set_network_state", argNames: ["state"]);

  @override
  Future<void> crateApiSetOutputGain({required double gain}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_f_32(gain, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 16,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetOutputGainConstMeta,
        argValues: [gain],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetOutputGainConstMeta =>
      const TaskConstMeta(debugName: "set_output_gain", argNames: ["gain"]);

  @override
  Future<void> crateApiSetOutputMuted({required bool muted}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(muted, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 17,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetOutputMutedConstMeta,
        argValues: [muted],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetOutputMutedConstMeta =>
      const TaskConstMeta(debugName: "set_output_muted", argNames: ["muted"]);

  @override
  Future<void> crateApiSetPtt({required bool active}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bool(active, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 18,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetPttConstMeta,
        argValues: [active],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetPttConstMeta =>
      const TaskConstMeta(debugName: "set_ptt", argNames: ["active"]);

  @override
  Future<void> crateApiSetPttBinding({
    required BridgePttInputClass inputClass,
    required String platformKey,
  }) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_bridge_ptt_input_class(inputClass, serializer);
          sse_encode_String(platformKey, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 19,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSetPttBindingConstMeta,
        argValues: [inputClass, platformKey],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSetPttBindingConstMeta => const TaskConstMeta(
    debugName: "set_ptt_binding",
    argNames: ["inputClass", "platformKey"],
  );

  @override
  Future<BridgeSnapshot> crateApiSnapshot() {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 20,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_snapshot,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiSnapshotConstMeta,
        argValues: [],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiSnapshotConstMeta =>
      const TaskConstMeta(debugName: "snapshot", argNames: []);

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

  TaskConstMeta get kCrateApiStartAudioConstMeta =>
      const TaskConstMeta(debugName: "start_audio", argNames: []);

  @override
  Future<void> crateApiUpdateBookmark({required BridgeBookmark b}) {
    return handler.executeNormal(
      NormalTask(
        callFfi: (port_) {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_box_autoadd_bridge_bookmark(b, serializer);
          pdeCallFfi(
            generalizedFrbRustBinding,
            serializer,
            funcId: 22,
            port: port_,
          );
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: sse_decode_bridge_error,
        ),
        constMeta: kCrateApiUpdateBookmarkConstMeta,
        argValues: [b],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiUpdateBookmarkConstMeta =>
      const TaskConstMeta(debugName: "update_bookmark", argNames: ["b"]);

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

  @protected
  RustStreamSink<BridgeEvent> dco_decode_StreamSink_bridge_event_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
  bool dco_decode_bool(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as bool;
  }

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

  @protected
  BridgeAudioStats dco_decode_bridge_audio_stats(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 BridgeAudioStats(
      framesSent: dco_decode_u_32(arr[0]),
      framesReceived: dco_decode_u_32(arr[1]),
      pttActive: dco_decode_bool(arr[2]),
    );
  }

  @protected
  BridgeBookmark dco_decode_bridge_bookmark(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 BridgeBookmark(
      id: dco_decode_i_64(arr[0]),
      displayName: dco_decode_String(arr[1]),
      host: dco_decode_String(arr[2]),
      nickname: dco_decode_String(arr[3]),
      password: dco_decode_String(arr[4]),
    );
  }

  @protected
  BridgeChannel dco_decode_bridge_channel(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 BridgeChannel(
      id: dco_decode_u_64(arr[0]),
      parent: dco_decode_u_64(arr[1]),
      name: dco_decode_String(arr[2]),
      order: dco_decode_i_64(arr[3]),
    );
  }

  @protected
  BridgeClient dco_decode_bridge_client(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 BridgeClient(
      id: dco_decode_u_64(arr[0]),
      channel: dco_decode_u_64(arr[1]),
      name: dco_decode_String(arr[2]),
    );
  }

  @protected
  BridgeError dco_decode_bridge_error(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return BridgeError_InvalidCommand(dco_decode_String(raw[1]));
      case 1:
        return BridgeError_DnsFailed(
          host: dco_decode_String(raw[1]),
          reason: dco_decode_String(raw[2]),
        );
      case 2:
        return BridgeError_Connection(dco_decode_String(raw[1]));
      case 3:
        return BridgeError_NotConnected();
      case 4:
        return BridgeError_AlreadyConnected();
      case 5:
        return BridgeError_Unmapped(dco_decode_String(raw[1]));
      default:
        throw Exception("unreachable");
    }
  }

  @protected
  BridgeEvent dco_decode_bridge_event(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    switch (raw[0]) {
      case 0:
        return BridgeEvent_Connected(serverName: dco_decode_String(raw[1]));
      case 1:
        return BridgeEvent_Lost(reason: dco_decode_String(raw[1]));
      case 2:
        return BridgeEvent_Reconnecting(
          attempt: dco_decode_u_32(raw[1]),
          delaySecs: dco_decode_u_32(raw[2]),
        );
      case 3:
        return BridgeEvent_Disconnected(reason: dco_decode_String(raw[1]));
      case 4:
        return BridgeEvent_AudioStarted();
      case 5:
        return BridgeEvent_AudioStopped();
      case 6:
        return BridgeEvent_SnapshotChanged(
          channels: dco_decode_u_32(raw[1]),
          clients: dco_decode_u_32(raw[2]),
        );
      case 7:
        return BridgeEvent_PttCapability(
          level: dco_decode_String(raw[1]),
          backendId: dco_decode_String(raw[2]),
          boundInputClass: dco_decode_String(raw[3]),
        );
      default:
        throw Exception("unreachable");
    }
  }

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

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

  @protected
  BridgeSnapshot dco_decode_bridge_snapshot(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 BridgeSnapshot(
      serverName: dco_decode_String(arr[0]),
      welcomeMessage: dco_decode_String(arr[1]),
      platform: dco_decode_String(arr[2]),
      version: dco_decode_String(arr[3]),
      channels: dco_decode_list_bridge_channel(arr[4]),
      clients: dco_decode_list_bridge_client(arr[5]),
    );
  }

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

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

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

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

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

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

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

  @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
  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
  RustStreamSink<BridgeEvent> sse_decode_StreamSink_bridge_event_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
  bool sse_decode_bool(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getUint8() != 0;
  }

  @protected
  BridgeBookmark sse_decode_box_autoadd_bridge_bookmark(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return (sse_decode_bridge_bookmark(deserializer));
  }

  @protected
  BridgeAudioStats sse_decode_bridge_audio_stats(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_framesSent = sse_decode_u_32(deserializer);
    var var_framesReceived = sse_decode_u_32(deserializer);
    var var_pttActive = sse_decode_bool(deserializer);
    return BridgeAudioStats(
      framesSent: var_framesSent,
      framesReceived: var_framesReceived,
      pttActive: var_pttActive,
    );
  }

  @protected
  BridgeBookmark sse_decode_bridge_bookmark(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_i_64(deserializer);
    var var_displayName = sse_decode_String(deserializer);
    var var_host = sse_decode_String(deserializer);
    var var_nickname = sse_decode_String(deserializer);
    var var_password = sse_decode_String(deserializer);
    return BridgeBookmark(
      id: var_id,
      displayName: var_displayName,
      host: var_host,
      nickname: var_nickname,
      password: var_password,
    );
  }

  @protected
  BridgeChannel sse_decode_bridge_channel(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_u_64(deserializer);
    var var_parent = sse_decode_u_64(deserializer);
    var var_name = sse_decode_String(deserializer);
    var var_order = sse_decode_i_64(deserializer);
    return BridgeChannel(
      id: var_id,
      parent: var_parent,
      name: var_name,
      order: var_order,
    );
  }

  @protected
  BridgeClient sse_decode_bridge_client(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_id = sse_decode_u_64(deserializer);
    var var_channel = sse_decode_u_64(deserializer);
    var var_name = sse_decode_String(deserializer);
    return BridgeClient(id: var_id, channel: var_channel, name: var_name);
  }

  @protected
  BridgeError sse_decode_bridge_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_field0 = sse_decode_String(deserializer);
        return BridgeError_InvalidCommand(var_field0);
      case 1:
        var var_host = sse_decode_String(deserializer);
        var var_reason = sse_decode_String(deserializer);
        return BridgeError_DnsFailed(host: var_host, reason: var_reason);
      case 2:
        var var_field0 = sse_decode_String(deserializer);
        return BridgeError_Connection(var_field0);
      case 3:
        return BridgeError_NotConnected();
      case 4:
        return BridgeError_AlreadyConnected();
      case 5:
        var var_field0 = sse_decode_String(deserializer);
        return BridgeError_Unmapped(var_field0);
      default:
        throw UnimplementedError('');
    }
  }

  @protected
  BridgeEvent sse_decode_bridge_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_serverName = sse_decode_String(deserializer);
        return BridgeEvent_Connected(serverName: var_serverName);
      case 1:
        var var_reason = sse_decode_String(deserializer);
        return BridgeEvent_Lost(reason: var_reason);
      case 2:
        var var_attempt = sse_decode_u_32(deserializer);
        var var_delaySecs = sse_decode_u_32(deserializer);
        return BridgeEvent_Reconnecting(
          attempt: var_attempt,
          delaySecs: var_delaySecs,
        );
      case 3:
        var var_reason = sse_decode_String(deserializer);
        return BridgeEvent_Disconnected(reason: var_reason);
      case 4:
        return BridgeEvent_AudioStarted();
      case 5:
        return BridgeEvent_AudioStopped();
      case 6:
        var var_channels = sse_decode_u_32(deserializer);
        var var_clients = sse_decode_u_32(deserializer);
        return BridgeEvent_SnapshotChanged(
          channels: var_channels,
          clients: var_clients,
        );
      case 7:
        var var_level = sse_decode_String(deserializer);
        var var_backendId = sse_decode_String(deserializer);
        var var_boundInputClass = sse_decode_String(deserializer);
        return BridgeEvent_PttCapability(
          level: var_level,
          backendId: var_backendId,
          boundInputClass: var_boundInputClass,
        );
      default:
        throw UnimplementedError('');
    }
  }

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

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

  @protected
  BridgeSnapshot sse_decode_bridge_snapshot(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_serverName = sse_decode_String(deserializer);
    var var_welcomeMessage = sse_decode_String(deserializer);
    var var_platform = sse_decode_String(deserializer);
    var var_version = sse_decode_String(deserializer);
    var var_channels = sse_decode_list_bridge_channel(deserializer);
    var var_clients = sse_decode_list_bridge_client(deserializer);
    return BridgeSnapshot(
      serverName: var_serverName,
      welcomeMessage: var_welcomeMessage,
      platform: var_platform,
      version: var_version,
      channels: var_channels,
      clients: var_clients,
    );
  }

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

  @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_i_64(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    return deserializer.buffer.getPlatformInt64();
  }

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

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

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

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

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

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

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

  @protected
  (String, String, String) sse_decode_record_string_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);
    var var_field2 = sse_decode_String(deserializer);
    return (var_field0, var_field1, var_field2);
  }

  @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
  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_StreamSink_bridge_event_Sse(
    RustStreamSink<BridgeEvent> self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(
      self.setupAndSerialize(
        codec: SseCodec(
          decodeSuccessData: sse_decode_bridge_event,
          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_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_bridge_bookmark(
    BridgeBookmark self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_bridge_bookmark(self, serializer);
  }

  @protected
  void sse_encode_bridge_audio_stats(
    BridgeAudioStats self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_32(self.framesSent, serializer);
    sse_encode_u_32(self.framesReceived, serializer);
    sse_encode_bool(self.pttActive, serializer);
  }

  @protected
  void sse_encode_bridge_bookmark(
    BridgeBookmark self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_i_64(self.id, serializer);
    sse_encode_String(self.displayName, serializer);
    sse_encode_String(self.host, serializer);
    sse_encode_String(self.nickname, serializer);
    sse_encode_String(self.password, serializer);
  }

  @protected
  void sse_encode_bridge_channel(BridgeChannel self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_64(self.id, serializer);
    sse_encode_u_64(self.parent, serializer);
    sse_encode_String(self.name, serializer);
    sse_encode_i_64(self.order, serializer);
  }

  @protected
  void sse_encode_bridge_client(BridgeClient self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_u_64(self.id, serializer);
    sse_encode_u_64(self.channel, serializer);
    sse_encode_String(self.name, serializer);
  }

  @protected
  void sse_encode_bridge_error(BridgeError self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case BridgeError_InvalidCommand(field0: final field0):
        sse_encode_i_32(0, serializer);
        sse_encode_String(field0, serializer);
      case BridgeError_DnsFailed(host: final host, reason: final reason):
        sse_encode_i_32(1, serializer);
        sse_encode_String(host, serializer);
        sse_encode_String(reason, serializer);
      case BridgeError_Connection(field0: final field0):
        sse_encode_i_32(2, serializer);
        sse_encode_String(field0, serializer);
      case BridgeError_NotConnected():
        sse_encode_i_32(3, serializer);
      case BridgeError_AlreadyConnected():
        sse_encode_i_32(4, serializer);
      case BridgeError_Unmapped(field0: final field0):
        sse_encode_i_32(5, serializer);
        sse_encode_String(field0, serializer);
    }
  }

  @protected
  void sse_encode_bridge_event(BridgeEvent self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    switch (self) {
      case BridgeEvent_Connected(serverName: final serverName):
        sse_encode_i_32(0, serializer);
        sse_encode_String(serverName, serializer);
      case BridgeEvent_Lost(reason: final reason):
        sse_encode_i_32(1, serializer);
        sse_encode_String(reason, serializer);
      case BridgeEvent_Reconnecting(
        attempt: final attempt,
        delaySecs: final delaySecs,
      ):
        sse_encode_i_32(2, serializer);
        sse_encode_u_32(attempt, serializer);
        sse_encode_u_32(delaySecs, serializer);
      case BridgeEvent_Disconnected(reason: final reason):
        sse_encode_i_32(3, serializer);
        sse_encode_String(reason, serializer);
      case BridgeEvent_AudioStarted():
        sse_encode_i_32(4, serializer);
      case BridgeEvent_AudioStopped():
        sse_encode_i_32(5, serializer);
      case BridgeEvent_SnapshotChanged(
        channels: final channels,
        clients: final clients,
      ):
        sse_encode_i_32(6, serializer);
        sse_encode_u_32(channels, serializer);
        sse_encode_u_32(clients, serializer);
      case BridgeEvent_PttCapability(
        level: final level,
        backendId: final backendId,
        boundInputClass: final boundInputClass,
      ):
        sse_encode_i_32(7, serializer);
        sse_encode_String(level, serializer);
        sse_encode_String(backendId, serializer);
        sse_encode_String(boundInputClass, serializer);
    }
  }

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

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

  @protected
  void sse_encode_bridge_snapshot(
    BridgeSnapshot self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_String(self.serverName, serializer);
    sse_encode_String(self.welcomeMessage, serializer);
    sse_encode_String(self.platform, serializer);
    sse_encode_String(self.version, serializer);
    sse_encode_list_bridge_channel(self.channels, serializer);
    sse_encode_list_bridge_client(self.clients, serializer);
  }

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

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

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

  @protected
  void sse_encode_list_bridge_bookmark(
    List<BridgeBookmark> 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_bridge_bookmark(item, serializer);
    }
  }

  @protected
  void sse_encode_list_bridge_channel(
    List<BridgeChannel> 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_bridge_channel(item, serializer);
    }
  }

  @protected
  void sse_encode_list_bridge_client(
    List<BridgeClient> 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_bridge_client(item, serializer);
    }
  }

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

  @protected
  void sse_encode_record_string_string_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);
    sse_encode_String(self.$3, serializer);
  }

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

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

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

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