6 namespace org { namespace ldk { namespace structs {
8 public class Result_CVec_u8ZIOErrorZ : CommonBase {
9 Result_CVec_u8ZIOErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_CVec_u8ZIOErrorZ() {
11 if (ptr != 0) { bindings.CResult_CVec_u8ZIOErrorZ_free(ptr); }
14 internal static Result_CVec_u8ZIOErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_CVec_u8ZIOErrorZ_is_ok(ptr)) {
16 return new Result_CVec_u8ZIOErrorZ_OK(null, ptr);
18 return new Result_CVec_u8ZIOErrorZ_Err(null, ptr);
21 public class Result_CVec_u8ZIOErrorZ_OK : Result_CVec_u8ZIOErrorZ {
22 public readonly byte[] res;
23 internal Result_CVec_u8ZIOErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_CVec_u8ZIOErrorZ_get_ok(ptr);
25 byte[] res_conv = InternalUtils.decodeUint8Array(res);
30 public class Result_CVec_u8ZIOErrorZ_Err : Result_CVec_u8ZIOErrorZ {
31 public readonly IOError err;
32 internal Result_CVec_u8ZIOErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
33 this.err = bindings.CResult_CVec_u8ZIOErrorZ_get_err(ptr);
38 * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
40 public static Result_CVec_u8ZIOErrorZ ok(byte[] o) {
41 long ret = bindings.CResult_CVec_u8ZIOErrorZ_ok(InternalUtils.encodeUint8Array(o));
43 if (ret >= 0 && ret <= 4096) { return null; }
44 Result_CVec_u8ZIOErrorZ ret_hu_conv = Result_CVec_u8ZIOErrorZ.constr_from_ptr(ret);
49 * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
51 public static Result_CVec_u8ZIOErrorZ err(IOError e) {
52 long ret = bindings.CResult_CVec_u8ZIOErrorZ_err(e);
54 if (ret >= 0 && ret <= 4096) { return null; }
55 Result_CVec_u8ZIOErrorZ ret_hu_conv = Result_CVec_u8ZIOErrorZ.constr_from_ptr(ret);
60 * Checks if the given object is currently in the success state
63 bool ret = bindings.CResult_CVec_u8ZIOErrorZ_is_ok(this.ptr);
68 internal long clone_ptr() {
69 long ret = bindings.CResult_CVec_u8ZIOErrorZ_clone_ptr(this.ptr);
75 * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
76 * but with all dynamically-allocated buffers duplicated in new buffers.
78 public Result_CVec_u8ZIOErrorZ clone() {
79 long ret = bindings.CResult_CVec_u8ZIOErrorZ_clone(this.ptr);
81 if (ret >= 0 && ret <= 4096) { return null; }
82 Result_CVec_u8ZIOErrorZ ret_hu_conv = Result_CVec_u8ZIOErrorZ.constr_from_ptr(ret);