6 namespace org { namespace ldk { namespace structs {
8 public class Result_WitnessNoneZ : CommonBase {
9 Result_WitnessNoneZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_WitnessNoneZ() {
11 if (ptr != 0) { bindings.CResult_WitnessNoneZ_free(ptr); }
14 internal static Result_WitnessNoneZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_WitnessNoneZ_is_ok(ptr)) {
16 return new Result_WitnessNoneZ_OK(null, ptr);
18 return new Result_WitnessNoneZ_Err(null, ptr);
21 public class Result_WitnessNoneZ_OK : Result_WitnessNoneZ {
22 public readonly byte[] res;
23 internal Result_WitnessNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_WitnessNoneZ_get_ok(ptr);
25 byte[] res_conv = InternalUtils.decodeUint8Array(res);
30 public class Result_WitnessNoneZ_Err : Result_WitnessNoneZ {
31 internal Result_WitnessNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
36 * Creates a new CResult_WitnessNoneZ in the success state.
38 public static Result_WitnessNoneZ ok(byte[] o) {
39 long ret = bindings.CResult_WitnessNoneZ_ok(InternalUtils.encodeUint8Array(o));
41 if (ret >= 0 && ret <= 4096) { return null; }
42 Result_WitnessNoneZ ret_hu_conv = Result_WitnessNoneZ.constr_from_ptr(ret);
47 * Creates a new CResult_WitnessNoneZ in the error state.
49 public static Result_WitnessNoneZ err() {
50 long ret = bindings.CResult_WitnessNoneZ_err();
51 if (ret >= 0 && ret <= 4096) { return null; }
52 Result_WitnessNoneZ ret_hu_conv = Result_WitnessNoneZ.constr_from_ptr(ret);
57 * Checks if the given object is currently in the success state
60 bool ret = bindings.CResult_WitnessNoneZ_is_ok(this.ptr);
65 internal long clone_ptr() {
66 long ret = bindings.CResult_WitnessNoneZ_clone_ptr(this.ptr);
72 * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
73 * but with all dynamically-allocated buffers duplicated in new buffers.
75 public Result_WitnessNoneZ clone() {
76 long ret = bindings.CResult_WitnessNoneZ_clone(this.ptr);
78 if (ret >= 0 && ret <= 4096) { return null; }
79 Result_WitnessNoneZ ret_hu_conv = Result_WitnessNoneZ.constr_from_ptr(ret);