1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 public class Result_NoneSemanticErrorZ extends CommonBase {
9 private Result_NoneSemanticErrorZ(Object _dummy, long ptr) { super(ptr); }
10 protected void finalize() throws Throwable {
11 if (ptr != 0) { bindings.CResult_NoneSemanticErrorZ_free(ptr); } super.finalize();
14 static Result_NoneSemanticErrorZ constr_from_ptr(long ptr) {
15 if (bindings.LDKCResult_NoneSemanticErrorZ_result_ok(ptr)) {
16 return new Result_NoneSemanticErrorZ_OK(null, ptr);
18 return new Result_NoneSemanticErrorZ_Err(null, ptr);
21 public static final class Result_NoneSemanticErrorZ_OK extends Result_NoneSemanticErrorZ {
22 private Result_NoneSemanticErrorZ_OK(Object _dummy, long ptr) {
27 public static final class Result_NoneSemanticErrorZ_Err extends Result_NoneSemanticErrorZ {
28 public final SemanticError err;
29 private Result_NoneSemanticErrorZ_Err(Object _dummy, long ptr) {
31 this.err = bindings.LDKCResult_NoneSemanticErrorZ_get_err(ptr);
36 * Creates a new CResult_NoneSemanticErrorZ in the success state.
38 public static Result_NoneSemanticErrorZ ok() {
39 long ret = bindings.CResult_NoneSemanticErrorZ_ok();
40 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
45 * Creates a new CResult_NoneSemanticErrorZ in the error state.
47 public static Result_NoneSemanticErrorZ err(SemanticError e) {
48 long ret = bindings.CResult_NoneSemanticErrorZ_err(e);
49 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
54 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
55 * but with all dynamically-allocated buffers duplicated in new buffers.
57 public Result_NoneSemanticErrorZ clone() {
58 long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr);
59 Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);