6 namespace org { namespace ldk { namespace structs {
9 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
11 public class Option_UtxoLookupZ : CommonBase {
12 protected Option_UtxoLookupZ(object _dummy, long ptr) : base(ptr) { }
13 ~Option_UtxoLookupZ() {
14 if (ptr != 0) { bindings.COption_UtxoLookupZ_free(ptr); }
17 internal static Option_UtxoLookupZ constr_from_ptr(long ptr) {
18 long raw_ty = bindings.LDKCOption_UtxoLookupZ_ty_from_ptr(ptr);
20 case 0: return new Option_UtxoLookupZ_Some(ptr);
21 case 1: return new Option_UtxoLookupZ_None(ptr);
23 throw new ArgumentException("Impossible enum variant");
27 /** A Option_UtxoLookupZ of type Some */
28 public class Option_UtxoLookupZ_Some : Option_UtxoLookupZ {
29 public UtxoLookup some;
30 internal Option_UtxoLookupZ_Some(long ptr) : base(null, ptr) {
31 long some = bindings.LDKCOption_UtxoLookupZ_Some_get_some(ptr);
32 UtxoLookup ret_hu_conv = new UtxoLookup(null, some);
33 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
34 this.some = ret_hu_conv;
37 /** A Option_UtxoLookupZ of type None */
38 public class Option_UtxoLookupZ_None : Option_UtxoLookupZ {
39 internal Option_UtxoLookupZ_None(long ptr) : base(null, ptr) {
43 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
45 public static Option_UtxoLookupZ some(org.ldk.structs.UtxoLookup o) {
46 long ret = bindings.COption_UtxoLookupZ_some(o.ptr);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 org.ldk.structs.Option_UtxoLookupZ ret_hu_conv = org.ldk.structs.Option_UtxoLookupZ.constr_from_ptr(ret);
50 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
51 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); };
56 * Constructs a new COption_UtxoLookupZ containing nothing
58 public static Option_UtxoLookupZ none() {
59 long ret = bindings.COption_UtxoLookupZ_none();
60 if (ret >= 0 && ret <= 4096) { return null; }
61 org.ldk.structs.Option_UtxoLookupZ ret_hu_conv = org.ldk.structs.Option_UtxoLookupZ.constr_from_ptr(ret);
62 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };