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

part of 'lib.g.dart';

final class _TimeZoneAndCanonicalFfi extends ffi.Struct {
  external ffi.Pointer<ffi.Opaque> timeZone;
  external _SliceUtf8 canonical;
}

/// See the [Rust documentation for `TimeZoneAndCanonical`](https://docs.rs/icu/2.2.0/icu/time/zone/iana/struct.TimeZoneAndCanonical.html) for more information.
final class TimeZoneAndCanonical {
  // ignore: public_member_api_docs
  final TimeZone timeZone;
  // ignore: public_member_api_docs
  final String canonical;

  // ignore: unused_element
  TimeZoneAndCanonical._fromFfi(_TimeZoneAndCanonicalFfi ffi, core.List<Object> aEdges) :
    timeZone = TimeZone._fromFfi(ffi.timeZone, []),
    canonical = ffi.canonical._toDart(aEdges);

  // If this struct contains any slices, their lifetime-edge-relevant objects (typically _FinalizedArenas) will only
  // be constructed here, and can be appended to any relevant lifetime arrays here. <lifetime>AppendArray accepts a list
  // of arrays for each lifetime to do so. It accepts multiple lists per lifetime in case the caller needs to tie a lifetime to multiple
  // output arrays. Null is equivalent to an empty list: this lifetime is not being borrowed from.
  // ignore: unused_element
  _TimeZoneAndCanonicalFfi _toFfi(ffi.Allocator temp, {core.List<core.List<Object>> aAppendArray = const []}) {
    final struct = ffi.Struct.create<_TimeZoneAndCanonicalFfi>();
    struct.timeZone = timeZone._ffi;
    struct.canonical = canonical._utf8AllocIn(aAppendArray.isNotEmpty ? _FinalizedArena.withLifetime(aAppendArray).arena : temp);
    return struct;
  }


  @override
  bool operator ==(Object other) =>
      other is TimeZoneAndCanonical &&
      other.timeZone == timeZone &&
      other.canonical == canonical;

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

  // Return all fields corresponding to lifetime `'a`
  // without handling lifetime dependencies (this is the job of the caller)
  // This is all fields that may be borrowed from if borrowing `'a`,
  // assuming that there are no `'other: a`. bounds. In case of such bounds,
  // the caller should take care to also call _fieldsForLifetimeOther
  // ignore: unused_element
  core.List<Object> get _fieldsForLifetimeA => [canonical];
}

// dart format on
