6 namespace org { namespace ldk { namespace structs {
9 * An enum which can either contain a crate::lightning::ln::channel_state::OutboundHTLCStateDetails or not
11 public class Option_OutboundHTLCStateDetailsZ : CommonBase {
12 protected Option_OutboundHTLCStateDetailsZ(object _dummy, long ptr) : base(ptr) { }
13 ~Option_OutboundHTLCStateDetailsZ() {
14 if (ptr != 0) { bindings.COption_OutboundHTLCStateDetailsZ_free(ptr); }
17 internal static Option_OutboundHTLCStateDetailsZ constr_from_ptr(long ptr) {
18 long raw_ty = bindings.LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr(ptr);
20 case 0: return new Option_OutboundHTLCStateDetailsZ_Some(ptr);
21 case 1: return new Option_OutboundHTLCStateDetailsZ_None(ptr);
23 throw new ArgumentException("Impossible enum variant");
27 /** A Option_OutboundHTLCStateDetailsZ of type Some */
28 public class Option_OutboundHTLCStateDetailsZ_Some : Option_OutboundHTLCStateDetailsZ {
29 public OutboundHTLCStateDetails some;
30 internal Option_OutboundHTLCStateDetailsZ_Some(long ptr) : base(null, ptr) {
31 this.some = bindings.LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some(ptr);
34 /** A Option_OutboundHTLCStateDetailsZ of type None */
35 public class Option_OutboundHTLCStateDetailsZ_None : Option_OutboundHTLCStateDetailsZ {
36 internal Option_OutboundHTLCStateDetailsZ_None(long ptr) : base(null, ptr) {
40 * Constructs a new COption_OutboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
42 public static Option_OutboundHTLCStateDetailsZ some(OutboundHTLCStateDetails o) {
43 long ret = bindings.COption_OutboundHTLCStateDetailsZ_some(o);
45 if (ret >= 0 && ret <= 4096) { return null; }
46 org.ldk.structs.Option_OutboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.constr_from_ptr(ret);
47 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
52 * Constructs a new COption_OutboundHTLCStateDetailsZ containing nothing
54 public static Option_OutboundHTLCStateDetailsZ none() {
55 long ret = bindings.COption_OutboundHTLCStateDetailsZ_none();
56 if (ret >= 0 && ret <= 4096) { return null; }
57 org.ldk.structs.Option_OutboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.constr_from_ptr(ret);
58 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
62 internal long clone_ptr() {
63 long ret = bindings.COption_OutboundHTLCStateDetailsZ_clone_ptr(this.ptr);
69 * Creates a new COption_OutboundHTLCStateDetailsZ which has the same data as `orig`
70 * but with all dynamically-allocated buffers duplicated in new buffers.
72 public Option_OutboundHTLCStateDetailsZ clone() {
73 long ret = bindings.COption_OutboundHTLCStateDetailsZ_clone(this.ptr);
75 if (ret >= 0 && ret <= 4096) { return null; }
76 org.ldk.structs.Option_OutboundHTLCStateDetailsZ ret_hu_conv = org.ldk.structs.Option_OutboundHTLCStateDetailsZ.constr_from_ptr(ret);
77 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };