6 namespace org { namespace ldk { namespace structs {
8 public class Result_CVec_UtxoZNoneZ : CommonBase {
9 Result_CVec_UtxoZNoneZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_CVec_UtxoZNoneZ() {
11 if (ptr != 0) { bindings.CResult_CVec_UtxoZNoneZ_free(ptr); }
14 internal static Result_CVec_UtxoZNoneZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_CVec_UtxoZNoneZ_is_ok(ptr)) {
16 return new Result_CVec_UtxoZNoneZ_OK(null, ptr);
18 return new Result_CVec_UtxoZNoneZ_Err(null, ptr);
21 public class Result_CVec_UtxoZNoneZ_OK : Result_CVec_UtxoZNoneZ {
22 public readonly Utxo[] res;
23 internal Result_CVec_UtxoZNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_CVec_UtxoZNoneZ_get_ok(ptr);
25 int res_conv_6_len = InternalUtils.getArrayLength(res);
26 Utxo[] res_conv_6_arr = new Utxo[res_conv_6_len];
27 for (int g = 0; g < res_conv_6_len; g++) {
28 long res_conv_6 = InternalUtils.getU64ArrayElem(res, g);
29 org.ldk.structs.Utxo res_conv_6_hu_conv = null; if (res_conv_6 < 0 || res_conv_6 > 4096) { res_conv_6_hu_conv = new org.ldk.structs.Utxo(null, res_conv_6); }
30 if (res_conv_6_hu_conv != null) { res_conv_6_hu_conv.ptrs_to.AddLast(this); };
31 res_conv_6_arr[g] = res_conv_6_hu_conv;
33 bindings.free_buffer(res);
34 this.res = res_conv_6_arr;
38 public class Result_CVec_UtxoZNoneZ_Err : Result_CVec_UtxoZNoneZ {
39 internal Result_CVec_UtxoZNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
44 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
46 public static Result_CVec_UtxoZNoneZ ok(Utxo[] o) {
47 long ret = bindings.CResult_CVec_UtxoZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_6 => o_conv_6 == null ? 0 : o_conv_6.ptr)));
49 if (ret >= 0 && ret <= 4096) { return null; }
50 Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret);
51 foreach (Utxo o_conv_6 in o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_conv_6); }; };
56 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
58 public static Result_CVec_UtxoZNoneZ err() {
59 long ret = bindings.CResult_CVec_UtxoZNoneZ_err();
60 if (ret >= 0 && ret <= 4096) { return null; }
61 Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret);
66 * Checks if the given object is currently in the success state
69 bool ret = bindings.CResult_CVec_UtxoZNoneZ_is_ok(this.ptr);
74 internal long clone_ptr() {
75 long ret = bindings.CResult_CVec_UtxoZNoneZ_clone_ptr(this.ptr);
81 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
82 * but with all dynamically-allocated buffers duplicated in new buffers.
84 public Result_CVec_UtxoZNoneZ clone() {
85 long ret = bindings.CResult_CVec_UtxoZNoneZ_clone(this.ptr);
87 if (ret >= 0 && ret <= 4096) { return null; }
88 Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret);