6 namespace org { namespace ldk { namespace structs {
8 public class Result_PaymentHashPaymentSendFailureZ : CommonBase {
9 Result_PaymentHashPaymentSendFailureZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_PaymentHashPaymentSendFailureZ() {
11 if (ptr != 0) { bindings.CResult_PaymentHashPaymentSendFailureZ_free(ptr); }
14 internal static Result_PaymentHashPaymentSendFailureZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_PaymentHashPaymentSendFailureZ_is_ok(ptr)) {
16 return new Result_PaymentHashPaymentSendFailureZ_OK(null, ptr);
18 return new Result_PaymentHashPaymentSendFailureZ_Err(null, ptr);
21 public class Result_PaymentHashPaymentSendFailureZ_OK : Result_PaymentHashPaymentSendFailureZ {
22 public readonly byte[] res;
23 internal Result_PaymentHashPaymentSendFailureZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 this.res = bindings.CResult_PaymentHashPaymentSendFailureZ_get_ok(ptr);
28 public class Result_PaymentHashPaymentSendFailureZ_Err : Result_PaymentHashPaymentSendFailureZ {
29 public readonly PaymentSendFailure err;
30 internal Result_PaymentHashPaymentSendFailureZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
31 long err = bindings.CResult_PaymentHashPaymentSendFailureZ_get_err(ptr);
32 org.ldk.structs.PaymentSendFailure err_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(err);
33 if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
34 this.err = err_hu_conv;
39 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state.
41 public static Result_PaymentHashPaymentSendFailureZ ok(byte[] o) {
42 long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_ok(InternalUtils.check_arr_len(o, 32));
44 if (ret >= 0 && ret <= 4096) { return null; }
45 Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret);
50 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state.
52 public static Result_PaymentHashPaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) {
53 long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_err(e.ptr);
55 if (ret >= 0 && ret <= 4096) { return null; }
56 Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret);
61 * Checks if the given object is currently in the success state
64 bool ret = bindings.CResult_PaymentHashPaymentSendFailureZ_is_ok(this.ptr);
69 internal long clone_ptr() {
70 long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_clone_ptr(this.ptr);
76 * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig`
77 * but with all dynamically-allocated buffers duplicated in new buffers.
79 public Result_PaymentHashPaymentSendFailureZ clone() {
80 long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_clone(this.ptr);
82 if (ret >= 0 && ret <= 4096) { return null; }
83 Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret);