// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.

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

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

  RustLib._();

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

  @override
  ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
      kDefaultExternalLibraryLoaderConfig;

  @override
  String get codegenVersion => '2.11.1';

  @override
  int get rustContentHash => 903592481;

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

abstract class RustLibApi extends BaseApi {
  bool crateApiZakatDartZakatResultAutoAccessorGetIsPayable({
    required DartZakatResult that,
  });

  String crateApiZakatDartZakatResultAutoAccessorGetLimitName({
    required DartZakatResult that,
  });

  FrbDecimal crateApiZakatDartZakatResultAutoAccessorGetNisabThreshold({
    required DartZakatResult that,
  });

  FrbDecimal crateApiZakatDartZakatResultAutoAccessorGetWealthAmount({
    required DartZakatResult that,
  });

  FrbDecimal crateApiZakatDartZakatResultAutoAccessorGetZakatDue({
    required DartZakatResult that,
  });

  void crateApiZakatDartZakatResultAutoAccessorSetIsPayable({
    required DartZakatResult that,
    required bool isPayable,
  });

  void crateApiZakatDartZakatResultAutoAccessorSetLimitName({
    required DartZakatResult that,
    required String limitName,
  });

  void crateApiZakatDartZakatResultAutoAccessorSetNisabThreshold({
    required DartZakatResult that,
    required FrbDecimal nisabThreshold,
  });

  void crateApiZakatDartZakatResultAutoAccessorSetWealthAmount({
    required DartZakatResult that,
    required FrbDecimal wealthAmount,
  });

  void crateApiZakatDartZakatResultAutoAccessorSetZakatDue({
    required DartZakatResult that,
    required FrbDecimal zakatDue,
  });

  FrbDecimal crateApiZakatFrbDecimalFromString({required String s});

  double crateApiZakatFrbDecimalToF64({required FrbDecimal that});

  String crateApiZakatFrbDecimalToString({required FrbDecimal that});

  DartZakatResult crateApiZakatZakatManagerCalculateBusiness({
    required ZakatManager that,
    required FrbDecimal cash,
    required FrbDecimal inventory,
    required FrbDecimal receivables,
    required FrbDecimal liabilities,
  });

  DartZakatResult crateApiZakatZakatManagerCalculateSavings({
    required ZakatManager that,
    required FrbDecimal cashInHand,
    required FrbDecimal bankBalance,
  });

  (FrbDecimal, FrbDecimal) crateApiZakatZakatManagerGetNisabThresholds({
    required ZakatManager that,
  });

  ZakatManager crateApiZakatZakatManagerNew({
    required FrbDecimal goldPrice,
    required FrbDecimal silverPrice,
    required String madhab,
  });

  Future<void> crateApiZakatInitApp();

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_DartZakatResult;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_DartZakatResult;

  CrossPlatformFinalizerArg
  get rust_arc_decrement_strong_count_DartZakatResultPtr;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_FrbDecimal;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_FrbDecimal;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_FrbDecimalPtr;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_ZakatManager;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_ZakatManager;

  CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ZakatManagerPtr;
}

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

  @override
  bool crateApiZakatDartZakatResultAutoAccessorGetIsPayable({
    required DartZakatResult that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_bool,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorGetIsPayableConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  String crateApiZakatDartZakatResultAutoAccessorGetLimitName({
    required DartZakatResult that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 2)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorGetLimitNameConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  FrbDecimal crateApiZakatDartZakatResultAutoAccessorGetNisabThreshold({
    required DartZakatResult that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 3)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorGetNisabThresholdConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  FrbDecimal crateApiZakatDartZakatResultAutoAccessorGetWealthAmount({
    required DartZakatResult that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 4)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorGetWealthAmountConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  FrbDecimal crateApiZakatDartZakatResultAutoAccessorGetZakatDue({
    required DartZakatResult that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 5)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorGetZakatDueConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  void crateApiZakatDartZakatResultAutoAccessorSetIsPayable({
    required DartZakatResult that,
    required bool isPayable,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          sse_encode_bool(isPayable, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 6)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorSetIsPayableConstMeta,
        argValues: [that, isPayable],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiZakatDartZakatResultAutoAccessorSetIsPayableConstMeta =>
      const TaskConstMeta(
        debugName: "DartZakatResult_auto_accessor_set_is_payable",
        argNames: ["that", "isPayable"],
      );

  @override
  void crateApiZakatDartZakatResultAutoAccessorSetLimitName({
    required DartZakatResult that,
    required String limitName,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          sse_encode_String(limitName, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 7)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorSetLimitNameConstMeta,
        argValues: [that, limitName],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiZakatDartZakatResultAutoAccessorSetLimitNameConstMeta =>
      const TaskConstMeta(
        debugName: "DartZakatResult_auto_accessor_set_limit_name",
        argNames: ["that", "limitName"],
      );

  @override
  void crateApiZakatDartZakatResultAutoAccessorSetNisabThreshold({
    required DartZakatResult that,
    required FrbDecimal nisabThreshold,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            nisabThreshold,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 8)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorSetNisabThresholdConstMeta,
        argValues: [that, nisabThreshold],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiZakatDartZakatResultAutoAccessorSetNisabThresholdConstMeta =>
      const TaskConstMeta(
        debugName: "DartZakatResult_auto_accessor_set_nisab_threshold",
        argNames: ["that", "nisabThreshold"],
      );

  @override
  void crateApiZakatDartZakatResultAutoAccessorSetWealthAmount({
    required DartZakatResult that,
    required FrbDecimal wealthAmount,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            wealthAmount,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 9)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorSetWealthAmountConstMeta,
        argValues: [that, wealthAmount],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiZakatDartZakatResultAutoAccessorSetWealthAmountConstMeta =>
      const TaskConstMeta(
        debugName: "DartZakatResult_auto_accessor_set_wealth_amount",
        argNames: ["that", "wealthAmount"],
      );

  @override
  void crateApiZakatDartZakatResultAutoAccessorSetZakatDue({
    required DartZakatResult that,
    required FrbDecimal zakatDue,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult(
            that,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            zakatDue,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 10)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_unit,
          decodeErrorData: null,
        ),
        constMeta:
            kCrateApiZakatDartZakatResultAutoAccessorSetZakatDueConstMeta,
        argValues: [that, zakatDue],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta
  get kCrateApiZakatDartZakatResultAutoAccessorSetZakatDueConstMeta =>
      const TaskConstMeta(
        debugName: "DartZakatResult_auto_accessor_set_zakat_due",
        argNames: ["that", "zakatDue"],
      );

  @override
  FrbDecimal crateApiZakatFrbDecimalFromString({required String s}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_String(s, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 11)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiZakatFrbDecimalFromStringConstMeta,
        argValues: [s],
        apiImpl: this,
      ),
    );
  }

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

  @override
  double crateApiZakatFrbDecimalToF64({required FrbDecimal that}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 12)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_f_64,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiZakatFrbDecimalToF64ConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  String crateApiZakatFrbDecimalToString({required FrbDecimal that}) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 13)!;
        },
        codec: SseCodec(
          decodeSuccessData: sse_decode_String,
          decodeErrorData: null,
        ),
        constMeta: kCrateApiZakatFrbDecimalToStringConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  DartZakatResult crateApiZakatZakatManagerCalculateBusiness({
    required ZakatManager that,
    required FrbDecimal cash,
    required FrbDecimal inventory,
    required FrbDecimal receivables,
    required FrbDecimal liabilities,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerZakatManager(
            that,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            cash,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            inventory,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            receivables,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            liabilities,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 14)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiZakatZakatManagerCalculateBusinessConstMeta,
        argValues: [that, cash, inventory, receivables, liabilities],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiZakatZakatManagerCalculateBusinessConstMeta =>
      const TaskConstMeta(
        debugName: "ZakatManager_calculate_business",
        argNames: ["that", "cash", "inventory", "receivables", "liabilities"],
      );

  @override
  DartZakatResult crateApiZakatZakatManagerCalculateSavings({
    required ZakatManager that,
    required FrbDecimal cashInHand,
    required FrbDecimal bankBalance,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerZakatManager(
            that,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            cashInHand,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            bankBalance,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 15)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiZakatZakatManagerCalculateSavingsConstMeta,
        argValues: [that, cashInHand, bankBalance],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiZakatZakatManagerCalculateSavingsConstMeta =>
      const TaskConstMeta(
        debugName: "ZakatManager_calculate_savings",
        argNames: ["that", "cashInHand", "bankBalance"],
      );

  @override
  (FrbDecimal, FrbDecimal) crateApiZakatZakatManagerGetNisabThresholds({
    required ZakatManager that,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerZakatManager(
            that,
            serializer,
          );
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 16)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_record_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiZakatZakatManagerGetNisabThresholdsConstMeta,
        argValues: [that],
        apiImpl: this,
      ),
    );
  }

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

  @override
  ZakatManager crateApiZakatZakatManagerNew({
    required FrbDecimal goldPrice,
    required FrbDecimal silverPrice,
    required String madhab,
  }) {
    return handler.executeSync(
      SyncTask(
        callFfi: () {
          final serializer = SseSerializer(generalizedFrbRustBinding);
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            goldPrice,
            serializer,
          );
          sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
            silverPrice,
            serializer,
          );
          sse_encode_String(madhab, serializer);
          return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 17)!;
        },
        codec: SseCodec(
          decodeSuccessData:
              sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerZakatManager,
          decodeErrorData: sse_decode_AnyhowException,
        ),
        constMeta: kCrateApiZakatZakatManagerNewConstMeta,
        argValues: [goldPrice, silverPrice, madhab],
        apiImpl: this,
      ),
    );
  }

  TaskConstMeta get kCrateApiZakatZakatManagerNewConstMeta =>
      const TaskConstMeta(
        debugName: "ZakatManager_new",
        argNames: ["goldPrice", "silverPrice", "madhab"],
      );

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

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

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_DartZakatResult => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_DartZakatResult => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerDartZakatResult;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_FrbDecimal => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_FrbDecimal => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal;

  RustArcIncrementStrongCountFnType
  get rust_arc_increment_strong_count_ZakatManager => wire
      .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerZakatManager;

  RustArcDecrementStrongCountFnType
  get rust_arc_decrement_strong_count_ZakatManager => wire
      .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerZakatManager;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @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
  (FrbDecimal, FrbDecimal)
  dco_decode_record_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal(
    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_generatedRustAutoOpaqueInnerFrbDecimal(
        arr[0],
      ),
      dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
        arr[1],
      ),
    );
  }

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

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

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

  @protected
  AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_String(deserializer);
    return AnyhowException(inner);
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

  @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
  (FrbDecimal, FrbDecimal)
  sse_decode_record_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal(
    SseDeserializer deserializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var var_field0 =
        sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
          deserializer,
        );
    var var_field1 =
        sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
          deserializer,
        );
    return (var_field0, var_field1);
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

  @protected
  void sse_encode_f_64(double self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putFloat64(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_record_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal_auto_owned_rust_opaque_flutter_rust_bridgefor_generated_rust_auto_opaque_inner_frb_decimal(
    (FrbDecimal, FrbDecimal) self,
    SseSerializer serializer,
  ) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
      self.$1,
      serializer,
    );
    sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerFrbDecimal(
      self.$2,
      serializer,
    );
  }

  @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_i_32(int self, SseSerializer serializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    serializer.buffer.putInt32(self);
  }
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_DartZakatResult,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_DartZakatResult,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_DartZakatResultPtr,
  );

  bool get isPayable => RustLib.instance.api
      .crateApiZakatDartZakatResultAutoAccessorGetIsPayable(that: this);

  String get limitName => RustLib.instance.api
      .crateApiZakatDartZakatResultAutoAccessorGetLimitName(that: this);

  FrbDecimal get nisabThreshold => RustLib.instance.api
      .crateApiZakatDartZakatResultAutoAccessorGetNisabThreshold(that: this);

  FrbDecimal get wealthAmount => RustLib.instance.api
      .crateApiZakatDartZakatResultAutoAccessorGetWealthAmount(that: this);

  FrbDecimal get zakatDue => RustLib.instance.api
      .crateApiZakatDartZakatResultAutoAccessorGetZakatDue(that: this);

  set isPayable(bool isPayable) =>
      RustLib.instance.api.crateApiZakatDartZakatResultAutoAccessorSetIsPayable(
        that: this,
        isPayable: isPayable,
      );

  set limitName(String limitName) =>
      RustLib.instance.api.crateApiZakatDartZakatResultAutoAccessorSetLimitName(
        that: this,
        limitName: limitName,
      );

  set nisabThreshold(FrbDecimal nisabThreshold) => RustLib.instance.api
      .crateApiZakatDartZakatResultAutoAccessorSetNisabThreshold(
        that: this,
        nisabThreshold: nisabThreshold,
      );

  set wealthAmount(FrbDecimal wealthAmount) => RustLib.instance.api
      .crateApiZakatDartZakatResultAutoAccessorSetWealthAmount(
        that: this,
        wealthAmount: wealthAmount,
      );

  set zakatDue(FrbDecimal zakatDue) =>
      RustLib.instance.api.crateApiZakatDartZakatResultAutoAccessorSetZakatDue(
        that: this,
        zakatDue: zakatDue,
      );
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_FrbDecimal,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_FrbDecimal,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_FrbDecimalPtr,
  );

  double toF64() =>
      RustLib.instance.api.crateApiZakatFrbDecimalToF64(that: this);

  String toString() =>
      RustLib.instance.api.crateApiZakatFrbDecimalToString(that: this);
}

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

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

  static final _kStaticData = RustArcStaticData(
    rustArcIncrementStrongCount:
        RustLib.instance.api.rust_arc_increment_strong_count_ZakatManager,
    rustArcDecrementStrongCount:
        RustLib.instance.api.rust_arc_decrement_strong_count_ZakatManager,
    rustArcDecrementStrongCountPtr:
        RustLib.instance.api.rust_arc_decrement_strong_count_ZakatManagerPtr,
  );

  DartZakatResult calculateBusiness({
    required FrbDecimal cash,
    required FrbDecimal inventory,
    required FrbDecimal receivables,
    required FrbDecimal liabilities,
  }) => RustLib.instance.api.crateApiZakatZakatManagerCalculateBusiness(
    that: this,
    cash: cash,
    inventory: inventory,
    receivables: receivables,
    liabilities: liabilities,
  );

  DartZakatResult calculateSavings({
    required FrbDecimal cashInHand,
    required FrbDecimal bankBalance,
  }) => RustLib.instance.api.crateApiZakatZakatManagerCalculateSavings(
    that: this,
    cashInHand: cashInHand,
    bankBalance: bankBalance,
  );

  (FrbDecimal, FrbDecimal) getNisabThresholds() => RustLib.instance.api
      .crateApiZakatZakatManagerGetNisabThresholds(that: this);
}
