6 namespace org { namespace ldk { namespace structs {
8 public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ : CommonBase {
9 Result_SignedRawBolt11InvoiceBolt11ParseErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_SignedRawBolt11InvoiceBolt11ParseErrorZ() {
11 if (ptr != 0) { bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(ptr); }
14 internal static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(ptr)) {
16 return new Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_OK(null, ptr);
18 return new Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_Err(null, ptr);
21 public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_OK : Result_SignedRawBolt11InvoiceBolt11ParseErrorZ {
22 public readonly SignedRawBolt11Invoice res;
23 internal Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_ok(ptr);
25 org.ldk.structs.SignedRawBolt11Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.SignedRawBolt11Invoice(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_SignedRawBolt11InvoiceBolt11ParseErrorZ_Err : Result_SignedRawBolt11InvoiceBolt11ParseErrorZ {
32 public readonly Bolt11ParseError err;
33 internal Result_SignedRawBolt11InvoiceBolt11ParseErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34 long err = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_get_err(ptr);
35 org.ldk.structs.Bolt11ParseError err_hu_conv = org.ldk.structs.Bolt11ParseError.constr_from_ptr(err);
36 if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
37 this.err = err_hu_conv;
42 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
44 public static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ok(org.ldk.structs.SignedRawBolt11Invoice o) {
45 long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret);
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); };
54 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
56 public static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ err(org.ldk.structs.Bolt11ParseError e) {
57 long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e.ptr);
59 if (ret >= 0 && ret <= 4096) { return null; }
60 Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret);
61 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); };
66 * Checks if the given object is currently in the success state
69 bool ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(this.ptr);
74 internal long clone_ptr() {
75 long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(this.ptr);
81 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
82 * but with all dynamically-allocated buffers duplicated in new buffers.
84 public Result_SignedRawBolt11InvoiceBolt11ParseErrorZ clone() {
85 long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(this.ptr);
87 if (ret >= 0 && ret <= 4096) { return null; }
88 Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret);