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