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

part of 'lib.g.dart';

final class _DateAddOptionsFfi extends ffi.Struct {
  external _ResultInt32Void overflow;
}

/// See the [Rust documentation for `DateAddOptions`](https://docs.rs/icu/2.2.0/icu/calendar/options/struct.DateAddOptions.html) for more information.
final class DateAddOptions {
  // ignore: public_member_api_docs
  DateOverflow? overflow;

  // ignore: public_member_api_docs
  DateAddOptions({this.overflow});

  // This struct contains borrowed fields, so this takes in a list of
  // "edges" corresponding to where each lifetime's data may have been borrowed from
  // and passes it down to individual fields containing the borrow.
  // This method does not attempt to handle any dependencies between lifetimes, the caller
  // should handle this when constructing edge arrays.
  // ignore: unused_element
  DateAddOptions._fromFfi(_DateAddOptionsFfi ffi) :
    overflow = ffi.overflow.isOk ? DateOverflow.values[ffi.overflow.union.ok] : null;

  // ignore: unused_element
  _DateAddOptionsFfi _toFfi(ffi.Allocator temp) {
    final struct = ffi.Struct.create<_DateAddOptionsFfi>();
    final overflow = this.overflow;
    struct.overflow = overflow != null ? _ResultInt32Void.ok(overflow.index) : _ResultInt32Void.err();
    return struct;
  }


  @override
  bool operator ==(Object other) =>
      other is DateAddOptions &&
      other.overflow == overflow;

  @override
  int get hashCode => Object.hashAll([
        overflow,
      ]);
}

// dart format on
