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

part of 'lib.g.dart';

final class _VariantOffsetsFfi extends ffi.Struct {
  external ffi.Pointer<ffi.Opaque> standard;
  external ffi.Pointer<ffi.Opaque> daylight;
}

/// See the [Rust documentation for `VariantOffsets`](https://docs.rs/icu/2.2.0/icu/time/zone/struct.VariantOffsets.html) for more information.
final class VariantOffsets {
  // ignore: public_member_api_docs
  final UtcOffset standard;
  // ignore: public_member_api_docs
  final UtcOffset? daylight;

  // 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
  VariantOffsets._fromFfi(_VariantOffsetsFfi ffi) :
    standard = UtcOffset._fromFfi(ffi.standard, []),
    daylight = ffi.daylight.address == 0 ? null : UtcOffset._fromFfi(ffi.daylight, []);

  // ignore: unused_element
  _VariantOffsetsFfi _toFfi(ffi.Allocator temp) {
    final struct = ffi.Struct.create<_VariantOffsetsFfi>();
    struct.standard = standard._ffi;
    struct.daylight = daylight?._ffi ?? ffi.Pointer.fromAddress(0);
    return struct;
  }


  @override
  bool operator ==(Object other) =>
      other is VariantOffsets &&
      other.standard == standard &&
      other.daylight == daylight;

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

// dart format on
