1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
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.
9 //! Parsing and formatting for bech32 message encoding.
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};
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};
33 use lightning::offers::parse::Bolt12ParseError as nativeBolt12ParseErrorImport;
34 pub(crate) type nativeBolt12ParseError = nativeBolt12ParseErrorImport;
36 /// Error when parsing a bech32 encoded message using [`str::parse`].
39 pub struct Bolt12ParseError {
40 /// A pointer to the opaque Rust object.
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.
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.
52 impl Drop for Bolt12ParseError {
54 if self.is_owned && !<*mut nativeBolt12ParseError>::is_null(self.inner) {
55 let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
59 /// Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
61 pub extern "C" fn Bolt12ParseError_free(this_obj: Bolt12ParseError) { }
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) };
68 impl Bolt12ParseError {
69 pub(crate) fn get_native_ref(&self) -> &'static nativeBolt12ParseError {
70 unsafe { &*ObjOps::untweak_ptr(self.inner) }
72 pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeBolt12ParseError {
73 unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
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();
83 impl Clone for Bolt12ParseError {
84 fn clone(&self) -> 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()) },
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 *const nativeBolt12ParseError)).clone() })) as *mut c_void
98 /// Creates a copy of the Bolt12ParseError
99 pub extern "C" fn Bolt12ParseError_clone(orig: &Bolt12ParseError) -> Bolt12ParseError {
102 /// Error when interpreting a TLV stream as a specific type.
106 pub enum Bolt12SemanticError {
107 /// The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
109 /// The provided chain hash does not correspond to a supported chain.
111 /// A chain was provided but was not expected.
113 /// An amount was expected but was missing.
115 /// The amount exceeded the total bitcoin supply.
117 /// An amount was provided but was not sufficient in value.
119 /// An amount was provided but was not expected.
121 /// A currency was provided that is not supported.
123 /// A feature was required but is unknown.
124 UnknownRequiredFeatures,
125 /// Features were provided but were not expected.
127 /// A required description was not provided.
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.
137 /// An unsupported quantity was provided.
139 /// A quantity or quantity bounds was provided but was not expected.
141 /// Metadata could not be used to verify the offers message.
143 /// Metadata was provided but was not expected.
145 /// Payer metadata was expected but was missing.
146 MissingPayerMetadata,
147 /// A payer id was expected but was missing.
149 /// The payment id for a refund or request is already in use.
151 /// Blinded paths were expected but were missing.
153 /// The blinded payinfo given does not match the number of blinded path hops.
155 /// An invoice creation time was expected but was missing.
157 /// An invoice payment hash was expected but was missing.
159 /// A signature was expected but was missing.
162 use lightning::offers::parse::Bolt12SemanticError as Bolt12SemanticErrorImport;
163 pub(crate) type nativeBolt12SemanticError = Bolt12SemanticErrorImport;
165 impl Bolt12SemanticError {
167 pub(crate) fn to_native(&self) -> nativeBolt12SemanticError {
169 Bolt12SemanticError::AlreadyExpired => nativeBolt12SemanticError::AlreadyExpired,
170 Bolt12SemanticError::UnsupportedChain => nativeBolt12SemanticError::UnsupportedChain,
171 Bolt12SemanticError::UnexpectedChain => nativeBolt12SemanticError::UnexpectedChain,
172 Bolt12SemanticError::MissingAmount => nativeBolt12SemanticError::MissingAmount,
173 Bolt12SemanticError::InvalidAmount => nativeBolt12SemanticError::InvalidAmount,
174 Bolt12SemanticError::InsufficientAmount => nativeBolt12SemanticError::InsufficientAmount,
175 Bolt12SemanticError::UnexpectedAmount => nativeBolt12SemanticError::UnexpectedAmount,
176 Bolt12SemanticError::UnsupportedCurrency => nativeBolt12SemanticError::UnsupportedCurrency,
177 Bolt12SemanticError::UnknownRequiredFeatures => nativeBolt12SemanticError::UnknownRequiredFeatures,
178 Bolt12SemanticError::UnexpectedFeatures => nativeBolt12SemanticError::UnexpectedFeatures,
179 Bolt12SemanticError::MissingDescription => nativeBolt12SemanticError::MissingDescription,
180 Bolt12SemanticError::MissingSigningPubkey => nativeBolt12SemanticError::MissingSigningPubkey,
181 Bolt12SemanticError::InvalidSigningPubkey => nativeBolt12SemanticError::InvalidSigningPubkey,
182 Bolt12SemanticError::UnexpectedSigningPubkey => nativeBolt12SemanticError::UnexpectedSigningPubkey,
183 Bolt12SemanticError::MissingQuantity => nativeBolt12SemanticError::MissingQuantity,
184 Bolt12SemanticError::InvalidQuantity => nativeBolt12SemanticError::InvalidQuantity,
185 Bolt12SemanticError::UnexpectedQuantity => nativeBolt12SemanticError::UnexpectedQuantity,
186 Bolt12SemanticError::InvalidMetadata => nativeBolt12SemanticError::InvalidMetadata,
187 Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata,
188 Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata,
189 Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId,
190 Bolt12SemanticError::DuplicatePaymentId => nativeBolt12SemanticError::DuplicatePaymentId,
191 Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths,
192 Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo,
193 Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime,
194 Bolt12SemanticError::MissingPaymentHash => nativeBolt12SemanticError::MissingPaymentHash,
195 Bolt12SemanticError::MissingSignature => nativeBolt12SemanticError::MissingSignature,
199 pub(crate) fn into_native(self) -> nativeBolt12SemanticError {
201 Bolt12SemanticError::AlreadyExpired => nativeBolt12SemanticError::AlreadyExpired,
202 Bolt12SemanticError::UnsupportedChain => nativeBolt12SemanticError::UnsupportedChain,
203 Bolt12SemanticError::UnexpectedChain => nativeBolt12SemanticError::UnexpectedChain,
204 Bolt12SemanticError::MissingAmount => nativeBolt12SemanticError::MissingAmount,
205 Bolt12SemanticError::InvalidAmount => nativeBolt12SemanticError::InvalidAmount,
206 Bolt12SemanticError::InsufficientAmount => nativeBolt12SemanticError::InsufficientAmount,
207 Bolt12SemanticError::UnexpectedAmount => nativeBolt12SemanticError::UnexpectedAmount,
208 Bolt12SemanticError::UnsupportedCurrency => nativeBolt12SemanticError::UnsupportedCurrency,
209 Bolt12SemanticError::UnknownRequiredFeatures => nativeBolt12SemanticError::UnknownRequiredFeatures,
210 Bolt12SemanticError::UnexpectedFeatures => nativeBolt12SemanticError::UnexpectedFeatures,
211 Bolt12SemanticError::MissingDescription => nativeBolt12SemanticError::MissingDescription,
212 Bolt12SemanticError::MissingSigningPubkey => nativeBolt12SemanticError::MissingSigningPubkey,
213 Bolt12SemanticError::InvalidSigningPubkey => nativeBolt12SemanticError::InvalidSigningPubkey,
214 Bolt12SemanticError::UnexpectedSigningPubkey => nativeBolt12SemanticError::UnexpectedSigningPubkey,
215 Bolt12SemanticError::MissingQuantity => nativeBolt12SemanticError::MissingQuantity,
216 Bolt12SemanticError::InvalidQuantity => nativeBolt12SemanticError::InvalidQuantity,
217 Bolt12SemanticError::UnexpectedQuantity => nativeBolt12SemanticError::UnexpectedQuantity,
218 Bolt12SemanticError::InvalidMetadata => nativeBolt12SemanticError::InvalidMetadata,
219 Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata,
220 Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata,
221 Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId,
222 Bolt12SemanticError::DuplicatePaymentId => nativeBolt12SemanticError::DuplicatePaymentId,
223 Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths,
224 Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo,
225 Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime,
226 Bolt12SemanticError::MissingPaymentHash => nativeBolt12SemanticError::MissingPaymentHash,
227 Bolt12SemanticError::MissingSignature => nativeBolt12SemanticError::MissingSignature,
231 pub(crate) fn from_native(native: &nativeBolt12SemanticError) -> Self {
233 nativeBolt12SemanticError::AlreadyExpired => Bolt12SemanticError::AlreadyExpired,
234 nativeBolt12SemanticError::UnsupportedChain => Bolt12SemanticError::UnsupportedChain,
235 nativeBolt12SemanticError::UnexpectedChain => Bolt12SemanticError::UnexpectedChain,
236 nativeBolt12SemanticError::MissingAmount => Bolt12SemanticError::MissingAmount,
237 nativeBolt12SemanticError::InvalidAmount => Bolt12SemanticError::InvalidAmount,
238 nativeBolt12SemanticError::InsufficientAmount => Bolt12SemanticError::InsufficientAmount,
239 nativeBolt12SemanticError::UnexpectedAmount => Bolt12SemanticError::UnexpectedAmount,
240 nativeBolt12SemanticError::UnsupportedCurrency => Bolt12SemanticError::UnsupportedCurrency,
241 nativeBolt12SemanticError::UnknownRequiredFeatures => Bolt12SemanticError::UnknownRequiredFeatures,
242 nativeBolt12SemanticError::UnexpectedFeatures => Bolt12SemanticError::UnexpectedFeatures,
243 nativeBolt12SemanticError::MissingDescription => Bolt12SemanticError::MissingDescription,
244 nativeBolt12SemanticError::MissingSigningPubkey => Bolt12SemanticError::MissingSigningPubkey,
245 nativeBolt12SemanticError::InvalidSigningPubkey => Bolt12SemanticError::InvalidSigningPubkey,
246 nativeBolt12SemanticError::UnexpectedSigningPubkey => Bolt12SemanticError::UnexpectedSigningPubkey,
247 nativeBolt12SemanticError::MissingQuantity => Bolt12SemanticError::MissingQuantity,
248 nativeBolt12SemanticError::InvalidQuantity => Bolt12SemanticError::InvalidQuantity,
249 nativeBolt12SemanticError::UnexpectedQuantity => Bolt12SemanticError::UnexpectedQuantity,
250 nativeBolt12SemanticError::InvalidMetadata => Bolt12SemanticError::InvalidMetadata,
251 nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata,
252 nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata,
253 nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId,
254 nativeBolt12SemanticError::DuplicatePaymentId => Bolt12SemanticError::DuplicatePaymentId,
255 nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths,
256 nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo,
257 nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime,
258 nativeBolt12SemanticError::MissingPaymentHash => Bolt12SemanticError::MissingPaymentHash,
259 nativeBolt12SemanticError::MissingSignature => Bolt12SemanticError::MissingSignature,
263 pub(crate) fn native_into(native: nativeBolt12SemanticError) -> Self {
265 nativeBolt12SemanticError::AlreadyExpired => Bolt12SemanticError::AlreadyExpired,
266 nativeBolt12SemanticError::UnsupportedChain => Bolt12SemanticError::UnsupportedChain,
267 nativeBolt12SemanticError::UnexpectedChain => Bolt12SemanticError::UnexpectedChain,
268 nativeBolt12SemanticError::MissingAmount => Bolt12SemanticError::MissingAmount,
269 nativeBolt12SemanticError::InvalidAmount => Bolt12SemanticError::InvalidAmount,
270 nativeBolt12SemanticError::InsufficientAmount => Bolt12SemanticError::InsufficientAmount,
271 nativeBolt12SemanticError::UnexpectedAmount => Bolt12SemanticError::UnexpectedAmount,
272 nativeBolt12SemanticError::UnsupportedCurrency => Bolt12SemanticError::UnsupportedCurrency,
273 nativeBolt12SemanticError::UnknownRequiredFeatures => Bolt12SemanticError::UnknownRequiredFeatures,
274 nativeBolt12SemanticError::UnexpectedFeatures => Bolt12SemanticError::UnexpectedFeatures,
275 nativeBolt12SemanticError::MissingDescription => Bolt12SemanticError::MissingDescription,
276 nativeBolt12SemanticError::MissingSigningPubkey => Bolt12SemanticError::MissingSigningPubkey,
277 nativeBolt12SemanticError::InvalidSigningPubkey => Bolt12SemanticError::InvalidSigningPubkey,
278 nativeBolt12SemanticError::UnexpectedSigningPubkey => Bolt12SemanticError::UnexpectedSigningPubkey,
279 nativeBolt12SemanticError::MissingQuantity => Bolt12SemanticError::MissingQuantity,
280 nativeBolt12SemanticError::InvalidQuantity => Bolt12SemanticError::InvalidQuantity,
281 nativeBolt12SemanticError::UnexpectedQuantity => Bolt12SemanticError::UnexpectedQuantity,
282 nativeBolt12SemanticError::InvalidMetadata => Bolt12SemanticError::InvalidMetadata,
283 nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata,
284 nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata,
285 nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId,
286 nativeBolt12SemanticError::DuplicatePaymentId => Bolt12SemanticError::DuplicatePaymentId,
287 nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths,
288 nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo,
289 nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime,
290 nativeBolt12SemanticError::MissingPaymentHash => Bolt12SemanticError::MissingPaymentHash,
291 nativeBolt12SemanticError::MissingSignature => Bolt12SemanticError::MissingSignature,
295 /// Creates a copy of the Bolt12SemanticError
297 pub extern "C" fn Bolt12SemanticError_clone(orig: &Bolt12SemanticError) -> Bolt12SemanticError {
301 /// Used only if an object of this type is returned as a trait impl by a method
302 pub(crate) extern "C" fn Bolt12SemanticError_clone_void(this_ptr: *const c_void) -> *mut c_void {
303 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const Bolt12SemanticError)).clone() })) as *mut c_void
306 /// Used only if an object of this type is returned as a trait impl by a method
307 pub(crate) extern "C" fn Bolt12SemanticError_free_void(this_ptr: *mut c_void) {
308 let _ = unsafe { Box::from_raw(this_ptr as *mut Bolt12SemanticError) };
311 /// Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
312 pub extern "C" fn Bolt12SemanticError_already_expired() -> Bolt12SemanticError {
313 Bolt12SemanticError::AlreadyExpired}
315 /// Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
316 pub extern "C" fn Bolt12SemanticError_unsupported_chain() -> Bolt12SemanticError {
317 Bolt12SemanticError::UnsupportedChain}
319 /// Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
320 pub extern "C" fn Bolt12SemanticError_unexpected_chain() -> Bolt12SemanticError {
321 Bolt12SemanticError::UnexpectedChain}
323 /// Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
324 pub extern "C" fn Bolt12SemanticError_missing_amount() -> Bolt12SemanticError {
325 Bolt12SemanticError::MissingAmount}
327 /// Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
328 pub extern "C" fn Bolt12SemanticError_invalid_amount() -> Bolt12SemanticError {
329 Bolt12SemanticError::InvalidAmount}
331 /// Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
332 pub extern "C" fn Bolt12SemanticError_insufficient_amount() -> Bolt12SemanticError {
333 Bolt12SemanticError::InsufficientAmount}
335 /// Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
336 pub extern "C" fn Bolt12SemanticError_unexpected_amount() -> Bolt12SemanticError {
337 Bolt12SemanticError::UnexpectedAmount}
339 /// Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
340 pub extern "C" fn Bolt12SemanticError_unsupported_currency() -> Bolt12SemanticError {
341 Bolt12SemanticError::UnsupportedCurrency}
343 /// Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
344 pub extern "C" fn Bolt12SemanticError_unknown_required_features() -> Bolt12SemanticError {
345 Bolt12SemanticError::UnknownRequiredFeatures}
347 /// Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
348 pub extern "C" fn Bolt12SemanticError_unexpected_features() -> Bolt12SemanticError {
349 Bolt12SemanticError::UnexpectedFeatures}
351 /// Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
352 pub extern "C" fn Bolt12SemanticError_missing_description() -> Bolt12SemanticError {
353 Bolt12SemanticError::MissingDescription}
355 /// Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
356 pub extern "C" fn Bolt12SemanticError_missing_signing_pubkey() -> Bolt12SemanticError {
357 Bolt12SemanticError::MissingSigningPubkey}
359 /// Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
360 pub extern "C" fn Bolt12SemanticError_invalid_signing_pubkey() -> Bolt12SemanticError {
361 Bolt12SemanticError::InvalidSigningPubkey}
363 /// Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
364 pub extern "C" fn Bolt12SemanticError_unexpected_signing_pubkey() -> Bolt12SemanticError {
365 Bolt12SemanticError::UnexpectedSigningPubkey}
367 /// Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
368 pub extern "C" fn Bolt12SemanticError_missing_quantity() -> Bolt12SemanticError {
369 Bolt12SemanticError::MissingQuantity}
371 /// Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
372 pub extern "C" fn Bolt12SemanticError_invalid_quantity() -> Bolt12SemanticError {
373 Bolt12SemanticError::InvalidQuantity}
375 /// Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
376 pub extern "C" fn Bolt12SemanticError_unexpected_quantity() -> Bolt12SemanticError {
377 Bolt12SemanticError::UnexpectedQuantity}
379 /// Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
380 pub extern "C" fn Bolt12SemanticError_invalid_metadata() -> Bolt12SemanticError {
381 Bolt12SemanticError::InvalidMetadata}
383 /// Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
384 pub extern "C" fn Bolt12SemanticError_unexpected_metadata() -> Bolt12SemanticError {
385 Bolt12SemanticError::UnexpectedMetadata}
387 /// Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
388 pub extern "C" fn Bolt12SemanticError_missing_payer_metadata() -> Bolt12SemanticError {
389 Bolt12SemanticError::MissingPayerMetadata}
391 /// Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
392 pub extern "C" fn Bolt12SemanticError_missing_payer_id() -> Bolt12SemanticError {
393 Bolt12SemanticError::MissingPayerId}
395 /// Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
396 pub extern "C" fn Bolt12SemanticError_duplicate_payment_id() -> Bolt12SemanticError {
397 Bolt12SemanticError::DuplicatePaymentId}
399 /// Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
400 pub extern "C" fn Bolt12SemanticError_missing_paths() -> Bolt12SemanticError {
401 Bolt12SemanticError::MissingPaths}
403 /// Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
404 pub extern "C" fn Bolt12SemanticError_invalid_pay_info() -> Bolt12SemanticError {
405 Bolt12SemanticError::InvalidPayInfo}
407 /// Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
408 pub extern "C" fn Bolt12SemanticError_missing_creation_time() -> Bolt12SemanticError {
409 Bolt12SemanticError::MissingCreationTime}
411 /// Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
412 pub extern "C" fn Bolt12SemanticError_missing_payment_hash() -> Bolt12SemanticError {
413 Bolt12SemanticError::MissingPaymentHash}
415 /// Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
416 pub extern "C" fn Bolt12SemanticError_missing_signature() -> Bolt12SemanticError {
417 Bolt12SemanticError::MissingSignature}