6 namespace org { namespace ldk { namespace structs {
8 public class Result_CVec_StrZIOErrorZ : CommonBase {
9 Result_CVec_StrZIOErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_CVec_StrZIOErrorZ() {
11 if (ptr != 0) { bindings.CResult_CVec_StrZIOErrorZ_free(ptr); }
14 internal static Result_CVec_StrZIOErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_CVec_StrZIOErrorZ_is_ok(ptr)) {
16 return new Result_CVec_StrZIOErrorZ_OK(null, ptr);
18 return new Result_CVec_StrZIOErrorZ_Err(null, ptr);
21 public class Result_CVec_StrZIOErrorZ_OK : Result_CVec_StrZIOErrorZ {
22 public readonly string[] res;
23 internal Result_CVec_StrZIOErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_CVec_StrZIOErrorZ_get_ok(ptr);
25 int res_conv_8_len = InternalUtils.getArrayLength(res);
26 string[] res_conv_8_arr = new string[res_conv_8_len];
27 for (int i = 0; i < res_conv_8_len; i++) {
28 long res_conv_8 = InternalUtils.getU64ArrayElem(res, i);
29 string res_conv_8_conv = InternalUtils.decodeString(res_conv_8);
30 res_conv_8_arr[i] = res_conv_8_conv;
32 bindings.free_buffer(res);
33 this.res = res_conv_8_arr;
37 public class Result_CVec_StrZIOErrorZ_Err : Result_CVec_StrZIOErrorZ {
38 public readonly IOError err;
39 internal Result_CVec_StrZIOErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
40 this.err = bindings.CResult_CVec_StrZIOErrorZ_get_err(ptr);
45 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
47 public static Result_CVec_StrZIOErrorZ ok(string[] o) {
48 long ret = bindings.CResult_CVec_StrZIOErrorZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_8 => InternalUtils.encodeString(o_conv_8))));
50 if (ret >= 0 && ret <= 4096) { return null; }
51 Result_CVec_StrZIOErrorZ ret_hu_conv = Result_CVec_StrZIOErrorZ.constr_from_ptr(ret);
56 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
58 public static Result_CVec_StrZIOErrorZ err(IOError e) {
59 long ret = bindings.CResult_CVec_StrZIOErrorZ_err(e);
61 if (ret >= 0 && ret <= 4096) { return null; }
62 Result_CVec_StrZIOErrorZ ret_hu_conv = Result_CVec_StrZIOErrorZ.constr_from_ptr(ret);
67 * Checks if the given object is currently in the success state
70 bool ret = bindings.CResult_CVec_StrZIOErrorZ_is_ok(this.ptr);
75 internal long clone_ptr() {
76 long ret = bindings.CResult_CVec_StrZIOErrorZ_clone_ptr(this.ptr);
82 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
83 * but with all dynamically-allocated buffers duplicated in new buffers.
85 public Result_CVec_StrZIOErrorZ clone() {
86 long ret = bindings.CResult_CVec_StrZIOErrorZ_clone(this.ptr);
88 if (ret >= 0 && ret <= 4096) { return null; }
89 Result_CVec_StrZIOErrorZ ret_hu_conv = Result_CVec_StrZIOErrorZ.constr_from_ptr(ret);