content: // generated by diplomat-tool
  // dart format off
  
  part of 'lib.g.dart';
  
  final class _MyStructContainingAnOptionFfi extends ffi.Struct {
    external _ResultMyStructFfiVoid a;
    external _ResultInt32Void b;
  }
  
  final class MyStructContainingAnOption {
    MyStruct? a;
    DefaultEnum? b;
  
    // 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
    MyStructContainingAnOption._fromFfi(_MyStructContainingAnOptionFfi ffi) :
      a = ffi.a.isOk ? MyStruct._fromFfi(ffi.a.union.ok) : null,
      b = ffi.b.isOk ? DefaultEnum.values[ffi.b.union.ok] : null;
  
    // ignore: unused_element
    _MyStructContainingAnOptionFfi _toFfi(ffi.Allocator temp) {
      final struct = ffi.Struct.create<_MyStructContainingAnOptionFfi>();
      MyStruct? a = this.a;
      struct.a = a != null ? _ResultMyStructFfiVoid.ok(a._toFfi(temp)) : _ResultMyStructFfiVoid.err();
      DefaultEnum? b = this.b;
      struct.b = b != null ? _ResultInt32Void.ok(b.index) : _ResultInt32Void.err();
      return struct;
    }
  
    factory MyStructContainingAnOption({MyStruct? a, DefaultEnum? b}) {
      final result = _MyStructContainingAnOption_new();
      final dart = MyStructContainingAnOption._fromFfi(result);
      if (a != null) {
        dart.a = a;
      }
      if (b != null) {
        dart.b = b;
      }
      return dart;
    }
  
    static MyStructContainingAnOption filled() {
      final result = _MyStructContainingAnOption_filled();
      return MyStructContainingAnOption._fromFfi(result);
    }
  
  
    @override
    bool operator ==(Object other) =>
        other is MyStructContainingAnOption &&
        other.a == a &&
        other.b == b;
  
    @override
    int get hashCode => Object.hashAll([
          a,
          b,
        ]);
  }
  
  @_DiplomatFfiUse('MyStructContainingAnOption_new')
  @ffi.Native<_MyStructContainingAnOptionFfi Function()>(isLeaf: true, symbol: 'MyStructContainingAnOption_new')
  // ignore: non_constant_identifier_names
  external _MyStructContainingAnOptionFfi _MyStructContainingAnOption_new();
  
  @_DiplomatFfiUse('MyStructContainingAnOption_filled')
  @ffi.Native<_MyStructContainingAnOptionFfi Function()>(isLeaf: true, symbol: 'MyStructContainingAnOption_filled')
  // ignore: non_constant_identifier_names
  external _MyStructContainingAnOptionFfi _MyStructContainingAnOption_filled();
  
  // dart format on
  