// generated by diplomat-tool
// dart format off

part of 'lib.g.dart';

/// See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information.
final class DateFormatterGregorian implements ffi.Finalizable {
  final ffi.Pointer<ffi.Opaque> _ffi;

  // These are "used" in the sense that they keep dependencies alive
  // ignore: unused_field
  final core.List<Object> _selfEdge;

  // This takes in a list of lifetime edges (including for &self borrows)
  // corresponding to data this may borrow from. These should be flat arrays containing
  // references to objects, and this object will hold on to them to keep them alive and
  // maintain borrow validity.
  DateFormatterGregorian._fromFfi(this._ffi, this._selfEdge) {
    if (_selfEdge.isEmpty) {
      _icu4x_DateFormatterGregorian_destroy_mv1(this, _ffi.cast());
    }
  }

  // ignore: experimental_member_use
  @meta.RecordUse()
  // ignore: non_constant_identifier_names
  static void _icu4x_DateFormatterGregorian_destroy_mv1(DateFormatterGregorian cl, ffi.Pointer<ffi.Void> pointer) => _finalizer.attach(cl, pointer);

  static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_internal_icu4x_DateFormatterGregorian_destroy_mv1));

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `D`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.D.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.D.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.D.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.d(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_d_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `D`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.D.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.D.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.D.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.dWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_d_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `MD`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MD.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MD.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MD.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.md(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_md_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `MD`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MD.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MD.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MD.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.mdWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_md_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `YMD`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.ymd(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_ymd_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `YMD`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMD.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.ymdWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_ymd_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `DE`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.DE.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.DE.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.DE.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.de(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_de_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `DE`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.DE.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.DE.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.DE.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.deWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_de_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `MDE`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MDE.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MDE.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MDE.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.mde(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_mde_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `MDE`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MDE.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MDE.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.MDE.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.mdeWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_mde_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `YMDE`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.ymde(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_ymde_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `YMDE`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YMDE.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.ymdeWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_ymde_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `E`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.E.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.E.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.e(Locale locale, [DateTimeLength? length]) {
    final result = _icu4x_DateFormatterGregorian_create_e_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `E`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.E.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.E.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.eWithProvider(DataProvider provider, Locale locale, [DateTimeLength? length]) {
    final result = _icu4x_DateFormatterGregorian_create_e_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `M`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.M.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.M.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.M.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.m(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_m_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `M`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.M.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.M.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.M.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.mWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment}) {
    final result = _icu4x_DateFormatterGregorian_create_m_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `YM`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.ym(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_ym_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `YM`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.YM.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.ymWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_ym_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `Y`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.y(Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_y_mv1(locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `try_new`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.try_new) for more information.
  ///
  /// See the [Rust documentation for `Y`](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html) for more information.
  ///
  /// Additional information: [1](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html#method.with_alignment), [2](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html#method.with_year_style), [3](https://docs.rs/icu/2.2.0/icu/datetime/fieldsets/struct.Y.html#method.for_length)
  ///
  /// Throws [DateTimeFormatterLoadError] on failure.
  factory DateFormatterGregorian.yWithProvider(DataProvider provider, Locale locale, {DateTimeLength? length, DateTimeAlignment? alignment, YearStyle? yearStyle}) {
    final result = _icu4x_DateFormatterGregorian_create_y_with_provider_mv1(provider._ffi, locale._ffi, length != null ? _ResultInt32Void.ok(length.index) : _ResultInt32Void.err(), alignment != null ? _ResultInt32Void.ok(alignment.index) : _ResultInt32Void.err(), yearStyle != null ? _ResultInt32Void.ok(yearStyle.index) : _ResultInt32Void.err());
    if (!result.isOk) {
      throw DateTimeFormatterLoadError.values.firstWhere((v) => v._ffi == result.union.err);
    }
    return DateFormatterGregorian._fromFfi(result.union.ok, []);
  }

  /// See the [Rust documentation for `format`](https://docs.rs/icu/2.2.0/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
  String formatIso(IsoDate isoDate) {
    final write = _Write();
    _icu4x_DateFormatterGregorian_format_iso_mv1(_ffi, isoDate._ffi, write._ffi);
    return write.finalize();
  }

}

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_destroy_mv1')
// ignore: non_constant_identifier_names
external void _internal_icu4x_DateFormatterGregorian_destroy_mv1(ffi.Pointer<ffi.Void> self);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_d_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_d_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_d_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_d_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_md_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_md_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_md_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_md_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymd_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymd_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymd_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymd_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_de_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_de_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_de_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_de_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_mde_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_mde_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_mde_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_mde_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymde_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymde_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ymde_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ymde_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_e_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_e_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_e_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_e_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_m_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_m_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_m_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_m_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ym_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ym_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_ym_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_ym_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_y_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_y_mv1(ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, _ResultInt32Void, _ResultInt32Void, _ResultInt32Void)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_create_y_with_provider_mv1')
// ignore: non_constant_identifier_names
external _ResultOpaqueInt32 _icu4x_DateFormatterGregorian_create_y_with_provider_mv1(ffi.Pointer<ffi.Opaque> provider, ffi.Pointer<ffi.Opaque> locale, _ResultInt32Void length, _ResultInt32Void alignment, _ResultInt32Void yearStyle);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>, ffi.Pointer<ffi.Opaque>)>(isLeaf: true, symbol: 'icu4x_DateFormatterGregorian_format_iso_mv1')
// ignore: non_constant_identifier_names
external void _icu4x_DateFormatterGregorian_format_iso_mv1(ffi.Pointer<ffi.Opaque> self, ffi.Pointer<ffi.Opaque> isoDate, ffi.Pointer<ffi.Opaque> write);

// dart format on
