6 namespace org { namespace ldk { namespace structs {
8 public class Result_PaymentSecretNoneZ : CommonBase {
9 Result_PaymentSecretNoneZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_PaymentSecretNoneZ() {
11 if (ptr != 0) { bindings.CResult_PaymentSecretNoneZ_free(ptr); }
14 internal static Result_PaymentSecretNoneZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_PaymentSecretNoneZ_is_ok(ptr)) {
16 return new Result_PaymentSecretNoneZ_OK(null, ptr);
18 return new Result_PaymentSecretNoneZ_Err(null, ptr);
21 public class Result_PaymentSecretNoneZ_OK : Result_PaymentSecretNoneZ {
22 public readonly byte[] res;
23 internal Result_PaymentSecretNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 this.res = bindings.CResult_PaymentSecretNoneZ_get_ok(ptr);
28 public class Result_PaymentSecretNoneZ_Err : Result_PaymentSecretNoneZ {
29 internal Result_PaymentSecretNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34 * Creates a new CResult_PaymentSecretNoneZ in the success state.
36 public static Result_PaymentSecretNoneZ ok(byte[] o) {
37 long ret = bindings.CResult_PaymentSecretNoneZ_ok(InternalUtils.check_arr_len(o, 32));
39 if (ret >= 0 && ret <= 4096) { return null; }
40 Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
45 * Creates a new CResult_PaymentSecretNoneZ in the error state.
47 public static Result_PaymentSecretNoneZ err() {
48 long ret = bindings.CResult_PaymentSecretNoneZ_err();
49 if (ret >= 0 && ret <= 4096) { return null; }
50 Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
55 * Checks if the given object is currently in the success state
58 bool ret = bindings.CResult_PaymentSecretNoneZ_is_ok(this.ptr);
63 internal long clone_ptr() {
64 long ret = bindings.CResult_PaymentSecretNoneZ_clone_ptr(this.ptr);
70 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
71 * but with all dynamically-allocated buffers duplicated in new buffers.
73 public Result_PaymentSecretNoneZ clone() {
74 long ret = bindings.CResult_PaymentSecretNoneZ_clone(this.ptr);
76 if (ret >= 0 && ret <= 4096) { return null; }
77 Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);