6 namespace org { namespace ldk { namespace structs {
9 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
12 public class SignOrCreationError : CommonBase {
13 protected SignOrCreationError(object _dummy, long ptr) : base(ptr) { }
14 ~SignOrCreationError() {
15 if (ptr != 0) { bindings.SignOrCreationError_free(ptr); }
18 internal static SignOrCreationError constr_from_ptr(long ptr) {
19 long raw_ty = bindings.LDKSignOrCreationError_ty_from_ptr(ptr);
21 case 0: return new SignOrCreationError_SignError(ptr);
22 case 1: return new SignOrCreationError_CreationError(ptr);
24 throw new ArgumentException("Impossible enum variant");
28 /** A SignOrCreationError of type SignError */
29 public class SignOrCreationError_SignError : SignOrCreationError {
30 internal SignOrCreationError_SignError(long ptr) : base(null, ptr) {
33 /** A SignOrCreationError of type CreationError */
34 public class SignOrCreationError_CreationError : SignOrCreationError {
35 public CreationError creation_error;
36 internal SignOrCreationError_CreationError(long ptr) : base(null, ptr) {
37 this.creation_error = bindings.LDKSignOrCreationError_CreationError_get_creation_error(ptr);
40 internal long clone_ptr() {
41 long ret = bindings.SignOrCreationError_clone_ptr(this.ptr);
47 * Creates a copy of the SignOrCreationError
49 public SignOrCreationError clone() {
50 long ret = bindings.SignOrCreationError_clone(this.ptr);
52 if (ret >= 0 && ret <= 4096) { return null; }
53 org.ldk.structs.SignOrCreationError ret_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(ret);
54 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
59 * Utility method to constructs a new SignError-variant SignOrCreationError
61 public static SignOrCreationError sign_error() {
62 long ret = bindings.SignOrCreationError_sign_error();
63 if (ret >= 0 && ret <= 4096) { return null; }
64 org.ldk.structs.SignOrCreationError ret_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(ret);
65 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
70 * Utility method to constructs a new CreationError-variant SignOrCreationError
72 public static SignOrCreationError creation_error(CreationError a) {
73 long ret = bindings.SignOrCreationError_creation_error(a);
75 if (ret >= 0 && ret <= 4096) { return null; }
76 org.ldk.structs.SignOrCreationError ret_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(ret);
77 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
82 * Checks if two SignOrCreationErrors contain equal inner contents.
83 * This ignores pointers and is_owned flags and looks at the values in fields.
85 public bool eq(org.ldk.structs.SignOrCreationError b) {
86 bool ret = bindings.SignOrCreationError_eq(this.ptr, b == null ? 0 : b.ptr);
92 public override bool Equals(object o) {
93 if (!(o is SignOrCreationError)) return false;
94 return this.eq((SignOrCreationError)o);
97 * Get the string representation of a SignOrCreationError object
99 public string to_str() {
100 string ret = bindings.SignOrCreationError_to_str(this.ptr);