6 namespace org { namespace ldk { namespace structs {
8 public class Result_StringErrorZ : CommonBase {
9 Result_StringErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_StringErrorZ() {
11 if (ptr != 0) { bindings.CResult_StringErrorZ_free(ptr); }
14 internal static Result_StringErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_StringErrorZ_is_ok(ptr)) {
16 return new Result_StringErrorZ_OK(null, ptr);
18 return new Result_StringErrorZ_Err(null, ptr);
21 public class Result_StringErrorZ_OK : Result_StringErrorZ {
22 public readonly string res;
23 internal Result_StringErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 this.res = bindings.CResult_StringErrorZ_get_ok(ptr);
28 public class Result_StringErrorZ_Err : Result_StringErrorZ {
29 public readonly Secp256k1Error err;
30 internal Result_StringErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
31 this.err = bindings.CResult_StringErrorZ_get_err(ptr);
36 * Creates a new CResult_StringErrorZ in the success state.
38 public static Result_StringErrorZ ok(string o) {
39 long ret = bindings.CResult_StringErrorZ_ok(o);
41 if (ret >= 0 && ret <= 4096) { return null; }
42 Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
47 * Creates a new CResult_StringErrorZ in the error state.
49 public static Result_StringErrorZ err(Secp256k1Error e) {
50 long ret = bindings.CResult_StringErrorZ_err(e);
52 if (ret >= 0 && ret <= 4096) { return null; }
53 Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
58 * Checks if the given object is currently in the success state
61 bool ret = bindings.CResult_StringErrorZ_is_ok(this.ptr);
66 internal long clone_ptr() {
67 long ret = bindings.CResult_StringErrorZ_clone_ptr(this.ptr);
73 * Creates a new CResult_StringErrorZ which has the same data as `orig`
74 * but with all dynamically-allocated buffers duplicated in new buffers.
76 public Result_StringErrorZ clone() {
77 long ret = bindings.CResult_StringErrorZ_clone(this.ptr);
79 if (ret >= 0 && ret <= 4096) { return null; }
80 Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);