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

part of 'lib.g.dart';

/// See the [Rust documentation for `TimePrecision`](https://docs.rs/icu/2.2.0/icu/datetime/options/enum.TimePrecision.html) for more information.
///
/// See the [Rust documentation for `SubsecondDigits`](https://docs.rs/icu/2.2.0/icu/datetime/options/enum.SubsecondDigits.html) for more information.
enum TimePrecision {
  // ignore: public_member_api_docs
  hour,
  // ignore: public_member_api_docs
  minute,
  // ignore: public_member_api_docs
  minuteOptional,
  // ignore: public_member_api_docs
  second,
  // ignore: public_member_api_docs
  subsecond1,
  // ignore: public_member_api_docs
  subsecond2,
  // ignore: public_member_api_docs
  subsecond3,
  // ignore: public_member_api_docs
  subsecond4,
  // ignore: public_member_api_docs
  subsecond5,
  // ignore: public_member_api_docs
  subsecond6,
  // ignore: public_member_api_docs
  subsecond7,
  // ignore: public_member_api_docs
  subsecond8,
  // ignore: public_member_api_docs
  subsecond9;

  /// See the [Rust documentation for `try_from_int`](https://docs.rs/icu/2.2.0/icu/datetime/options/enum.SubsecondDigits.html#method.try_from_int) for more information.
  static TimePrecision? fromSubsecondDigits(int digits) {
    final result = _icu4x_TimePrecision_from_subsecond_digits_mv1(digits);
    if (!result.isOk) {
      return null;
    }
    return TimePrecision.values[result.union.ok];
  }

}

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_TimePrecision_from_subsecond_digits_mv1')
// ignore: non_constant_identifier_names
external _ResultInt32Void _icu4x_TimePrecision_from_subsecond_digits_mv1(int digits);

// dart format on
