6 namespace org { namespace ldk { namespace structs {
8 public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ : CommonBase {
9 Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ() {
11 if (ptr != 0) { bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(ptr); }
14 internal static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(ptr)) {
16 return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(null, ptr);
18 return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(null, ptr);
21 public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK : Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
22 public readonly TwoTuple_PaymentHashPaymentSecretZ res;
23 internal Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(ptr);
25 TwoTuple_PaymentHashPaymentSecretZ res_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(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_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err : Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
32 public readonly APIError err;
33 internal Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34 long err = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(ptr);
35 org.ldk.structs.APIError err_hu_conv = org.ldk.structs.APIError.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_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
44 public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ok(org.ldk.structs.TwoTuple_PaymentHashPaymentSecretZ o) {
45 long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o != null ? o.ptr : 0);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
53 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
55 public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ err(org.ldk.structs.APIError e) {
56 long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e.ptr);
58 if (ret >= 0 && ret <= 4096) { return null; }
59 Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
64 * Checks if the given object is currently in the success state
67 bool ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(this.ptr);
72 internal long clone_ptr() {
73 long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(this.ptr);
79 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
80 * but with all dynamically-allocated buffers duplicated in new buffers.
82 public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ clone() {
83 long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(this.ptr);
85 if (ret >= 0 && ret <= 4096) { return null; }
86 Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);