Update auto-generated bindings
[ldk-c-bindings] / lightning-c-bindings / src / lightning / offers / parse.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 //! Parsing and formatting for bech32 message encoding.
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 mod sealed {
21
22 use alloc::str::FromStr;
23 use alloc::string::String;
24 use core::ffi::c_void;
25 use core::convert::Infallible;
26 use bitcoin::hashes::Hash;
27 use crate::c_types::*;
28 #[cfg(feature="no-std")]
29 use alloc::{vec::Vec, boxed::Box};
30
31 }
32
33 use lightning::offers::parse::Bolt12ParseError as nativeBolt12ParseErrorImport;
34 pub(crate) type nativeBolt12ParseError = nativeBolt12ParseErrorImport;
35
36 /// Error when parsing a bech32 encoded message using [`str::parse`].
37 #[must_use]
38 #[repr(C)]
39 pub struct Bolt12ParseError {
40         /// A pointer to the opaque Rust object.
41
42         /// Nearly everywhere, inner must be non-null, however in places where
43         /// the Rust equivalent takes an Option, it may be set to null to indicate None.
44         pub inner: *mut nativeBolt12ParseError,
45         /// Indicates that this is the only struct which contains the same pointer.
46
47         /// Rust functions which take ownership of an object provided via an argument require
48         /// this to be true and invalidate the object pointed to by inner.
49         pub is_owned: bool,
50 }
51
52 impl Drop for Bolt12ParseError {
53         fn drop(&mut self) {
54                 if self.is_owned && !<*mut nativeBolt12ParseError>::is_null(self.inner) {
55                         let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
56                 }
57         }
58 }
59 /// Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
60 #[no_mangle]
61 pub extern "C" fn Bolt12ParseError_free(this_obj: Bolt12ParseError) { }
62 #[allow(unused)]
63 /// Used only if an object of this type is returned as a trait impl by a method
64 pub(crate) extern "C" fn Bolt12ParseError_free_void(this_ptr: *mut c_void) {
65         let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBolt12ParseError) };
66 }
67 #[allow(unused)]
68 impl Bolt12ParseError {
69         pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12ParseError {
70                 unsafe { &*ObjOps::untweak_ptr(self.inner) }
71         }
72         pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12ParseError {
73                 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
74         }
75         /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
76         pub(crate) fn take_inner(mut self) -> *mut nativeBolt12ParseError {
77                 assert!(self.is_owned);
78                 let ret = ObjOps::untweak_ptr(self.inner);
79                 self.inner = core::ptr::null_mut();
80                 ret
81         }
82 }
83 impl Clone for Bolt12ParseError {
84         fn clone(&self) -> Self {
85                 Self {
86                         inner: if <*mut nativeBolt12ParseError>::is_null(self.inner) { core::ptr::null_mut() } else {
87                                 ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
88                         is_owned: true,
89                 }
90         }
91 }
92 #[allow(unused)]
93 /// Used only if an object of this type is returned as a trait impl by a method
94 pub(crate) extern "C" fn Bolt12ParseError_clone_void(this_ptr: *const c_void) -> *mut c_void {
95         Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12ParseError)).clone() })) as *mut c_void
96 }
97 #[no_mangle]
98 /// Creates a copy of the Bolt12ParseError
99 pub extern "C" fn Bolt12ParseError_clone(orig: &Bolt12ParseError) -> Bolt12ParseError {
100         orig.clone()
101 }
102 /// Error when interpreting a TLV stream as a specific type.
103 #[derive(Clone)]
104 #[must_use]
105 #[repr(C)]
106 pub enum Bolt12SemanticError {
107         /// The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
108         AlreadyExpired,
109         /// The provided chain hash does not correspond to a supported chain.
110         UnsupportedChain,
111         /// A chain was provided but was not expected.
112         UnexpectedChain,
113         /// An amount was expected but was missing.
114         MissingAmount,
115         /// The amount exceeded the total bitcoin supply.
116         InvalidAmount,
117         /// An amount was provided but was not sufficient in value.
118         InsufficientAmount,
119         /// An amount was provided but was not expected.
120         UnexpectedAmount,
121         /// A currency was provided that is not supported.
122         UnsupportedCurrency,
123         /// A feature was required but is unknown.
124         UnknownRequiredFeatures,
125         /// Features were provided but were not expected.
126         UnexpectedFeatures,
127         /// A required description was not provided.
128         MissingDescription,
129         /// A signing pubkey was not provided.
130         MissingSigningPubkey,
131         /// A signing pubkey was provided but a different one was expected.
132         InvalidSigningPubkey,
133         /// A signing pubkey was provided but was not expected.
134         UnexpectedSigningPubkey,
135         /// A quantity was expected but was missing.
136         MissingQuantity,
137         /// An unsupported quantity was provided.
138         InvalidQuantity,
139         /// A quantity or quantity bounds was provided but was not expected.
140         UnexpectedQuantity,
141         /// Metadata could not be used to verify the offers message.
142         InvalidMetadata,
143         /// Metadata was provided but was not expected.
144         UnexpectedMetadata,
145         /// Payer metadata was expected but was missing.
146         MissingPayerMetadata,
147         /// A payer id was expected but was missing.
148         MissingPayerId,
149         /// Blinded paths were expected but were missing.
150         MissingPaths,
151         /// The blinded payinfo given does not match the number of blinded path hops.
152         InvalidPayInfo,
153         /// An invoice creation time was expected but was missing.
154         MissingCreationTime,
155         /// An invoice payment hash was expected but was missing.
156         MissingPaymentHash,
157         /// A signature was expected but was missing.
158         MissingSignature,
159 }
160 use lightning::offers::parse::Bolt12SemanticError as Bolt12SemanticErrorImport;
161 pub(crate) type nativeBolt12SemanticError = Bolt12SemanticErrorImport;
162
163 impl Bolt12SemanticError {
164         #[allow(unused)]
165         pub(crate) fn to_native(&self) -> nativeBolt12SemanticError {
166                 match self {
167                         Bolt12SemanticError::AlreadyExpired => nativeBolt12SemanticError::AlreadyExpired,
168                         Bolt12SemanticError::UnsupportedChain => nativeBolt12SemanticError::UnsupportedChain,
169                         Bolt12SemanticError::UnexpectedChain => nativeBolt12SemanticError::UnexpectedChain,
170                         Bolt12SemanticError::MissingAmount => nativeBolt12SemanticError::MissingAmount,
171                         Bolt12SemanticError::InvalidAmount => nativeBolt12SemanticError::InvalidAmount,
172                         Bolt12SemanticError::InsufficientAmount => nativeBolt12SemanticError::InsufficientAmount,
173                         Bolt12SemanticError::UnexpectedAmount => nativeBolt12SemanticError::UnexpectedAmount,
174                         Bolt12SemanticError::UnsupportedCurrency => nativeBolt12SemanticError::UnsupportedCurrency,
175                         Bolt12SemanticError::UnknownRequiredFeatures => nativeBolt12SemanticError::UnknownRequiredFeatures,
176                         Bolt12SemanticError::UnexpectedFeatures => nativeBolt12SemanticError::UnexpectedFeatures,
177                         Bolt12SemanticError::MissingDescription => nativeBolt12SemanticError::MissingDescription,
178                         Bolt12SemanticError::MissingSigningPubkey => nativeBolt12SemanticError::MissingSigningPubkey,
179                         Bolt12SemanticError::InvalidSigningPubkey => nativeBolt12SemanticError::InvalidSigningPubkey,
180                         Bolt12SemanticError::UnexpectedSigningPubkey => nativeBolt12SemanticError::UnexpectedSigningPubkey,
181                         Bolt12SemanticError::MissingQuantity => nativeBolt12SemanticError::MissingQuantity,
182                         Bolt12SemanticError::InvalidQuantity => nativeBolt12SemanticError::InvalidQuantity,
183                         Bolt12SemanticError::UnexpectedQuantity => nativeBolt12SemanticError::UnexpectedQuantity,
184                         Bolt12SemanticError::InvalidMetadata => nativeBolt12SemanticError::InvalidMetadata,
185                         Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata,
186                         Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata,
187                         Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId,
188                         Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths,
189                         Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo,
190                         Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime,
191                         Bolt12SemanticError::MissingPaymentHash => nativeBolt12SemanticError::MissingPaymentHash,
192                         Bolt12SemanticError::MissingSignature => nativeBolt12SemanticError::MissingSignature,
193                 }
194         }
195         #[allow(unused)]
196         pub(crate) fn into_native(self) -> nativeBolt12SemanticError {
197                 match self {
198                         Bolt12SemanticError::AlreadyExpired => nativeBolt12SemanticError::AlreadyExpired,
199                         Bolt12SemanticError::UnsupportedChain => nativeBolt12SemanticError::UnsupportedChain,
200                         Bolt12SemanticError::UnexpectedChain => nativeBolt12SemanticError::UnexpectedChain,
201                         Bolt12SemanticError::MissingAmount => nativeBolt12SemanticError::MissingAmount,
202                         Bolt12SemanticError::InvalidAmount => nativeBolt12SemanticError::InvalidAmount,
203                         Bolt12SemanticError::InsufficientAmount => nativeBolt12SemanticError::InsufficientAmount,
204                         Bolt12SemanticError::UnexpectedAmount => nativeBolt12SemanticError::UnexpectedAmount,
205                         Bolt12SemanticError::UnsupportedCurrency => nativeBolt12SemanticError::UnsupportedCurrency,
206                         Bolt12SemanticError::UnknownRequiredFeatures => nativeBolt12SemanticError::UnknownRequiredFeatures,
207                         Bolt12SemanticError::UnexpectedFeatures => nativeBolt12SemanticError::UnexpectedFeatures,
208                         Bolt12SemanticError::MissingDescription => nativeBolt12SemanticError::MissingDescription,
209                         Bolt12SemanticError::MissingSigningPubkey => nativeBolt12SemanticError::MissingSigningPubkey,
210                         Bolt12SemanticError::InvalidSigningPubkey => nativeBolt12SemanticError::InvalidSigningPubkey,
211                         Bolt12SemanticError::UnexpectedSigningPubkey => nativeBolt12SemanticError::UnexpectedSigningPubkey,
212                         Bolt12SemanticError::MissingQuantity => nativeBolt12SemanticError::MissingQuantity,
213                         Bolt12SemanticError::InvalidQuantity => nativeBolt12SemanticError::InvalidQuantity,
214                         Bolt12SemanticError::UnexpectedQuantity => nativeBolt12SemanticError::UnexpectedQuantity,
215                         Bolt12SemanticError::InvalidMetadata => nativeBolt12SemanticError::InvalidMetadata,
216                         Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata,
217                         Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata,
218                         Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId,
219                         Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths,
220                         Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo,
221                         Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime,
222                         Bolt12SemanticError::MissingPaymentHash => nativeBolt12SemanticError::MissingPaymentHash,
223                         Bolt12SemanticError::MissingSignature => nativeBolt12SemanticError::MissingSignature,
224                 }
225         }
226         #[allow(unused)]
227         pub(crate) fn from_native(native: &nativeBolt12SemanticError) -> Self {
228                 match native {
229                         nativeBolt12SemanticError::AlreadyExpired => Bolt12SemanticError::AlreadyExpired,
230                         nativeBolt12SemanticError::UnsupportedChain => Bolt12SemanticError::UnsupportedChain,
231                         nativeBolt12SemanticError::UnexpectedChain => Bolt12SemanticError::UnexpectedChain,
232                         nativeBolt12SemanticError::MissingAmount => Bolt12SemanticError::MissingAmount,
233                         nativeBolt12SemanticError::InvalidAmount => Bolt12SemanticError::InvalidAmount,
234                         nativeBolt12SemanticError::InsufficientAmount => Bolt12SemanticError::InsufficientAmount,
235                         nativeBolt12SemanticError::UnexpectedAmount => Bolt12SemanticError::UnexpectedAmount,
236                         nativeBolt12SemanticError::UnsupportedCurrency => Bolt12SemanticError::UnsupportedCurrency,
237                         nativeBolt12SemanticError::UnknownRequiredFeatures => Bolt12SemanticError::UnknownRequiredFeatures,
238                         nativeBolt12SemanticError::UnexpectedFeatures => Bolt12SemanticError::UnexpectedFeatures,
239                         nativeBolt12SemanticError::MissingDescription => Bolt12SemanticError::MissingDescription,
240                         nativeBolt12SemanticError::MissingSigningPubkey => Bolt12SemanticError::MissingSigningPubkey,
241                         nativeBolt12SemanticError::InvalidSigningPubkey => Bolt12SemanticError::InvalidSigningPubkey,
242                         nativeBolt12SemanticError::UnexpectedSigningPubkey => Bolt12SemanticError::UnexpectedSigningPubkey,
243                         nativeBolt12SemanticError::MissingQuantity => Bolt12SemanticError::MissingQuantity,
244                         nativeBolt12SemanticError::InvalidQuantity => Bolt12SemanticError::InvalidQuantity,
245                         nativeBolt12SemanticError::UnexpectedQuantity => Bolt12SemanticError::UnexpectedQuantity,
246                         nativeBolt12SemanticError::InvalidMetadata => Bolt12SemanticError::InvalidMetadata,
247                         nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata,
248                         nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata,
249                         nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId,
250                         nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths,
251                         nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo,
252                         nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime,
253                         nativeBolt12SemanticError::MissingPaymentHash => Bolt12SemanticError::MissingPaymentHash,
254                         nativeBolt12SemanticError::MissingSignature => Bolt12SemanticError::MissingSignature,
255                 }
256         }
257         #[allow(unused)]
258         pub(crate) fn native_into(native: nativeBolt12SemanticError) -> Self {
259                 match native {
260                         nativeBolt12SemanticError::AlreadyExpired => Bolt12SemanticError::AlreadyExpired,
261                         nativeBolt12SemanticError::UnsupportedChain => Bolt12SemanticError::UnsupportedChain,
262                         nativeBolt12SemanticError::UnexpectedChain => Bolt12SemanticError::UnexpectedChain,
263                         nativeBolt12SemanticError::MissingAmount => Bolt12SemanticError::MissingAmount,
264                         nativeBolt12SemanticError::InvalidAmount => Bolt12SemanticError::InvalidAmount,
265                         nativeBolt12SemanticError::InsufficientAmount => Bolt12SemanticError::InsufficientAmount,
266                         nativeBolt12SemanticError::UnexpectedAmount => Bolt12SemanticError::UnexpectedAmount,
267                         nativeBolt12SemanticError::UnsupportedCurrency => Bolt12SemanticError::UnsupportedCurrency,
268                         nativeBolt12SemanticError::UnknownRequiredFeatures => Bolt12SemanticError::UnknownRequiredFeatures,
269                         nativeBolt12SemanticError::UnexpectedFeatures => Bolt12SemanticError::UnexpectedFeatures,
270                         nativeBolt12SemanticError::MissingDescription => Bolt12SemanticError::MissingDescription,
271                         nativeBolt12SemanticError::MissingSigningPubkey => Bolt12SemanticError::MissingSigningPubkey,
272                         nativeBolt12SemanticError::InvalidSigningPubkey => Bolt12SemanticError::InvalidSigningPubkey,
273                         nativeBolt12SemanticError::UnexpectedSigningPubkey => Bolt12SemanticError::UnexpectedSigningPubkey,
274                         nativeBolt12SemanticError::MissingQuantity => Bolt12SemanticError::MissingQuantity,
275                         nativeBolt12SemanticError::InvalidQuantity => Bolt12SemanticError::InvalidQuantity,
276                         nativeBolt12SemanticError::UnexpectedQuantity => Bolt12SemanticError::UnexpectedQuantity,
277                         nativeBolt12SemanticError::InvalidMetadata => Bolt12SemanticError::InvalidMetadata,
278                         nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata,
279                         nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata,
280                         nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId,
281                         nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths,
282                         nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo,
283                         nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime,
284                         nativeBolt12SemanticError::MissingPaymentHash => Bolt12SemanticError::MissingPaymentHash,
285                         nativeBolt12SemanticError::MissingSignature => Bolt12SemanticError::MissingSignature,
286                 }
287         }
288 }
289 /// Creates a copy of the Bolt12SemanticError
290 #[no_mangle]
291 pub extern "C" fn Bolt12SemanticError_clone(orig: &Bolt12SemanticError) -> Bolt12SemanticError {
292         orig.clone()
293 }
294 #[no_mangle]
295 /// Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
296 pub extern "C" fn Bolt12SemanticError_already_expired() -> Bolt12SemanticError {
297         Bolt12SemanticError::AlreadyExpired}
298 #[no_mangle]
299 /// Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
300 pub extern "C" fn Bolt12SemanticError_unsupported_chain() -> Bolt12SemanticError {
301         Bolt12SemanticError::UnsupportedChain}
302 #[no_mangle]
303 /// Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
304 pub extern "C" fn Bolt12SemanticError_unexpected_chain() -> Bolt12SemanticError {
305         Bolt12SemanticError::UnexpectedChain}
306 #[no_mangle]
307 /// Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
308 pub extern "C" fn Bolt12SemanticError_missing_amount() -> Bolt12SemanticError {
309         Bolt12SemanticError::MissingAmount}
310 #[no_mangle]
311 /// Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
312 pub extern "C" fn Bolt12SemanticError_invalid_amount() -> Bolt12SemanticError {
313         Bolt12SemanticError::InvalidAmount}
314 #[no_mangle]
315 /// Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
316 pub extern "C" fn Bolt12SemanticError_insufficient_amount() -> Bolt12SemanticError {
317         Bolt12SemanticError::InsufficientAmount}
318 #[no_mangle]
319 /// Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
320 pub extern "C" fn Bolt12SemanticError_unexpected_amount() -> Bolt12SemanticError {
321         Bolt12SemanticError::UnexpectedAmount}
322 #[no_mangle]
323 /// Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
324 pub extern "C" fn Bolt12SemanticError_unsupported_currency() -> Bolt12SemanticError {
325         Bolt12SemanticError::UnsupportedCurrency}
326 #[no_mangle]
327 /// Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
328 pub extern "C" fn Bolt12SemanticError_unknown_required_features() -> Bolt12SemanticError {
329         Bolt12SemanticError::UnknownRequiredFeatures}
330 #[no_mangle]
331 /// Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
332 pub extern "C" fn Bolt12SemanticError_unexpected_features() -> Bolt12SemanticError {
333         Bolt12SemanticError::UnexpectedFeatures}
334 #[no_mangle]
335 /// Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
336 pub extern "C" fn Bolt12SemanticError_missing_description() -> Bolt12SemanticError {
337         Bolt12SemanticError::MissingDescription}
338 #[no_mangle]
339 /// Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
340 pub extern "C" fn Bolt12SemanticError_missing_signing_pubkey() -> Bolt12SemanticError {
341         Bolt12SemanticError::MissingSigningPubkey}
342 #[no_mangle]
343 /// Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
344 pub extern "C" fn Bolt12SemanticError_invalid_signing_pubkey() -> Bolt12SemanticError {
345         Bolt12SemanticError::InvalidSigningPubkey}
346 #[no_mangle]
347 /// Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
348 pub extern "C" fn Bolt12SemanticError_unexpected_signing_pubkey() -> Bolt12SemanticError {
349         Bolt12SemanticError::UnexpectedSigningPubkey}
350 #[no_mangle]
351 /// Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
352 pub extern "C" fn Bolt12SemanticError_missing_quantity() -> Bolt12SemanticError {
353         Bolt12SemanticError::MissingQuantity}
354 #[no_mangle]
355 /// Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
356 pub extern "C" fn Bolt12SemanticError_invalid_quantity() -> Bolt12SemanticError {
357         Bolt12SemanticError::InvalidQuantity}
358 #[no_mangle]
359 /// Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
360 pub extern "C" fn Bolt12SemanticError_unexpected_quantity() -> Bolt12SemanticError {
361         Bolt12SemanticError::UnexpectedQuantity}
362 #[no_mangle]
363 /// Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
364 pub extern "C" fn Bolt12SemanticError_invalid_metadata() -> Bolt12SemanticError {
365         Bolt12SemanticError::InvalidMetadata}
366 #[no_mangle]
367 /// Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
368 pub extern "C" fn Bolt12SemanticError_unexpected_metadata() -> Bolt12SemanticError {
369         Bolt12SemanticError::UnexpectedMetadata}
370 #[no_mangle]
371 /// Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
372 pub extern "C" fn Bolt12SemanticError_missing_payer_metadata() -> Bolt12SemanticError {
373         Bolt12SemanticError::MissingPayerMetadata}
374 #[no_mangle]
375 /// Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
376 pub extern "C" fn Bolt12SemanticError_missing_payer_id() -> Bolt12SemanticError {
377         Bolt12SemanticError::MissingPayerId}
378 #[no_mangle]
379 /// Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
380 pub extern "C" fn Bolt12SemanticError_missing_paths() -> Bolt12SemanticError {
381         Bolt12SemanticError::MissingPaths}
382 #[no_mangle]
383 /// Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
384 pub extern "C" fn Bolt12SemanticError_invalid_pay_info() -> Bolt12SemanticError {
385         Bolt12SemanticError::InvalidPayInfo}
386 #[no_mangle]
387 /// Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
388 pub extern "C" fn Bolt12SemanticError_missing_creation_time() -> Bolt12SemanticError {
389         Bolt12SemanticError::MissingCreationTime}
390 #[no_mangle]
391 /// Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
392 pub extern "C" fn Bolt12SemanticError_missing_payment_hash() -> Bolt12SemanticError {
393         Bolt12SemanticError::MissingPaymentHash}
394 #[no_mangle]
395 /// Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
396 pub extern "C" fn Bolt12SemanticError_missing_signature() -> Bolt12SemanticError {
397         Bolt12SemanticError::MissingSignature}