[Java] Update auto-generated Java bindings to LDK 0.0.121
[ldk-java] / src / main / java / org / ldk / structs / ChannelMessageHandler.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
9
10 /**
11  * A trait to describe an object which can receive channel messages.
12  * 
13  * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
14  * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
15  */
16 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
17 public class ChannelMessageHandler extends CommonBase {
18         final bindings.LDKChannelMessageHandler bindings_instance;
19         ChannelMessageHandler(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
20         private ChannelMessageHandler(bindings.LDKChannelMessageHandler arg, bindings.LDKMessageSendEventsProvider MessageSendEventsProvider) {
21                 super(bindings.LDKChannelMessageHandler_new(arg, MessageSendEventsProvider));
22                 this.ptrs_to.add(arg);
23                 this.ptrs_to.add(MessageSendEventsProvider);
24                 this.bindings_instance = arg;
25         }
26         @Override @SuppressWarnings("deprecation")
27         protected void finalize() throws Throwable {
28                 if (ptr != 0) { bindings.ChannelMessageHandler_free(ptr); } super.finalize();
29         }
30         /**
31          * Destroys the object, freeing associated resources. After this call, any access
32          * to this object may result in a SEGFAULT or worse.
33          *
34          * You should generally NEVER call this method. You should let the garbage collector
35          * do this for you when it finalizes objects. However, it may be useful for types
36          * which represent locks and should be closed immediately to avoid holding locks
37          * until the GC runs.
38          */
39         public void destroy() {
40                 if (ptr != 0) { bindings.ChannelMessageHandler_free(ptr); }
41                 ptr = 0;
42         }
43         public static interface ChannelMessageHandlerInterface {
44                 /**
45                  * Handle an incoming `open_channel` message from the given peer.
46                  */
47                 void handle_open_channel(byte[] their_node_id, OpenChannel msg);
48                 /**
49                  * Handle an incoming `open_channel2` message from the given peer.
50                  */
51                 void handle_open_channel_v2(byte[] their_node_id, OpenChannelV2 msg);
52                 /**
53                  * Handle an incoming `accept_channel` message from the given peer.
54                  */
55                 void handle_accept_channel(byte[] their_node_id, AcceptChannel msg);
56                 /**
57                  * Handle an incoming `accept_channel2` message from the given peer.
58                  */
59                 void handle_accept_channel_v2(byte[] their_node_id, AcceptChannelV2 msg);
60                 /**
61                  * Handle an incoming `funding_created` message from the given peer.
62                  */
63                 void handle_funding_created(byte[] their_node_id, FundingCreated msg);
64                 /**
65                  * Handle an incoming `funding_signed` message from the given peer.
66                  */
67                 void handle_funding_signed(byte[] their_node_id, FundingSigned msg);
68                 /**
69                  * Handle an incoming `channel_ready` message from the given peer.
70                  */
71                 void handle_channel_ready(byte[] their_node_id, ChannelReady msg);
72                 /**
73                  * Handle an incoming `shutdown` message from the given peer.
74                  */
75                 void handle_shutdown(byte[] their_node_id, Shutdown msg);
76                 /**
77                  * Handle an incoming `closing_signed` message from the given peer.
78                  */
79                 void handle_closing_signed(byte[] their_node_id, ClosingSigned msg);
80                 /**
81                  * Handle an incoming `stfu` message from the given peer.
82                  */
83                 void handle_stfu(byte[] their_node_id, Stfu msg);
84                 /**
85                  * Handle an incoming `splice` message from the given peer.
86                  */
87                 void handle_splice(byte[] their_node_id, Splice msg);
88                 /**
89                  * Handle an incoming `splice_ack` message from the given peer.
90                  */
91                 void handle_splice_ack(byte[] their_node_id, SpliceAck msg);
92                 /**
93                  * Handle an incoming `splice_locked` message from the given peer.
94                  */
95                 void handle_splice_locked(byte[] their_node_id, SpliceLocked msg);
96                 /**
97                  * Handle an incoming `tx_add_input message` from the given peer.
98                  */
99                 void handle_tx_add_input(byte[] their_node_id, TxAddInput msg);
100                 /**
101                  * Handle an incoming `tx_add_output` message from the given peer.
102                  */
103                 void handle_tx_add_output(byte[] their_node_id, TxAddOutput msg);
104                 /**
105                  * Handle an incoming `tx_remove_input` message from the given peer.
106                  */
107                 void handle_tx_remove_input(byte[] their_node_id, TxRemoveInput msg);
108                 /**
109                  * Handle an incoming `tx_remove_output` message from the given peer.
110                  */
111                 void handle_tx_remove_output(byte[] their_node_id, TxRemoveOutput msg);
112                 /**
113                  * Handle an incoming `tx_complete message` from the given peer.
114                  */
115                 void handle_tx_complete(byte[] their_node_id, TxComplete msg);
116                 /**
117                  * Handle an incoming `tx_signatures` message from the given peer.
118                  */
119                 void handle_tx_signatures(byte[] their_node_id, TxSignatures msg);
120                 /**
121                  * Handle an incoming `tx_init_rbf` message from the given peer.
122                  */
123                 void handle_tx_init_rbf(byte[] their_node_id, TxInitRbf msg);
124                 /**
125                  * Handle an incoming `tx_ack_rbf` message from the given peer.
126                  */
127                 void handle_tx_ack_rbf(byte[] their_node_id, TxAckRbf msg);
128                 /**
129                  * Handle an incoming `tx_abort message` from the given peer.
130                  */
131                 void handle_tx_abort(byte[] their_node_id, TxAbort msg);
132                 /**
133                  * Handle an incoming `update_add_htlc` message from the given peer.
134                  */
135                 void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg);
136                 /**
137                  * Handle an incoming `update_fulfill_htlc` message from the given peer.
138                  */
139                 void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg);
140                 /**
141                  * Handle an incoming `update_fail_htlc` message from the given peer.
142                  */
143                 void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg);
144                 /**
145                  * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
146                  */
147                 void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg);
148                 /**
149                  * Handle an incoming `commitment_signed` message from the given peer.
150                  */
151                 void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg);
152                 /**
153                  * Handle an incoming `revoke_and_ack` message from the given peer.
154                  */
155                 void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg);
156                 /**
157                  * Handle an incoming `update_fee` message from the given peer.
158                  */
159                 void handle_update_fee(byte[] their_node_id, UpdateFee msg);
160                 /**
161                  * Handle an incoming `announcement_signatures` message from the given peer.
162                  */
163                 void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg);
164                 /**
165                  * Indicates a connection to the peer failed/an existing connection was lost.
166                  */
167                 void peer_disconnected(byte[] their_node_id);
168                 /**
169                  * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
170                  * 
171                  * May return an `Err(())` if the features the peer supports are not sufficient to communicate
172                  * with us. Implementors should be somewhat conservative about doing so, however, as other
173                  * message handlers may still wish to communicate with this peer.
174                  */
175                 Result_NoneNoneZ peer_connected(byte[] their_node_id, Init msg, boolean inbound);
176                 /**
177                  * Handle an incoming `channel_reestablish` message from the given peer.
178                  */
179                 void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg);
180                 /**
181                  * Handle an incoming `channel_update` message from the given peer.
182                  */
183                 void handle_channel_update(byte[] their_node_id, ChannelUpdate msg);
184                 /**
185                  * Handle an incoming `error` message from the given peer.
186                  */
187                 void handle_error(byte[] their_node_id, ErrorMessage msg);
188                 /**
189                  * Gets the node feature flags which this handler itself supports. All available handlers are
190                  * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
191                  * which are broadcasted in our [`NodeAnnouncement`] message.
192                  */
193                 NodeFeatures provided_node_features();
194                 /**
195                  * Gets the init feature flags which should be sent to the given peer. All available handlers
196                  * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
197                  * which are sent in our [`Init`] message.
198                  * 
199                  * Note that this method is called before [`Self::peer_connected`].
200                  */
201                 InitFeatures provided_init_features(byte[] their_node_id);
202                 /**
203                  * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
204                  * 
205                  * If it's `None`, then no particular network chain hash compatibility will be enforced when
206                  * connecting to peers.
207                  */
208                 Option_CVec_ThirtyTwoBytesZZ get_chain_hashes();
209         }
210         private static class LDKChannelMessageHandlerHolder { ChannelMessageHandler held; }
211         public static ChannelMessageHandler new_impl(ChannelMessageHandlerInterface arg, MessageSendEventsProvider.MessageSendEventsProviderInterface MessageSendEventsProvider_impl) {
212                 final LDKChannelMessageHandlerHolder impl_holder = new LDKChannelMessageHandlerHolder();
213                 impl_holder.held = new ChannelMessageHandler(new bindings.LDKChannelMessageHandler() {
214                         @Override public void handle_open_channel(byte[] their_node_id, long msg) {
215                                 org.ldk.structs.OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannel(null, msg); }
216                                 arg.handle_open_channel(their_node_id, msg_hu_conv);
217                                 Reference.reachabilityFence(arg);
218                         }
219                         @Override public void handle_open_channel_v2(byte[] their_node_id, long msg) {
220                                 org.ldk.structs.OpenChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.OpenChannelV2(null, msg); }
221                                 arg.handle_open_channel_v2(their_node_id, msg_hu_conv);
222                                 Reference.reachabilityFence(arg);
223                         }
224                         @Override public void handle_accept_channel(byte[] their_node_id, long msg) {
225                                 org.ldk.structs.AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannel(null, msg); }
226                                 arg.handle_accept_channel(their_node_id, msg_hu_conv);
227                                 Reference.reachabilityFence(arg);
228                         }
229                         @Override public void handle_accept_channel_v2(byte[] their_node_id, long msg) {
230                                 org.ldk.structs.AcceptChannelV2 msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AcceptChannelV2(null, msg); }
231                                 arg.handle_accept_channel_v2(their_node_id, msg_hu_conv);
232                                 Reference.reachabilityFence(arg);
233                         }
234                         @Override public void handle_funding_created(byte[] their_node_id, long msg) {
235                                 org.ldk.structs.FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingCreated(null, msg); }
236                                 arg.handle_funding_created(their_node_id, msg_hu_conv);
237                                 Reference.reachabilityFence(arg);
238                         }
239                         @Override public void handle_funding_signed(byte[] their_node_id, long msg) {
240                                 org.ldk.structs.FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.FundingSigned(null, msg); }
241                                 arg.handle_funding_signed(their_node_id, msg_hu_conv);
242                                 Reference.reachabilityFence(arg);
243                         }
244                         @Override public void handle_channel_ready(byte[] their_node_id, long msg) {
245                                 org.ldk.structs.ChannelReady msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReady(null, msg); }
246                                 arg.handle_channel_ready(their_node_id, msg_hu_conv);
247                                 Reference.reachabilityFence(arg);
248                         }
249                         @Override public void handle_shutdown(byte[] their_node_id, long msg) {
250                                 org.ldk.structs.Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Shutdown(null, msg); }
251                                 arg.handle_shutdown(their_node_id, msg_hu_conv);
252                                 Reference.reachabilityFence(arg);
253                         }
254                         @Override public void handle_closing_signed(byte[] their_node_id, long msg) {
255                                 org.ldk.structs.ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ClosingSigned(null, msg); }
256                                 arg.handle_closing_signed(their_node_id, msg_hu_conv);
257                                 Reference.reachabilityFence(arg);
258                         }
259                         @Override public void handle_stfu(byte[] their_node_id, long msg) {
260                                 org.ldk.structs.Stfu msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Stfu(null, msg); }
261                                 arg.handle_stfu(their_node_id, msg_hu_conv);
262                                 Reference.reachabilityFence(arg);
263                         }
264                         @Override public void handle_splice(byte[] their_node_id, long msg) {
265                                 org.ldk.structs.Splice msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Splice(null, msg); }
266                                 arg.handle_splice(their_node_id, msg_hu_conv);
267                                 Reference.reachabilityFence(arg);
268                         }
269                         @Override public void handle_splice_ack(byte[] their_node_id, long msg) {
270                                 org.ldk.structs.SpliceAck msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceAck(null, msg); }
271                                 arg.handle_splice_ack(their_node_id, msg_hu_conv);
272                                 Reference.reachabilityFence(arg);
273                         }
274                         @Override public void handle_splice_locked(byte[] their_node_id, long msg) {
275                                 org.ldk.structs.SpliceLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.SpliceLocked(null, msg); }
276                                 arg.handle_splice_locked(their_node_id, msg_hu_conv);
277                                 Reference.reachabilityFence(arg);
278                         }
279                         @Override public void handle_tx_add_input(byte[] their_node_id, long msg) {
280                                 org.ldk.structs.TxAddInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddInput(null, msg); }
281                                 arg.handle_tx_add_input(their_node_id, msg_hu_conv);
282                                 Reference.reachabilityFence(arg);
283                         }
284                         @Override public void handle_tx_add_output(byte[] their_node_id, long msg) {
285                                 org.ldk.structs.TxAddOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAddOutput(null, msg); }
286                                 arg.handle_tx_add_output(their_node_id, msg_hu_conv);
287                                 Reference.reachabilityFence(arg);
288                         }
289                         @Override public void handle_tx_remove_input(byte[] their_node_id, long msg) {
290                                 org.ldk.structs.TxRemoveInput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveInput(null, msg); }
291                                 arg.handle_tx_remove_input(their_node_id, msg_hu_conv);
292                                 Reference.reachabilityFence(arg);
293                         }
294                         @Override public void handle_tx_remove_output(byte[] their_node_id, long msg) {
295                                 org.ldk.structs.TxRemoveOutput msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxRemoveOutput(null, msg); }
296                                 arg.handle_tx_remove_output(their_node_id, msg_hu_conv);
297                                 Reference.reachabilityFence(arg);
298                         }
299                         @Override public void handle_tx_complete(byte[] their_node_id, long msg) {
300                                 org.ldk.structs.TxComplete msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxComplete(null, msg); }
301                                 arg.handle_tx_complete(their_node_id, msg_hu_conv);
302                                 Reference.reachabilityFence(arg);
303                         }
304                         @Override public void handle_tx_signatures(byte[] their_node_id, long msg) {
305                                 org.ldk.structs.TxSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxSignatures(null, msg); }
306                                 arg.handle_tx_signatures(their_node_id, msg_hu_conv);
307                                 Reference.reachabilityFence(arg);
308                         }
309                         @Override public void handle_tx_init_rbf(byte[] their_node_id, long msg) {
310                                 org.ldk.structs.TxInitRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxInitRbf(null, msg); }
311                                 arg.handle_tx_init_rbf(their_node_id, msg_hu_conv);
312                                 Reference.reachabilityFence(arg);
313                         }
314                         @Override public void handle_tx_ack_rbf(byte[] their_node_id, long msg) {
315                                 org.ldk.structs.TxAckRbf msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAckRbf(null, msg); }
316                                 arg.handle_tx_ack_rbf(their_node_id, msg_hu_conv);
317                                 Reference.reachabilityFence(arg);
318                         }
319                         @Override public void handle_tx_abort(byte[] their_node_id, long msg) {
320                                 org.ldk.structs.TxAbort msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.TxAbort(null, msg); }
321                                 arg.handle_tx_abort(their_node_id, msg_hu_conv);
322                                 Reference.reachabilityFence(arg);
323                         }
324                         @Override public void handle_update_add_htlc(byte[] their_node_id, long msg) {
325                                 org.ldk.structs.UpdateAddHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, msg); }
326                                 arg.handle_update_add_htlc(their_node_id, msg_hu_conv);
327                                 Reference.reachabilityFence(arg);
328                         }
329                         @Override public void handle_update_fulfill_htlc(byte[] their_node_id, long msg) {
330                                 org.ldk.structs.UpdateFulfillHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, msg); }
331                                 arg.handle_update_fulfill_htlc(their_node_id, msg_hu_conv);
332                                 Reference.reachabilityFence(arg);
333                         }
334                         @Override public void handle_update_fail_htlc(byte[] their_node_id, long msg) {
335                                 org.ldk.structs.UpdateFailHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFailHTLC(null, msg); }
336                                 arg.handle_update_fail_htlc(their_node_id, msg_hu_conv);
337                                 Reference.reachabilityFence(arg);
338                         }
339                         @Override public void handle_update_fail_malformed_htlc(byte[] their_node_id, long msg) {
340                                 org.ldk.structs.UpdateFailMalformedHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFailMalformedHTLC(null, msg); }
341                                 arg.handle_update_fail_malformed_htlc(their_node_id, msg_hu_conv);
342                                 Reference.reachabilityFence(arg);
343                         }
344                         @Override public void handle_commitment_signed(byte[] their_node_id, long msg) {
345                                 org.ldk.structs.CommitmentSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.CommitmentSigned(null, msg); }
346                                 arg.handle_commitment_signed(their_node_id, msg_hu_conv);
347                                 Reference.reachabilityFence(arg);
348                         }
349                         @Override public void handle_revoke_and_ack(byte[] their_node_id, long msg) {
350                                 org.ldk.structs.RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.RevokeAndACK(null, msg); }
351                                 arg.handle_revoke_and_ack(their_node_id, msg_hu_conv);
352                                 Reference.reachabilityFence(arg);
353                         }
354                         @Override public void handle_update_fee(byte[] their_node_id, long msg) {
355                                 org.ldk.structs.UpdateFee msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UpdateFee(null, msg); }
356                                 arg.handle_update_fee(their_node_id, msg_hu_conv);
357                                 Reference.reachabilityFence(arg);
358                         }
359                         @Override public void handle_announcement_signatures(byte[] their_node_id, long msg) {
360                                 org.ldk.structs.AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, msg); }
361                                 arg.handle_announcement_signatures(their_node_id, msg_hu_conv);
362                                 Reference.reachabilityFence(arg);
363                         }
364                         @Override public void peer_disconnected(byte[] their_node_id) {
365                                 arg.peer_disconnected(their_node_id);
366                                 Reference.reachabilityFence(arg);
367                         }
368                         @Override public long peer_connected(byte[] their_node_id, long msg, boolean inbound) {
369                                 org.ldk.structs.Init msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Init(null, msg); }
370                                 Result_NoneNoneZ ret = arg.peer_connected(their_node_id, msg_hu_conv, inbound);
371                                 Reference.reachabilityFence(arg);
372                                 long result = ret == null ? 0 : ret.clone_ptr();
373                                 return result;
374                         }
375                         @Override public void handle_channel_reestablish(byte[] their_node_id, long msg) {
376                                 org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
377                                 arg.handle_channel_reestablish(their_node_id, msg_hu_conv);
378                                 Reference.reachabilityFence(arg);
379                         }
380                         @Override public void handle_channel_update(byte[] their_node_id, long msg) {
381                                 org.ldk.structs.ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, msg); }
382                                 arg.handle_channel_update(their_node_id, msg_hu_conv);
383                                 Reference.reachabilityFence(arg);
384                         }
385                         @Override public void handle_error(byte[] their_node_id, long msg) {
386                                 org.ldk.structs.ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ErrorMessage(null, msg); }
387                                 arg.handle_error(their_node_id, msg_hu_conv);
388                                 Reference.reachabilityFence(arg);
389                         }
390                         @Override public long provided_node_features() {
391                                 NodeFeatures ret = arg.provided_node_features();
392                                 Reference.reachabilityFence(arg);
393                                 long result = ret == null ? 0 : ret.clone_ptr();
394                                 return result;
395                         }
396                         @Override public long provided_init_features(byte[] their_node_id) {
397                                 InitFeatures ret = arg.provided_init_features(their_node_id);
398                                 Reference.reachabilityFence(arg);
399                                 long result = ret == null ? 0 : ret.clone_ptr();
400                                 return result;
401                         }
402                         @Override public long get_chain_hashes() {
403                                 Option_CVec_ThirtyTwoBytesZZ ret = arg.get_chain_hashes();
404                                 Reference.reachabilityFence(arg);
405                                 long result = ret == null ? 0 : ret.clone_ptr();
406                                 if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); };
407                                 return result;
408                         }
409                 }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance);
410                 return impl_holder.held;
411         }
412
413         /**
414          * Gets the underlying MessageSendEventsProvider.
415          */
416         public MessageSendEventsProvider get_message_send_events_provider() {
417                 MessageSendEventsProvider res = new MessageSendEventsProvider(null, bindings.LDKChannelMessageHandler_get_MessageSendEventsProvider(this.ptr));
418                 res.ptrs_to.add(this);
419                 return res;
420         }
421
422         /**
423          * Handle an incoming `open_channel` message from the given peer.
424          */
425         public void handle_open_channel(byte[] their_node_id, org.ldk.structs.OpenChannel msg) {
426                 bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
427                 Reference.reachabilityFence(this);
428                 Reference.reachabilityFence(their_node_id);
429                 Reference.reachabilityFence(msg);
430                 if (this != null) { this.ptrs_to.add(msg); };
431         }
432
433         /**
434          * Handle an incoming `open_channel2` message from the given peer.
435          */
436         public void handle_open_channel_v2(byte[] their_node_id, org.ldk.structs.OpenChannelV2 msg) {
437                 bindings.ChannelMessageHandler_handle_open_channel_v2(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
438                 Reference.reachabilityFence(this);
439                 Reference.reachabilityFence(their_node_id);
440                 Reference.reachabilityFence(msg);
441                 if (this != null) { this.ptrs_to.add(msg); };
442         }
443
444         /**
445          * Handle an incoming `accept_channel` message from the given peer.
446          */
447         public void handle_accept_channel(byte[] their_node_id, org.ldk.structs.AcceptChannel msg) {
448                 bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
449                 Reference.reachabilityFence(this);
450                 Reference.reachabilityFence(their_node_id);
451                 Reference.reachabilityFence(msg);
452                 if (this != null) { this.ptrs_to.add(msg); };
453         }
454
455         /**
456          * Handle an incoming `accept_channel2` message from the given peer.
457          */
458         public void handle_accept_channel_v2(byte[] their_node_id, org.ldk.structs.AcceptChannelV2 msg) {
459                 bindings.ChannelMessageHandler_handle_accept_channel_v2(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
460                 Reference.reachabilityFence(this);
461                 Reference.reachabilityFence(their_node_id);
462                 Reference.reachabilityFence(msg);
463                 if (this != null) { this.ptrs_to.add(msg); };
464         }
465
466         /**
467          * Handle an incoming `funding_created` message from the given peer.
468          */
469         public void handle_funding_created(byte[] their_node_id, org.ldk.structs.FundingCreated msg) {
470                 bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
471                 Reference.reachabilityFence(this);
472                 Reference.reachabilityFence(their_node_id);
473                 Reference.reachabilityFence(msg);
474                 if (this != null) { this.ptrs_to.add(msg); };
475         }
476
477         /**
478          * Handle an incoming `funding_signed` message from the given peer.
479          */
480         public void handle_funding_signed(byte[] their_node_id, org.ldk.structs.FundingSigned msg) {
481                 bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
482                 Reference.reachabilityFence(this);
483                 Reference.reachabilityFence(their_node_id);
484                 Reference.reachabilityFence(msg);
485                 if (this != null) { this.ptrs_to.add(msg); };
486         }
487
488         /**
489          * Handle an incoming `channel_ready` message from the given peer.
490          */
491         public void handle_channel_ready(byte[] their_node_id, org.ldk.structs.ChannelReady msg) {
492                 bindings.ChannelMessageHandler_handle_channel_ready(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
493                 Reference.reachabilityFence(this);
494                 Reference.reachabilityFence(their_node_id);
495                 Reference.reachabilityFence(msg);
496                 if (this != null) { this.ptrs_to.add(msg); };
497         }
498
499         /**
500          * Handle an incoming `shutdown` message from the given peer.
501          */
502         public void handle_shutdown(byte[] their_node_id, org.ldk.structs.Shutdown msg) {
503                 bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
504                 Reference.reachabilityFence(this);
505                 Reference.reachabilityFence(their_node_id);
506                 Reference.reachabilityFence(msg);
507                 if (this != null) { this.ptrs_to.add(msg); };
508         }
509
510         /**
511          * Handle an incoming `closing_signed` message from the given peer.
512          */
513         public void handle_closing_signed(byte[] their_node_id, org.ldk.structs.ClosingSigned msg) {
514                 bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
515                 Reference.reachabilityFence(this);
516                 Reference.reachabilityFence(their_node_id);
517                 Reference.reachabilityFence(msg);
518                 if (this != null) { this.ptrs_to.add(msg); };
519         }
520
521         /**
522          * Handle an incoming `stfu` message from the given peer.
523          */
524         public void handle_stfu(byte[] their_node_id, org.ldk.structs.Stfu msg) {
525                 bindings.ChannelMessageHandler_handle_stfu(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
526                 Reference.reachabilityFence(this);
527                 Reference.reachabilityFence(their_node_id);
528                 Reference.reachabilityFence(msg);
529                 if (this != null) { this.ptrs_to.add(msg); };
530         }
531
532         /**
533          * Handle an incoming `splice` message from the given peer.
534          */
535         public void handle_splice(byte[] their_node_id, org.ldk.structs.Splice msg) {
536                 bindings.ChannelMessageHandler_handle_splice(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
537                 Reference.reachabilityFence(this);
538                 Reference.reachabilityFence(their_node_id);
539                 Reference.reachabilityFence(msg);
540                 if (this != null) { this.ptrs_to.add(msg); };
541         }
542
543         /**
544          * Handle an incoming `splice_ack` message from the given peer.
545          */
546         public void handle_splice_ack(byte[] their_node_id, org.ldk.structs.SpliceAck msg) {
547                 bindings.ChannelMessageHandler_handle_splice_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
548                 Reference.reachabilityFence(this);
549                 Reference.reachabilityFence(their_node_id);
550                 Reference.reachabilityFence(msg);
551                 if (this != null) { this.ptrs_to.add(msg); };
552         }
553
554         /**
555          * Handle an incoming `splice_locked` message from the given peer.
556          */
557         public void handle_splice_locked(byte[] their_node_id, org.ldk.structs.SpliceLocked msg) {
558                 bindings.ChannelMessageHandler_handle_splice_locked(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
559                 Reference.reachabilityFence(this);
560                 Reference.reachabilityFence(their_node_id);
561                 Reference.reachabilityFence(msg);
562                 if (this != null) { this.ptrs_to.add(msg); };
563         }
564
565         /**
566          * Handle an incoming `tx_add_input message` from the given peer.
567          */
568         public void handle_tx_add_input(byte[] their_node_id, org.ldk.structs.TxAddInput msg) {
569                 bindings.ChannelMessageHandler_handle_tx_add_input(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
570                 Reference.reachabilityFence(this);
571                 Reference.reachabilityFence(their_node_id);
572                 Reference.reachabilityFence(msg);
573                 if (this != null) { this.ptrs_to.add(msg); };
574         }
575
576         /**
577          * Handle an incoming `tx_add_output` message from the given peer.
578          */
579         public void handle_tx_add_output(byte[] their_node_id, org.ldk.structs.TxAddOutput msg) {
580                 bindings.ChannelMessageHandler_handle_tx_add_output(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
581                 Reference.reachabilityFence(this);
582                 Reference.reachabilityFence(their_node_id);
583                 Reference.reachabilityFence(msg);
584                 if (this != null) { this.ptrs_to.add(msg); };
585         }
586
587         /**
588          * Handle an incoming `tx_remove_input` message from the given peer.
589          */
590         public void handle_tx_remove_input(byte[] their_node_id, org.ldk.structs.TxRemoveInput msg) {
591                 bindings.ChannelMessageHandler_handle_tx_remove_input(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
592                 Reference.reachabilityFence(this);
593                 Reference.reachabilityFence(their_node_id);
594                 Reference.reachabilityFence(msg);
595                 if (this != null) { this.ptrs_to.add(msg); };
596         }
597
598         /**
599          * Handle an incoming `tx_remove_output` message from the given peer.
600          */
601         public void handle_tx_remove_output(byte[] their_node_id, org.ldk.structs.TxRemoveOutput msg) {
602                 bindings.ChannelMessageHandler_handle_tx_remove_output(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
603                 Reference.reachabilityFence(this);
604                 Reference.reachabilityFence(their_node_id);
605                 Reference.reachabilityFence(msg);
606                 if (this != null) { this.ptrs_to.add(msg); };
607         }
608
609         /**
610          * Handle an incoming `tx_complete message` from the given peer.
611          */
612         public void handle_tx_complete(byte[] their_node_id, org.ldk.structs.TxComplete msg) {
613                 bindings.ChannelMessageHandler_handle_tx_complete(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
614                 Reference.reachabilityFence(this);
615                 Reference.reachabilityFence(their_node_id);
616                 Reference.reachabilityFence(msg);
617                 if (this != null) { this.ptrs_to.add(msg); };
618         }
619
620         /**
621          * Handle an incoming `tx_signatures` message from the given peer.
622          */
623         public void handle_tx_signatures(byte[] their_node_id, org.ldk.structs.TxSignatures msg) {
624                 bindings.ChannelMessageHandler_handle_tx_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
625                 Reference.reachabilityFence(this);
626                 Reference.reachabilityFence(their_node_id);
627                 Reference.reachabilityFence(msg);
628                 if (this != null) { this.ptrs_to.add(msg); };
629         }
630
631         /**
632          * Handle an incoming `tx_init_rbf` message from the given peer.
633          */
634         public void handle_tx_init_rbf(byte[] their_node_id, org.ldk.structs.TxInitRbf msg) {
635                 bindings.ChannelMessageHandler_handle_tx_init_rbf(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
636                 Reference.reachabilityFence(this);
637                 Reference.reachabilityFence(their_node_id);
638                 Reference.reachabilityFence(msg);
639                 if (this != null) { this.ptrs_to.add(msg); };
640         }
641
642         /**
643          * Handle an incoming `tx_ack_rbf` message from the given peer.
644          */
645         public void handle_tx_ack_rbf(byte[] their_node_id, org.ldk.structs.TxAckRbf msg) {
646                 bindings.ChannelMessageHandler_handle_tx_ack_rbf(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
647                 Reference.reachabilityFence(this);
648                 Reference.reachabilityFence(their_node_id);
649                 Reference.reachabilityFence(msg);
650                 if (this != null) { this.ptrs_to.add(msg); };
651         }
652
653         /**
654          * Handle an incoming `tx_abort message` from the given peer.
655          */
656         public void handle_tx_abort(byte[] their_node_id, org.ldk.structs.TxAbort msg) {
657                 bindings.ChannelMessageHandler_handle_tx_abort(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
658                 Reference.reachabilityFence(this);
659                 Reference.reachabilityFence(their_node_id);
660                 Reference.reachabilityFence(msg);
661                 if (this != null) { this.ptrs_to.add(msg); };
662         }
663
664         /**
665          * Handle an incoming `update_add_htlc` message from the given peer.
666          */
667         public void handle_update_add_htlc(byte[] their_node_id, org.ldk.structs.UpdateAddHTLC msg) {
668                 bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
669                 Reference.reachabilityFence(this);
670                 Reference.reachabilityFence(their_node_id);
671                 Reference.reachabilityFence(msg);
672                 if (this != null) { this.ptrs_to.add(msg); };
673         }
674
675         /**
676          * Handle an incoming `update_fulfill_htlc` message from the given peer.
677          */
678         public void handle_update_fulfill_htlc(byte[] their_node_id, org.ldk.structs.UpdateFulfillHTLC msg) {
679                 bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
680                 Reference.reachabilityFence(this);
681                 Reference.reachabilityFence(their_node_id);
682                 Reference.reachabilityFence(msg);
683                 if (this != null) { this.ptrs_to.add(msg); };
684         }
685
686         /**
687          * Handle an incoming `update_fail_htlc` message from the given peer.
688          */
689         public void handle_update_fail_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailHTLC msg) {
690                 bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
691                 Reference.reachabilityFence(this);
692                 Reference.reachabilityFence(their_node_id);
693                 Reference.reachabilityFence(msg);
694                 if (this != null) { this.ptrs_to.add(msg); };
695         }
696
697         /**
698          * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
699          */
700         public void handle_update_fail_malformed_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailMalformedHTLC msg) {
701                 bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
702                 Reference.reachabilityFence(this);
703                 Reference.reachabilityFence(their_node_id);
704                 Reference.reachabilityFence(msg);
705                 if (this != null) { this.ptrs_to.add(msg); };
706         }
707
708         /**
709          * Handle an incoming `commitment_signed` message from the given peer.
710          */
711         public void handle_commitment_signed(byte[] their_node_id, org.ldk.structs.CommitmentSigned msg) {
712                 bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
713                 Reference.reachabilityFence(this);
714                 Reference.reachabilityFence(their_node_id);
715                 Reference.reachabilityFence(msg);
716                 if (this != null) { this.ptrs_to.add(msg); };
717         }
718
719         /**
720          * Handle an incoming `revoke_and_ack` message from the given peer.
721          */
722         public void handle_revoke_and_ack(byte[] their_node_id, org.ldk.structs.RevokeAndACK msg) {
723                 bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
724                 Reference.reachabilityFence(this);
725                 Reference.reachabilityFence(their_node_id);
726                 Reference.reachabilityFence(msg);
727                 if (this != null) { this.ptrs_to.add(msg); };
728         }
729
730         /**
731          * Handle an incoming `update_fee` message from the given peer.
732          */
733         public void handle_update_fee(byte[] their_node_id, org.ldk.structs.UpdateFee msg) {
734                 bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
735                 Reference.reachabilityFence(this);
736                 Reference.reachabilityFence(their_node_id);
737                 Reference.reachabilityFence(msg);
738                 if (this != null) { this.ptrs_to.add(msg); };
739         }
740
741         /**
742          * Handle an incoming `announcement_signatures` message from the given peer.
743          */
744         public void handle_announcement_signatures(byte[] their_node_id, org.ldk.structs.AnnouncementSignatures msg) {
745                 bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
746                 Reference.reachabilityFence(this);
747                 Reference.reachabilityFence(their_node_id);
748                 Reference.reachabilityFence(msg);
749                 if (this != null) { this.ptrs_to.add(msg); };
750         }
751
752         /**
753          * Indicates a connection to the peer failed/an existing connection was lost.
754          */
755         public void peer_disconnected(byte[] their_node_id) {
756                 bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33));
757                 Reference.reachabilityFence(this);
758                 Reference.reachabilityFence(their_node_id);
759         }
760
761         /**
762          * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
763          * 
764          * May return an `Err(())` if the features the peer supports are not sufficient to communicate
765          * with us. Implementors should be somewhat conservative about doing so, however, as other
766          * message handlers may still wish to communicate with this peer.
767          */
768         public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init msg, boolean inbound) {
769                 long ret = bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr, inbound);
770                 Reference.reachabilityFence(this);
771                 Reference.reachabilityFence(their_node_id);
772                 Reference.reachabilityFence(msg);
773                 Reference.reachabilityFence(inbound);
774                 if (ret >= 0 && ret <= 4096) { return null; }
775                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
776                 if (this != null) { this.ptrs_to.add(msg); };
777                 return ret_hu_conv;
778         }
779
780         /**
781          * Handle an incoming `channel_reestablish` message from the given peer.
782          */
783         public void handle_channel_reestablish(byte[] their_node_id, org.ldk.structs.ChannelReestablish msg) {
784                 bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
785                 Reference.reachabilityFence(this);
786                 Reference.reachabilityFence(their_node_id);
787                 Reference.reachabilityFence(msg);
788                 if (this != null) { this.ptrs_to.add(msg); };
789         }
790
791         /**
792          * Handle an incoming `channel_update` message from the given peer.
793          */
794         public void handle_channel_update(byte[] their_node_id, org.ldk.structs.ChannelUpdate msg) {
795                 bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
796                 Reference.reachabilityFence(this);
797                 Reference.reachabilityFence(their_node_id);
798                 Reference.reachabilityFence(msg);
799                 if (this != null) { this.ptrs_to.add(msg); };
800         }
801
802         /**
803          * Handle an incoming `error` message from the given peer.
804          */
805         public void handle_error(byte[] their_node_id, org.ldk.structs.ErrorMessage msg) {
806                 bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
807                 Reference.reachabilityFence(this);
808                 Reference.reachabilityFence(their_node_id);
809                 Reference.reachabilityFence(msg);
810                 if (this != null) { this.ptrs_to.add(msg); };
811         }
812
813         /**
814          * Gets the node feature flags which this handler itself supports. All available handlers are
815          * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
816          * which are broadcasted in our [`NodeAnnouncement`] message.
817          */
818         public NodeFeatures provided_node_features() {
819                 long ret = bindings.ChannelMessageHandler_provided_node_features(this.ptr);
820                 Reference.reachabilityFence(this);
821                 if (ret >= 0 && ret <= 4096) { return null; }
822                 org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); }
823                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
824                 return ret_hu_conv;
825         }
826
827         /**
828          * Gets the init feature flags which should be sent to the given peer. All available handlers
829          * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
830          * which are sent in our [`Init`] message.
831          * 
832          * Note that this method is called before [`Self::peer_connected`].
833          */
834         public InitFeatures provided_init_features(byte[] their_node_id) {
835                 long ret = bindings.ChannelMessageHandler_provided_init_features(this.ptr, InternalUtils.check_arr_len(their_node_id, 33));
836                 Reference.reachabilityFence(this);
837                 Reference.reachabilityFence(their_node_id);
838                 if (ret >= 0 && ret <= 4096) { return null; }
839                 org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
840                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
841                 return ret_hu_conv;
842         }
843
844         /**
845          * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
846          * 
847          * If it's `None`, then no particular network chain hash compatibility will be enforced when
848          * connecting to peers.
849          */
850         public Option_CVec_ThirtyTwoBytesZZ get_chain_hashes() {
851                 long ret = bindings.ChannelMessageHandler_get_chain_hashes(this.ptr);
852                 Reference.reachabilityFence(this);
853                 if (ret >= 0 && ret <= 4096) { return null; }
854                 org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ ret_hu_conv = org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ.constr_from_ptr(ret);
855                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
856                 return ret_hu_conv;
857         }
858
859 }