Update auto-generated bindings
[ldk-c-bindings] / lightning-c-bindings / src / lightning / ln / outbound_payment.rs
1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
3 //
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
8
9 //! Utilities to send payments and manage outbound payment information.
10
11 use alloc::str::FromStr;
12 use alloc::string::String;
13 use core::ffi::c_void;
14 use core::convert::Infallible;
15 use bitcoin::hashes::Hash;
16 use crate::c_types::*;
17 #[cfg(feature="no-std")]
18 use alloc::{vec::Vec, boxed::Box};
19
20 /// Strategies available to retry payment path failures.
21 #[derive(Clone)]
22 #[must_use]
23 #[repr(C)]
24 pub enum Retry {
25         /// Max number of attempts to retry payment.
26         ///
27         /// Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
28         /// retry, and may retry multiple failed HTLCs at once if they failed around the same time and
29         /// were retried along a route from a single call to [`Router::find_route_with_id`].
30         Attempts(
31                 u32),
32         /// Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
33         /// see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
34         ///
35         /// [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
36         Timeout(
37                 u64),
38 }
39 use lightning::ln::outbound_payment::Retry as RetryImport;
40 pub(crate) type nativeRetry = RetryImport;
41
42 impl Retry {
43         #[allow(unused)]
44         pub(crate) fn to_native(&self) -> nativeRetry {
45                 match self {
46                         Retry::Attempts (ref a, ) => {
47                                 let mut a_nonref = Clone::clone(a);
48                                 nativeRetry::Attempts (
49                                         a_nonref,
50                                 )
51                         },
52                         Retry::Timeout (ref a, ) => {
53                                 let mut a_nonref = Clone::clone(a);
54                                 nativeRetry::Timeout (
55                                         core::time::Duration::from_secs(a_nonref),
56                                 )
57                         },
58                 }
59         }
60         #[allow(unused)]
61         pub(crate) fn into_native(self) -> nativeRetry {
62                 match self {
63                         Retry::Attempts (mut a, ) => {
64                                 nativeRetry::Attempts (
65                                         a,
66                                 )
67                         },
68                         Retry::Timeout (mut a, ) => {
69                                 nativeRetry::Timeout (
70                                         core::time::Duration::from_secs(a),
71                                 )
72                         },
73                 }
74         }
75         #[allow(unused)]
76         pub(crate) fn from_native(native: &nativeRetry) -> Self {
77                 match native {
78                         nativeRetry::Attempts (ref a, ) => {
79                                 let mut a_nonref = Clone::clone(a);
80                                 Retry::Attempts (
81                                         a_nonref,
82                                 )
83                         },
84                         nativeRetry::Timeout (ref a, ) => {
85                                 let mut a_nonref = Clone::clone(a);
86                                 Retry::Timeout (
87                                         a_nonref.as_secs(),
88                                 )
89                         },
90                 }
91         }
92         #[allow(unused)]
93         pub(crate) fn native_into(native: nativeRetry) -> Self {
94                 match native {
95                         nativeRetry::Attempts (mut a, ) => {
96                                 Retry::Attempts (
97                                         a,
98                                 )
99                         },
100                         nativeRetry::Timeout (mut a, ) => {
101                                 Retry::Timeout (
102                                         a.as_secs(),
103                                 )
104                         },
105                 }
106         }
107 }
108 /// Frees any resources used by the Retry
109 #[no_mangle]
110 pub extern "C" fn Retry_free(this_ptr: Retry) { }
111 /// Creates a copy of the Retry
112 #[no_mangle]
113 pub extern "C" fn Retry_clone(orig: &Retry) -> Retry {
114         orig.clone()
115 }
116 #[no_mangle]
117 /// Utility method to constructs a new Attempts-variant Retry
118 pub extern "C" fn Retry_attempts(a: u32) -> Retry {
119         Retry::Attempts(a, )
120 }
121 #[no_mangle]
122 /// Utility method to constructs a new Timeout-variant Retry
123 pub extern "C" fn Retry_timeout(a: u64) -> Retry {
124         Retry::Timeout(a, )
125 }
126 /// Checks if two Retrys contain equal inner contents.
127 /// This ignores pointers and is_owned flags and looks at the values in fields.
128 #[no_mangle]
129 pub extern "C" fn Retry_eq(a: &Retry, b: &Retry) -> bool {
130         if &a.to_native() == &b.to_native() { true } else { false }
131 }
132 /// Generates a non-cryptographic 64-bit hash of the Retry.
133 #[no_mangle]
134 pub extern "C" fn Retry_hash(o: &Retry) -> u64 {
135         // Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
136         #[allow(deprecated)]
137         let mut hasher = core::hash::SipHasher::new();
138         core::hash::Hash::hash(&o.to_native(), &mut hasher);
139         core::hash::Hasher::finish(&hasher)
140 }
141 #[no_mangle]
142 /// Serialize the Retry object into a byte array which can be read by Retry_read
143 pub extern "C" fn Retry_write(obj: &crate::lightning::ln::outbound_payment::Retry) -> crate::c_types::derived::CVec_u8Z {
144         crate::c_types::serialize_obj(&unsafe { &*obj }.to_native())
145 }
146 #[no_mangle]
147 /// Read a Retry from a byte array, created by Retry_write
148 pub extern "C" fn Retry_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RetryDecodeErrorZ {
149         let res: Result<lightning::ln::outbound_payment::Retry, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
150         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::outbound_payment::Retry::native_into(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
151         local_res
152 }
153 /// Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
154 /// surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
155 ///
156 /// [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
157 /// [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
158 /// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
159 #[derive(Clone)]
160 #[must_use]
161 #[repr(C)]
162 pub enum RetryableSendFailure {
163         /// The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
164         /// that this error is *not* caused by [`Retry::Timeout`].
165         ///
166         /// [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
167         PaymentExpired,
168         /// We were unable to find a route to the destination.
169         RouteNotFound,
170         /// Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
171         /// yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
172         ///
173         /// [`PaymentId`]: crate::ln::channelmanager::PaymentId
174         /// [`Event::PaymentSent`]: crate::events::Event::PaymentSent
175         /// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
176         DuplicatePayment,
177 }
178 use lightning::ln::outbound_payment::RetryableSendFailure as RetryableSendFailureImport;
179 pub(crate) type nativeRetryableSendFailure = RetryableSendFailureImport;
180
181 impl RetryableSendFailure {
182         #[allow(unused)]
183         pub(crate) fn to_native(&self) -> nativeRetryableSendFailure {
184                 match self {
185                         RetryableSendFailure::PaymentExpired => nativeRetryableSendFailure::PaymentExpired,
186                         RetryableSendFailure::RouteNotFound => nativeRetryableSendFailure::RouteNotFound,
187                         RetryableSendFailure::DuplicatePayment => nativeRetryableSendFailure::DuplicatePayment,
188                 }
189         }
190         #[allow(unused)]
191         pub(crate) fn into_native(self) -> nativeRetryableSendFailure {
192                 match self {
193                         RetryableSendFailure::PaymentExpired => nativeRetryableSendFailure::PaymentExpired,
194                         RetryableSendFailure::RouteNotFound => nativeRetryableSendFailure::RouteNotFound,
195                         RetryableSendFailure::DuplicatePayment => nativeRetryableSendFailure::DuplicatePayment,
196                 }
197         }
198         #[allow(unused)]
199         pub(crate) fn from_native(native: &nativeRetryableSendFailure) -> Self {
200                 match native {
201                         nativeRetryableSendFailure::PaymentExpired => RetryableSendFailure::PaymentExpired,
202                         nativeRetryableSendFailure::RouteNotFound => RetryableSendFailure::RouteNotFound,
203                         nativeRetryableSendFailure::DuplicatePayment => RetryableSendFailure::DuplicatePayment,
204                 }
205         }
206         #[allow(unused)]
207         pub(crate) fn native_into(native: nativeRetryableSendFailure) -> Self {
208                 match native {
209                         nativeRetryableSendFailure::PaymentExpired => RetryableSendFailure::PaymentExpired,
210                         nativeRetryableSendFailure::RouteNotFound => RetryableSendFailure::RouteNotFound,
211                         nativeRetryableSendFailure::DuplicatePayment => RetryableSendFailure::DuplicatePayment,
212                 }
213         }
214 }
215 /// Creates a copy of the RetryableSendFailure
216 #[no_mangle]
217 pub extern "C" fn RetryableSendFailure_clone(orig: &RetryableSendFailure) -> RetryableSendFailure {
218         orig.clone()
219 }
220 #[no_mangle]
221 /// Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
222 pub extern "C" fn RetryableSendFailure_payment_expired() -> RetryableSendFailure {
223         RetryableSendFailure::PaymentExpired}
224 #[no_mangle]
225 /// Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
226 pub extern "C" fn RetryableSendFailure_route_not_found() -> RetryableSendFailure {
227         RetryableSendFailure::RouteNotFound}
228 #[no_mangle]
229 /// Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
230 pub extern "C" fn RetryableSendFailure_duplicate_payment() -> RetryableSendFailure {
231         RetryableSendFailure::DuplicatePayment}
232 /// Checks if two RetryableSendFailures contain equal inner contents.
233 /// This ignores pointers and is_owned flags and looks at the values in fields.
234 #[no_mangle]
235 pub extern "C" fn RetryableSendFailure_eq(a: &RetryableSendFailure, b: &RetryableSendFailure) -> bool {
236         if &a.to_native() == &b.to_native() { true } else { false }
237 }
238 /// If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
239 /// of several states. This enum is returned as the Err() type describing which state the payment
240 /// is in, see the description of individual enum states for more.
241 ///
242 /// [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
243 #[derive(Clone)]
244 #[must_use]
245 #[repr(C)]
246 pub enum PaymentSendFailure {
247         /// A parameter which was passed to send_payment was invalid, preventing us from attempting to
248         /// send the payment at all.
249         ///
250         /// You can freely resend the payment in full (with the parameter error fixed).
251         ///
252         /// Because the payment failed outright, no payment tracking is done and no
253         /// [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
254         ///
255         /// [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
256         /// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
257         ParameterError(
258                 crate::lightning::util::errors::APIError),
259         /// A parameter in a single path which was passed to send_payment was invalid, preventing us
260         /// from attempting to send the payment at all.
261         ///
262         /// You can freely resend the payment in full (with the parameter error fixed).
263         ///
264         /// Because the payment failed outright, no payment tracking is done and no
265         /// [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
266         ///
267         /// The results here are ordered the same as the paths in the route object which was passed to
268         /// send_payment.
269         ///
270         /// [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
271         /// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
272         PathParameterError(
273                 crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ),
274         /// All paths which were attempted failed to send, with no channel state change taking place.
275         /// You can freely resend the payment in full (though you probably want to do so over different
276         /// paths than the ones selected).
277         ///
278         /// Because the payment failed outright, no payment tracking is done and no
279         /// [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
280         ///
281         /// [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
282         /// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
283         AllFailedResendSafe(
284                 crate::c_types::derived::CVec_APIErrorZ),
285         /// Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
286         /// yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
287         ///
288         /// [`PaymentId`]: crate::ln::channelmanager::PaymentId
289         /// [`Event::PaymentSent`]: crate::events::Event::PaymentSent
290         /// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
291         DuplicatePayment,
292         /// Some paths that were attempted failed to send, though some paths may have succeeded. At least
293         /// some paths have irrevocably committed to the HTLC.
294         ///
295         /// The results here are ordered the same as the paths in the route object that was passed to
296         /// send_payment.
297         ///
298         /// Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
299         /// [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
300         ///
301         /// [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
302         PartialFailure {
303                 /// The errors themselves, in the same order as the paths from the route.
304                 results: crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ,
305                 /// If some paths failed without irrevocably committing to the new HTLC(s), this will
306                 /// contain a [`RouteParameters`] object for the failing paths.
307                 ///
308                 /// Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
309                 failed_paths_retry: crate::lightning::routing::router::RouteParameters,
310                 /// The payment id for the payment, which is now at least partially pending.
311                 payment_id: crate::c_types::ThirtyTwoBytes,
312         },
313 }
314 use lightning::ln::outbound_payment::PaymentSendFailure as PaymentSendFailureImport;
315 pub(crate) type nativePaymentSendFailure = PaymentSendFailureImport;
316
317 impl PaymentSendFailure {
318         #[allow(unused)]
319         pub(crate) fn to_native(&self) -> nativePaymentSendFailure {
320                 match self {
321                         PaymentSendFailure::ParameterError (ref a, ) => {
322                                 let mut a_nonref = Clone::clone(a);
323                                 nativePaymentSendFailure::ParameterError (
324                                         a_nonref.into_native(),
325                                 )
326                         },
327                         PaymentSendFailure::PathParameterError (ref a, ) => {
328                                 let mut a_nonref = Clone::clone(a);
329                                 let mut local_a_nonref = Vec::new(); for mut item in a_nonref.into_rust().drain(..) { local_a_nonref.push( { let mut local_a_nonref_0 = match item.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.result)) })*/ }), false => Err( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.err)) }).into_native() })}; local_a_nonref_0 }); };
330                                 nativePaymentSendFailure::PathParameterError (
331                                         local_a_nonref,
332                                 )
333                         },
334                         PaymentSendFailure::AllFailedResendSafe (ref a, ) => {
335                                 let mut a_nonref = Clone::clone(a);
336                                 let mut local_a_nonref = Vec::new(); for mut item in a_nonref.into_rust().drain(..) { local_a_nonref.push( { item.into_native() }); };
337                                 nativePaymentSendFailure::AllFailedResendSafe (
338                                         local_a_nonref,
339                                 )
340                         },
341                         PaymentSendFailure::DuplicatePayment => nativePaymentSendFailure::DuplicatePayment,
342                         PaymentSendFailure::PartialFailure {ref results, ref failed_paths_retry, ref payment_id, } => {
343                                 let mut results_nonref = Clone::clone(results);
344                                 let mut local_results_nonref = Vec::new(); for mut item in results_nonref.into_rust().drain(..) { local_results_nonref.push( { let mut local_results_nonref_0 = match item.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.result)) })*/ }), false => Err( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.err)) }).into_native() })}; local_results_nonref_0 }); };
345                                 let mut failed_paths_retry_nonref = Clone::clone(failed_paths_retry);
346                                 let mut local_failed_paths_retry_nonref = if failed_paths_retry_nonref.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(failed_paths_retry_nonref.take_inner()) } }) };
347                                 let mut payment_id_nonref = Clone::clone(payment_id);
348                                 nativePaymentSendFailure::PartialFailure {
349                                         results: local_results_nonref,
350                                         failed_paths_retry: local_failed_paths_retry_nonref,
351                                         payment_id: ::lightning::ln::channelmanager::PaymentId(payment_id_nonref.data),
352                                 }
353                         },
354                 }
355         }
356         #[allow(unused)]
357         pub(crate) fn into_native(self) -> nativePaymentSendFailure {
358                 match self {
359                         PaymentSendFailure::ParameterError (mut a, ) => {
360                                 nativePaymentSendFailure::ParameterError (
361                                         a.into_native(),
362                                 )
363                         },
364                         PaymentSendFailure::PathParameterError (mut a, ) => {
365                                 let mut local_a = Vec::new(); for mut item in a.into_rust().drain(..) { local_a.push( { let mut local_a_0 = match item.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.result)) })*/ }), false => Err( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.err)) }).into_native() })}; local_a_0 }); };
366                                 nativePaymentSendFailure::PathParameterError (
367                                         local_a,
368                                 )
369                         },
370                         PaymentSendFailure::AllFailedResendSafe (mut a, ) => {
371                                 let mut local_a = Vec::new(); for mut item in a.into_rust().drain(..) { local_a.push( { item.into_native() }); };
372                                 nativePaymentSendFailure::AllFailedResendSafe (
373                                         local_a,
374                                 )
375                         },
376                         PaymentSendFailure::DuplicatePayment => nativePaymentSendFailure::DuplicatePayment,
377                         PaymentSendFailure::PartialFailure {mut results, mut failed_paths_retry, mut payment_id, } => {
378                                 let mut local_results = Vec::new(); for mut item in results.into_rust().drain(..) { local_results.push( { let mut local_results_0 = match item.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.result)) })*/ }), false => Err( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut item.contents.err)) }).into_native() })}; local_results_0 }); };
379                                 let mut local_failed_paths_retry = if failed_paths_retry.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(failed_paths_retry.take_inner()) } }) };
380                                 nativePaymentSendFailure::PartialFailure {
381                                         results: local_results,
382                                         failed_paths_retry: local_failed_paths_retry,
383                                         payment_id: ::lightning::ln::channelmanager::PaymentId(payment_id.data),
384                                 }
385                         },
386                 }
387         }
388         #[allow(unused)]
389         pub(crate) fn from_native(native: &nativePaymentSendFailure) -> Self {
390                 match native {
391                         nativePaymentSendFailure::ParameterError (ref a, ) => {
392                                 let mut a_nonref = Clone::clone(a);
393                                 PaymentSendFailure::ParameterError (
394                                         crate::lightning::util::errors::APIError::native_into(a_nonref),
395                                 )
396                         },
397                         nativePaymentSendFailure::PathParameterError (ref a, ) => {
398                                 let mut a_nonref = Clone::clone(a);
399                                 let mut local_a_nonref = Vec::new(); for mut item in a_nonref.drain(..) { local_a_nonref.push( { let mut local_a_nonref_0 = match item { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::util::errors::APIError::native_into(e) }).into() }; local_a_nonref_0 }); };
400                                 PaymentSendFailure::PathParameterError (
401                                         local_a_nonref.into(),
402                                 )
403                         },
404                         nativePaymentSendFailure::AllFailedResendSafe (ref a, ) => {
405                                 let mut a_nonref = Clone::clone(a);
406                                 let mut local_a_nonref = Vec::new(); for mut item in a_nonref.drain(..) { local_a_nonref.push( { crate::lightning::util::errors::APIError::native_into(item) }); };
407                                 PaymentSendFailure::AllFailedResendSafe (
408                                         local_a_nonref.into(),
409                                 )
410                         },
411                         nativePaymentSendFailure::DuplicatePayment => PaymentSendFailure::DuplicatePayment,
412                         nativePaymentSendFailure::PartialFailure {ref results, ref failed_paths_retry, ref payment_id, } => {
413                                 let mut results_nonref = Clone::clone(results);
414                                 let mut local_results_nonref = Vec::new(); for mut item in results_nonref.drain(..) { local_results_nonref.push( { let mut local_results_nonref_0 = match item { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::util::errors::APIError::native_into(e) }).into() }; local_results_nonref_0 }); };
415                                 let mut failed_paths_retry_nonref = Clone::clone(failed_paths_retry);
416                                 let mut local_failed_paths_retry_nonref = crate::lightning::routing::router::RouteParameters { inner: if failed_paths_retry_nonref.is_none() { core::ptr::null_mut() } else {  { ObjOps::heap_alloc((failed_paths_retry_nonref.unwrap())) } }, is_owned: true };
417                                 let mut payment_id_nonref = Clone::clone(payment_id);
418                                 PaymentSendFailure::PartialFailure {
419                                         results: local_results_nonref.into(),
420                                         failed_paths_retry: local_failed_paths_retry_nonref,
421                                         payment_id: crate::c_types::ThirtyTwoBytes { data: payment_id_nonref.0 },
422                                 }
423                         },
424                 }
425         }
426         #[allow(unused)]
427         pub(crate) fn native_into(native: nativePaymentSendFailure) -> Self {
428                 match native {
429                         nativePaymentSendFailure::ParameterError (mut a, ) => {
430                                 PaymentSendFailure::ParameterError (
431                                         crate::lightning::util::errors::APIError::native_into(a),
432                                 )
433                         },
434                         nativePaymentSendFailure::PathParameterError (mut a, ) => {
435                                 let mut local_a = Vec::new(); for mut item in a.drain(..) { local_a.push( { let mut local_a_0 = match item { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::util::errors::APIError::native_into(e) }).into() }; local_a_0 }); };
436                                 PaymentSendFailure::PathParameterError (
437                                         local_a.into(),
438                                 )
439                         },
440                         nativePaymentSendFailure::AllFailedResendSafe (mut a, ) => {
441                                 let mut local_a = Vec::new(); for mut item in a.drain(..) { local_a.push( { crate::lightning::util::errors::APIError::native_into(item) }); };
442                                 PaymentSendFailure::AllFailedResendSafe (
443                                         local_a.into(),
444                                 )
445                         },
446                         nativePaymentSendFailure::DuplicatePayment => PaymentSendFailure::DuplicatePayment,
447                         nativePaymentSendFailure::PartialFailure {mut results, mut failed_paths_retry, mut payment_id, } => {
448                                 let mut local_results = Vec::new(); for mut item in results.drain(..) { local_results.push( { let mut local_results_0 = match item { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::util::errors::APIError::native_into(e) }).into() }; local_results_0 }); };
449                                 let mut local_failed_paths_retry = crate::lightning::routing::router::RouteParameters { inner: if failed_paths_retry.is_none() { core::ptr::null_mut() } else {  { ObjOps::heap_alloc((failed_paths_retry.unwrap())) } }, is_owned: true };
450                                 PaymentSendFailure::PartialFailure {
451                                         results: local_results.into(),
452                                         failed_paths_retry: local_failed_paths_retry,
453                                         payment_id: crate::c_types::ThirtyTwoBytes { data: payment_id.0 },
454                                 }
455                         },
456                 }
457         }
458 }
459 /// Frees any resources used by the PaymentSendFailure
460 #[no_mangle]
461 pub extern "C" fn PaymentSendFailure_free(this_ptr: PaymentSendFailure) { }
462 /// Creates a copy of the PaymentSendFailure
463 #[no_mangle]
464 pub extern "C" fn PaymentSendFailure_clone(orig: &PaymentSendFailure) -> PaymentSendFailure {
465         orig.clone()
466 }
467 #[no_mangle]
468 /// Utility method to constructs a new ParameterError-variant PaymentSendFailure
469 pub extern "C" fn PaymentSendFailure_parameter_error(a: crate::lightning::util::errors::APIError) -> PaymentSendFailure {
470         PaymentSendFailure::ParameterError(a, )
471 }
472 #[no_mangle]
473 /// Utility method to constructs a new PathParameterError-variant PaymentSendFailure
474 pub extern "C" fn PaymentSendFailure_path_parameter_error(a: crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ) -> PaymentSendFailure {
475         PaymentSendFailure::PathParameterError(a, )
476 }
477 #[no_mangle]
478 /// Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
479 pub extern "C" fn PaymentSendFailure_all_failed_resend_safe(a: crate::c_types::derived::CVec_APIErrorZ) -> PaymentSendFailure {
480         PaymentSendFailure::AllFailedResendSafe(a, )
481 }
482 #[no_mangle]
483 /// Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
484 pub extern "C" fn PaymentSendFailure_duplicate_payment() -> PaymentSendFailure {
485         PaymentSendFailure::DuplicatePayment}
486 #[no_mangle]
487 /// Utility method to constructs a new PartialFailure-variant PaymentSendFailure
488 pub extern "C" fn PaymentSendFailure_partial_failure(results: crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ, failed_paths_retry: crate::lightning::routing::router::RouteParameters, payment_id: crate::c_types::ThirtyTwoBytes) -> PaymentSendFailure {
489         PaymentSendFailure::PartialFailure {
490                 results,
491                 failed_paths_retry,
492                 payment_id,
493         }
494 }
495 /// Checks if two PaymentSendFailures contain equal inner contents.
496 /// This ignores pointers and is_owned flags and looks at the values in fields.
497 #[no_mangle]
498 pub extern "C" fn PaymentSendFailure_eq(a: &PaymentSendFailure, b: &PaymentSendFailure) -> bool {
499         if &a.to_native() == &b.to_native() { true } else { false }
500 }
501 /// Indicates that we failed to send a payment probe. Further errors may be surfaced later via
502 /// [`Event::ProbeFailed`].
503 ///
504 /// [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
505 #[derive(Clone)]
506 #[must_use]
507 #[repr(C)]
508 pub enum ProbeSendFailure {
509         /// We were unable to find a route to the destination.
510         RouteNotFound,
511         /// We failed to send the payment probes.
512         SendingFailed(
513                 crate::lightning::ln::outbound_payment::PaymentSendFailure),
514 }
515 use lightning::ln::outbound_payment::ProbeSendFailure as ProbeSendFailureImport;
516 pub(crate) type nativeProbeSendFailure = ProbeSendFailureImport;
517
518 impl ProbeSendFailure {
519         #[allow(unused)]
520         pub(crate) fn to_native(&self) -> nativeProbeSendFailure {
521                 match self {
522                         ProbeSendFailure::RouteNotFound => nativeProbeSendFailure::RouteNotFound,
523                         ProbeSendFailure::SendingFailed (ref a, ) => {
524                                 let mut a_nonref = Clone::clone(a);
525                                 nativeProbeSendFailure::SendingFailed (
526                                         a_nonref.into_native(),
527                                 )
528                         },
529                 }
530         }
531         #[allow(unused)]
532         pub(crate) fn into_native(self) -> nativeProbeSendFailure {
533                 match self {
534                         ProbeSendFailure::RouteNotFound => nativeProbeSendFailure::RouteNotFound,
535                         ProbeSendFailure::SendingFailed (mut a, ) => {
536                                 nativeProbeSendFailure::SendingFailed (
537                                         a.into_native(),
538                                 )
539                         },
540                 }
541         }
542         #[allow(unused)]
543         pub(crate) fn from_native(native: &nativeProbeSendFailure) -> Self {
544                 match native {
545                         nativeProbeSendFailure::RouteNotFound => ProbeSendFailure::RouteNotFound,
546                         nativeProbeSendFailure::SendingFailed (ref a, ) => {
547                                 let mut a_nonref = Clone::clone(a);
548                                 ProbeSendFailure::SendingFailed (
549                                         crate::lightning::ln::outbound_payment::PaymentSendFailure::native_into(a_nonref),
550                                 )
551                         },
552                 }
553         }
554         #[allow(unused)]
555         pub(crate) fn native_into(native: nativeProbeSendFailure) -> Self {
556                 match native {
557                         nativeProbeSendFailure::RouteNotFound => ProbeSendFailure::RouteNotFound,
558                         nativeProbeSendFailure::SendingFailed (mut a, ) => {
559                                 ProbeSendFailure::SendingFailed (
560                                         crate::lightning::ln::outbound_payment::PaymentSendFailure::native_into(a),
561                                 )
562                         },
563                 }
564         }
565 }
566 /// Frees any resources used by the ProbeSendFailure
567 #[no_mangle]
568 pub extern "C" fn ProbeSendFailure_free(this_ptr: ProbeSendFailure) { }
569 /// Creates a copy of the ProbeSendFailure
570 #[no_mangle]
571 pub extern "C" fn ProbeSendFailure_clone(orig: &ProbeSendFailure) -> ProbeSendFailure {
572         orig.clone()
573 }
574 #[no_mangle]
575 /// Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
576 pub extern "C" fn ProbeSendFailure_route_not_found() -> ProbeSendFailure {
577         ProbeSendFailure::RouteNotFound}
578 #[no_mangle]
579 /// Utility method to constructs a new SendingFailed-variant ProbeSendFailure
580 pub extern "C" fn ProbeSendFailure_sending_failed(a: crate::lightning::ln::outbound_payment::PaymentSendFailure) -> ProbeSendFailure {
581         ProbeSendFailure::SendingFailed(a, )
582 }
583 /// Checks if two ProbeSendFailures contain equal inner contents.
584 /// This ignores pointers and is_owned flags and looks at the values in fields.
585 #[no_mangle]
586 pub extern "C" fn ProbeSendFailure_eq(a: &ProbeSendFailure, b: &ProbeSendFailure) -> bool {
587         if &a.to_native() == &b.to_native() { true } else { false }
588 }
589
590 use lightning::ln::outbound_payment::RecipientOnionFields as nativeRecipientOnionFieldsImport;
591 pub(crate) type nativeRecipientOnionFields = nativeRecipientOnionFieldsImport;
592
593 /// Information which is provided, encrypted, to the payment recipient when sending HTLCs.
594 ///
595 /// This should generally be constructed with data communicated to us from the recipient (via a
596 /// BOLT11 or BOLT12 invoice).
597 #[must_use]
598 #[repr(C)]
599 pub struct RecipientOnionFields {
600         /// A pointer to the opaque Rust object.
601
602         /// Nearly everywhere, inner must be non-null, however in places where
603         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
604         pub inner: *mut nativeRecipientOnionFields,
605         /// Indicates that this is the only struct which contains the same pointer.
606
607         /// Rust functions which take ownership of an object provided via an argument require
608         /// this to be true and invalidate the object pointed to by inner.
609         pub is_owned: bool,
610 }
611
612 impl Drop for RecipientOnionFields {
613         fn drop(&mut self) {
614                 if self.is_owned && !<*mut nativeRecipientOnionFields>::is_null(self.inner) {
615                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
616                 }
617         }
618 }
619 /// Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
620 #[no_mangle]
621 pub extern "C" fn RecipientOnionFields_free(this_obj: RecipientOnionFields) { }
622 #[allow(unused)]
623 /// Used only if an object of this type is returned as a trait impl by a method
624 pub(crate) extern "C" fn RecipientOnionFields_free_void(this_ptr: *mut c_void) {
625         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeRecipientOnionFields) };
626 }
627 #[allow(unused)]
628 impl RecipientOnionFields {
629         pub(crate) fn get_native_ref(&self) -> &'static nativeRecipientOnionFields {
630                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
631         }
632         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeRecipientOnionFields {
633                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
634         }
635         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
636         pub(crate) fn take_inner(mut self) -> *mut nativeRecipientOnionFields {
637                 assert!(self.is_owned);
638                 let ret = ObjOps::untweak_ptr(self.inner);
639                 self.inner = core::ptr::null_mut();
640                 ret
641         }
642 }
643 /// The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
644 /// in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
645 /// authenticate the sender to the recipient and prevent payment-probing (deanonymization)
646 /// attacks.
647 ///
648 /// If you do not have one, the [`Route`] you pay over must not contain multiple paths as
649 /// multi-path payments require a recipient-provided secret.
650 ///
651 /// Some implementations may reject spontaneous payments with payment secrets, so you may only
652 /// want to provide a secret for a spontaneous payment if MPP is needed and you know your
653 /// recipient will not reject it.
654 #[no_mangle]
655 pub extern "C" fn RecipientOnionFields_get_payment_secret(this_ptr: &RecipientOnionFields) -> crate::c_types::derived::COption_ThirtyTwoBytesZ {
656         let mut inner_val = &mut this_ptr.get_native_mut_ref().payment_secret;
657         let mut local_inner_val = if inner_val.is_none() { crate::c_types::derived::COption_ThirtyTwoBytesZ::None } else { crate::c_types::derived::COption_ThirtyTwoBytesZ::Some(/* WARNING: CLONING CONVERSION HERE! &Option<Enum> is otherwise un-expressable. */ { crate::c_types::ThirtyTwoBytes { data: (*inner_val.as_ref().unwrap()).clone().0 } }) };
658         local_inner_val
659 }
660 /// The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
661 /// in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
662 /// authenticate the sender to the recipient and prevent payment-probing (deanonymization)
663 /// attacks.
664 ///
665 /// If you do not have one, the [`Route`] you pay over must not contain multiple paths as
666 /// multi-path payments require a recipient-provided secret.
667 ///
668 /// Some implementations may reject spontaneous payments with payment secrets, so you may only
669 /// want to provide a secret for a spontaneous payment if MPP is needed and you know your
670 /// recipient will not reject it.
671 #[no_mangle]
672 pub extern "C" fn RecipientOnionFields_set_payment_secret(this_ptr: &mut RecipientOnionFields, mut val: crate::c_types::derived::COption_ThirtyTwoBytesZ) {
673         let mut local_val = { /*val*/ let val_opt = val; if val_opt.is_none() { None } else { Some({ { ::lightning::ln::PaymentSecret({ val_opt.take() }.data) }})} };
674         unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.payment_secret = local_val;
675 }
676 /// The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
677 /// arbitrary length. This gives recipients substantially more flexibility to receive
678 /// additional data.
679 ///
680 /// In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
681 /// scheme to authenticate received payments against expected payments and invoices, this field
682 /// is not used in LDK for received payments, and can be used to store arbitrary data in
683 /// invoices which will be received with the payment.
684 ///
685 /// Note that this field was added to the lightning specification more recently than
686 /// [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
687 /// may not be supported as universally.
688 ///
689 /// Returns a copy of the field.
690 #[no_mangle]
691 pub extern "C" fn RecipientOnionFields_get_payment_metadata(this_ptr: &RecipientOnionFields) -> crate::c_types::derived::COption_CVec_u8ZZ {
692         let mut inner_val = this_ptr.get_native_mut_ref().payment_metadata.clone();
693         let mut local_inner_val = if inner_val.is_none() { crate::c_types::derived::COption_CVec_u8ZZ::None } else { crate::c_types::derived::COption_CVec_u8ZZ::Some( { let mut local_inner_val_0 = Vec::new(); for mut item in inner_val.unwrap().drain(..) { local_inner_val_0.push( { item }); }; local_inner_val_0.into() }) };
694         local_inner_val
695 }
696 /// The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
697 /// arbitrary length. This gives recipients substantially more flexibility to receive
698 /// additional data.
699 ///
700 /// In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
701 /// scheme to authenticate received payments against expected payments and invoices, this field
702 /// is not used in LDK for received payments, and can be used to store arbitrary data in
703 /// invoices which will be received with the payment.
704 ///
705 /// Note that this field was added to the lightning specification more recently than
706 /// [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
707 /// may not be supported as universally.
708 #[no_mangle]
709 pub extern "C" fn RecipientOnionFields_set_payment_metadata(this_ptr: &mut RecipientOnionFields, mut val: crate::c_types::derived::COption_CVec_u8ZZ) {
710         let mut local_val = { /*val*/ let val_opt = val; if val_opt.is_none() { None } else { Some({ { let mut local_val_0 = Vec::new(); for mut item in { val_opt.take() }.into_rust().drain(..) { local_val_0.push( { item }); }; local_val_0 }})} };
711         unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.payment_metadata = local_val;
712 }
713 impl Clone for RecipientOnionFields {
714         fn clone(&self) -> Self {
715                 Self {
716                         inner: if <*mut nativeRecipientOnionFields>::is_null(self.inner) { core::ptr::null_mut() } else {
717                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
718                         is_owned: true,
719                 }
720         }
721 }
722 #[allow(unused)]
723 /// Used only if an object of this type is returned as a trait impl by a method
724 pub(crate) extern "C" fn RecipientOnionFields_clone_void(this_ptr: *const c_void) -> *mut c_void {
725         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRecipientOnionFields)).clone() })) as *mut c_void
726 }
727 #[no_mangle]
728 /// Creates a copy of the RecipientOnionFields
729 pub extern "C" fn RecipientOnionFields_clone(orig: &RecipientOnionFields) -> RecipientOnionFields {
730         orig.clone()
731 }
732 /// Checks if two RecipientOnionFieldss contain equal inner contents.
733 /// This ignores pointers and is_owned flags and looks at the values in fields.
734 /// Two objects with NULL inner values will be considered "equal" here.
735 #[no_mangle]
736 pub extern "C" fn RecipientOnionFields_eq(a: &RecipientOnionFields, b: &RecipientOnionFields) -> bool {
737         if a.inner == b.inner { return true; }
738         if a.inner.is_null() || b.inner.is_null() { return false; }
739         if a.get_native_ref() == b.get_native_ref() { true } else { false }
740 }
741 #[no_mangle]
742 /// Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
743 pub extern "C" fn RecipientOnionFields_write(obj: &crate::lightning::ln::outbound_payment::RecipientOnionFields) -> crate::c_types::derived::CVec_u8Z {
744         crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
745 }
746 #[no_mangle]
747 pub(crate) extern "C" fn RecipientOnionFields_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
748         crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeRecipientOnionFields) })
749 }
750 #[no_mangle]
751 /// Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
752 pub extern "C" fn RecipientOnionFields_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RecipientOnionFieldsDecodeErrorZ {
753         let res: Result<lightning::ln::outbound_payment::RecipientOnionFields, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
754         let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::outbound_payment::RecipientOnionFields { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
755         local_res
756 }
757 /// Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
758 /// set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
759 /// but do not require or provide any further data.
760 #[must_use]
761 #[no_mangle]
762 pub extern "C" fn RecipientOnionFields_secret_only(mut payment_secret: crate::c_types::ThirtyTwoBytes) -> crate::lightning::ln::outbound_payment::RecipientOnionFields {
763         let mut ret = lightning::ln::outbound_payment::RecipientOnionFields::secret_only(::lightning::ln::PaymentSecret(payment_secret.data));
764         crate::lightning::ln::outbound_payment::RecipientOnionFields { inner: ObjOps::heap_alloc(ret), is_owned: true }
765 }
766
767 /// Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
768 /// payable HTLCs except for single-path spontaneous payments, i.e. this should generally
769 /// only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
770 /// a spontaneous MPP this will not work as all MPP require payment secrets; you may
771 /// instead want to use [`RecipientOnionFields::secret_only`].
772 ///
773 /// [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
774 /// [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
775 #[must_use]
776 #[no_mangle]
777 pub extern "C" fn RecipientOnionFields_spontaneous_empty() -> crate::lightning::ln::outbound_payment::RecipientOnionFields {
778         let mut ret = lightning::ln::outbound_payment::RecipientOnionFields::spontaneous_empty();
779         crate::lightning::ln::outbound_payment::RecipientOnionFields { inner: ObjOps::heap_alloc(ret), is_owned: true }
780 }
781
782 /// Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
783 /// TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
784 /// respectively. TLV type numbers must be unique and within the range
785 /// reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
786 ///
787 /// This method will also error for types in the experimental range which have been
788 /// standardized within the protocol, which only includes 5482373484 (keysend) for now.
789 ///
790 /// See [`Self::custom_tlvs`] for more info.
791 #[must_use]
792 #[no_mangle]
793 pub extern "C" fn RecipientOnionFields_with_custom_tlvs(mut this_arg: crate::lightning::ln::outbound_payment::RecipientOnionFields, mut custom_tlvs: crate::c_types::derived::CVec_C2Tuple_u64CVec_u8ZZZ) -> crate::c_types::derived::CResult_RecipientOnionFieldsNoneZ {
794         let mut local_custom_tlvs = Vec::new(); for mut item in custom_tlvs.into_rust().drain(..) { local_custom_tlvs.push( { let (mut orig_custom_tlvs_0_0, mut orig_custom_tlvs_0_1) = item.to_rust(); let mut local_orig_custom_tlvs_0_1 = Vec::new(); for mut item in orig_custom_tlvs_0_1.into_rust().drain(..) { local_orig_custom_tlvs_0_1.push( { item }); }; let mut local_custom_tlvs_0 = (orig_custom_tlvs_0_0, local_orig_custom_tlvs_0_1); local_custom_tlvs_0 }); };
795         let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).with_custom_tlvs(local_custom_tlvs);
796         let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::outbound_payment::RecipientOnionFields { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
797         local_ret
798 }
799
800 /// Gets the custom TLVs that will be sent or have been received.
801 ///
802 /// Custom TLVs allow sending extra application-specific data with a payment. They provide
803 /// additional flexibility on top of payment metadata, as while other implementations may
804 /// require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
805 /// do not have this restriction.
806 ///
807 /// Note that if this field is non-empty, it will contain strictly increasing TLVs, each
808 /// represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
809 /// This is validated when setting this field using [`Self::with_custom_tlvs`].
810 #[must_use]
811 #[no_mangle]
812 pub extern "C" fn RecipientOnionFields_custom_tlvs(this_arg: &crate::lightning::ln::outbound_payment::RecipientOnionFields) -> crate::c_types::derived::CVec_C2Tuple_u64CVec_u8ZZZ {
813         let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.custom_tlvs();
814         let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { let (mut orig_ret_0_0, mut orig_ret_0_1) = item; let mut local_orig_ret_0_1 = Vec::new(); for mut item in orig_ret_0_1.drain(..) { local_orig_ret_0_1.push( { item }); }; let mut local_ret_0 = (orig_ret_0_0, local_orig_ret_0_1.into()).into(); local_ret_0 }); };
815         local_ret.into()
816 }
817