6 namespace org { namespace ldk { namespace structs {
8 public class Result_InvoiceRequestBolt12SemanticErrorZ : CommonBase {
9 Result_InvoiceRequestBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_InvoiceRequestBolt12SemanticErrorZ() {
11 if (ptr != 0) { bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_free(ptr); }
14 internal static Result_InvoiceRequestBolt12SemanticErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(ptr)) {
16 return new Result_InvoiceRequestBolt12SemanticErrorZ_OK(null, ptr);
18 return new Result_InvoiceRequestBolt12SemanticErrorZ_Err(null, ptr);
21 public class Result_InvoiceRequestBolt12SemanticErrorZ_OK : Result_InvoiceRequestBolt12SemanticErrorZ {
22 public readonly InvoiceRequest res;
23 internal Result_InvoiceRequestBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(ptr);
25 org.ldk.structs.InvoiceRequest res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequest(null, res); }
26 if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); };
27 this.res = res_hu_conv;
31 public class Result_InvoiceRequestBolt12SemanticErrorZ_Err : Result_InvoiceRequestBolt12SemanticErrorZ {
32 public readonly Bolt12SemanticError err;
33 internal Result_InvoiceRequestBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34 this.err = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(ptr);
39 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state.
41 public static Result_InvoiceRequestBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceRequest o) {
42 long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_ok(o.ptr);
44 if (ret >= 0 && ret <= 4096) { return null; }
45 Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret);
46 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); };
51 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state.
53 public static Result_InvoiceRequestBolt12SemanticErrorZ err(Bolt12SemanticError e) {
54 long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_err(e);
56 if (ret >= 0 && ret <= 4096) { return null; }
57 Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret);
62 * Checks if the given object is currently in the success state
65 bool ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(this.ptr);
70 internal long clone_ptr() {
71 long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(this.ptr);
77 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
78 * but with all dynamically-allocated buffers duplicated in new buffers.
80 public Result_InvoiceRequestBolt12SemanticErrorZ clone() {
81 long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_clone(this.ptr);
83 if (ret >= 0 && ret <= 4096) { return null; }
84 Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret);