6 namespace org { namespace ldk { namespace structs {
8 public class Result_NoneSemanticErrorZ : CommonBase {
9 Result_NoneSemanticErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_NoneSemanticErrorZ() {
11 if (ptr != 0) { bindings.CResult_NoneSemanticErrorZ_free(ptr); }
14 internal static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_NoneSemanticErrorZ_is_ok(ptr)) {
16 return new Result_NoneSemanticErrorZ_OK(null, ptr);
18 return new Result_NoneSemanticErrorZ_Err(null, ptr);
21 public class Result_NoneSemanticErrorZ_OK : Result_NoneSemanticErrorZ {
22 internal Result_NoneSemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
26 public class Result_NoneSemanticErrorZ_Err : Result_NoneSemanticErrorZ {
27 public readonly SemanticError err;
28 internal Result_NoneSemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
29 this.err = bindings.CResult_NoneSemanticErrorZ_get_err(ptr);
34 * Creates a new CResult_NoneSemanticErrorZ in the success state.
36 public static Result_NoneSemanticErrorZ ok() {
37 long ret = bindings.CResult_NoneSemanticErrorZ_ok();
38 if (ret >= 0 && ret <= 4096) { return null; }
39 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
44 * Creates a new CResult_NoneSemanticErrorZ in the error state.
46 public static Result_NoneSemanticErrorZ err(SemanticError e) {
47 long ret = bindings.CResult_NoneSemanticErrorZ_err(e);
49 if (ret >= 0 && ret <= 4096) { return null; }
50 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
55 * Checks if the given object is currently in the success state
58 bool ret = bindings.CResult_NoneSemanticErrorZ_is_ok(this.ptr);
63 internal long clone_ptr() {
64 long ret = bindings.CResult_NoneSemanticErrorZ_clone_ptr(this.ptr);
70 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
71 * but with all dynamically-allocated buffers duplicated in new buffers.
73 public Result_NoneSemanticErrorZ clone() {
74 long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr);
76 if (ret >= 0 && ret <= 4096) { return null; }
77 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);