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 /// Get a string which allows debug introspection of a Bolt12ParseError object
103 pub extern "C" fn Bolt12ParseError_debug_str_void(o: *const c_void) -> Str {
104 alloc::format!("{:?}", unsafe { o as *const crate::lightning::offers::parse::Bolt12ParseError }).into()}
105 /// Error when interpreting a TLV stream as a specific type.
109 pub enum Bolt12SemanticError {
110 /// The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
112 /// The provided chain hash does not correspond to a supported chain.
114 /// A chain was provided but was not expected.
116 /// An amount was expected but was missing.
118 /// The amount exceeded the total bitcoin supply.
120 /// An amount was provided but was not sufficient in value.
122 /// An amount was provided but was not expected.
124 /// A currency was provided that is not supported.
126 /// A feature was required but is unknown.
127 UnknownRequiredFeatures,
128 /// Features were provided but were not expected.
130 /// A required description was not provided.
132 /// A signing pubkey was not provided.
133 MissingSigningPubkey,
134 /// A signing pubkey was provided but a different one was expected.
135 InvalidSigningPubkey,
136 /// A signing pubkey was provided but was not expected.
137 UnexpectedSigningPubkey,
138 /// A quantity was expected but was missing.
140 /// An unsupported quantity was provided.
142 /// A quantity or quantity bounds was provided but was not expected.
144 /// Metadata could not be used to verify the offers message.
146 /// Metadata was provided but was not expected.
148 /// Payer metadata was expected but was missing.
149 MissingPayerMetadata,
150 /// A payer id was expected but was missing.
152 /// The payment id for a refund or request is already in use.
154 /// Blinded paths were expected but were missing.
156 /// The blinded payinfo given does not match the number of blinded path hops.
158 /// An invoice creation time was expected but was missing.
160 /// An invoice payment hash was expected but was missing.
162 /// A signature was expected but was missing.
165 use lightning::offers::parse::Bolt12SemanticError as Bolt12SemanticErrorImport;
166 pub(crate) type nativeBolt12SemanticError = Bolt12SemanticErrorImport;
168 impl Bolt12SemanticError {
170 pub(crate) fn to_native(&self) -> nativeBolt12SemanticError {
172 Bolt12SemanticError::AlreadyExpired => nativeBolt12SemanticError::AlreadyExpired,
173 Bolt12SemanticError::UnsupportedChain => nativeBolt12SemanticError::UnsupportedChain,
174 Bolt12SemanticError::UnexpectedChain => nativeBolt12SemanticError::UnexpectedChain,
175 Bolt12SemanticError::MissingAmount => nativeBolt12SemanticError::MissingAmount,
176 Bolt12SemanticError::InvalidAmount => nativeBolt12SemanticError::InvalidAmount,
177 Bolt12SemanticError::InsufficientAmount => nativeBolt12SemanticError::InsufficientAmount,
178 Bolt12SemanticError::UnexpectedAmount => nativeBolt12SemanticError::UnexpectedAmount,
179 Bolt12SemanticError::UnsupportedCurrency => nativeBolt12SemanticError::UnsupportedCurrency,
180 Bolt12SemanticError::UnknownRequiredFeatures => nativeBolt12SemanticError::UnknownRequiredFeatures,
181 Bolt12SemanticError::UnexpectedFeatures => nativeBolt12SemanticError::UnexpectedFeatures,
182 Bolt12SemanticError::MissingDescription => nativeBolt12SemanticError::MissingDescription,
183 Bolt12SemanticError::MissingSigningPubkey => nativeBolt12SemanticError::MissingSigningPubkey,
184 Bolt12SemanticError::InvalidSigningPubkey => nativeBolt12SemanticError::InvalidSigningPubkey,
185 Bolt12SemanticError::UnexpectedSigningPubkey => nativeBolt12SemanticError::UnexpectedSigningPubkey,
186 Bolt12SemanticError::MissingQuantity => nativeBolt12SemanticError::MissingQuantity,
187 Bolt12SemanticError::InvalidQuantity => nativeBolt12SemanticError::InvalidQuantity,
188 Bolt12SemanticError::UnexpectedQuantity => nativeBolt12SemanticError::UnexpectedQuantity,
189 Bolt12SemanticError::InvalidMetadata => nativeBolt12SemanticError::InvalidMetadata,
190 Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata,
191 Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata,
192 Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId,
193 Bolt12SemanticError::DuplicatePaymentId => nativeBolt12SemanticError::DuplicatePaymentId,
194 Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths,
195 Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo,
196 Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime,
197 Bolt12SemanticError::MissingPaymentHash => nativeBolt12SemanticError::MissingPaymentHash,
198 Bolt12SemanticError::MissingSignature => nativeBolt12SemanticError::MissingSignature,
202 pub(crate) fn into_native(self) -> nativeBolt12SemanticError {
204 Bolt12SemanticError::AlreadyExpired => nativeBolt12SemanticError::AlreadyExpired,
205 Bolt12SemanticError::UnsupportedChain => nativeBolt12SemanticError::UnsupportedChain,
206 Bolt12SemanticError::UnexpectedChain => nativeBolt12SemanticError::UnexpectedChain,
207 Bolt12SemanticError::MissingAmount => nativeBolt12SemanticError::MissingAmount,
208 Bolt12SemanticError::InvalidAmount => nativeBolt12SemanticError::InvalidAmount,
209 Bolt12SemanticError::InsufficientAmount => nativeBolt12SemanticError::InsufficientAmount,
210 Bolt12SemanticError::UnexpectedAmount => nativeBolt12SemanticError::UnexpectedAmount,
211 Bolt12SemanticError::UnsupportedCurrency => nativeBolt12SemanticError::UnsupportedCurrency,
212 Bolt12SemanticError::UnknownRequiredFeatures => nativeBolt12SemanticError::UnknownRequiredFeatures,
213 Bolt12SemanticError::UnexpectedFeatures => nativeBolt12SemanticError::UnexpectedFeatures,
214 Bolt12SemanticError::MissingDescription => nativeBolt12SemanticError::MissingDescription,
215 Bolt12SemanticError::MissingSigningPubkey => nativeBolt12SemanticError::MissingSigningPubkey,
216 Bolt12SemanticError::InvalidSigningPubkey => nativeBolt12SemanticError::InvalidSigningPubkey,
217 Bolt12SemanticError::UnexpectedSigningPubkey => nativeBolt12SemanticError::UnexpectedSigningPubkey,
218 Bolt12SemanticError::MissingQuantity => nativeBolt12SemanticError::MissingQuantity,
219 Bolt12SemanticError::InvalidQuantity => nativeBolt12SemanticError::InvalidQuantity,
220 Bolt12SemanticError::UnexpectedQuantity => nativeBolt12SemanticError::UnexpectedQuantity,
221 Bolt12SemanticError::InvalidMetadata => nativeBolt12SemanticError::InvalidMetadata,
222 Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata,
223 Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata,
224 Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId,
225 Bolt12SemanticError::DuplicatePaymentId => nativeBolt12SemanticError::DuplicatePaymentId,
226 Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths,
227 Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo,
228 Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime,
229 Bolt12SemanticError::MissingPaymentHash => nativeBolt12SemanticError::MissingPaymentHash,
230 Bolt12SemanticError::MissingSignature => nativeBolt12SemanticError::MissingSignature,
234 pub(crate) fn from_native(native: &Bolt12SemanticErrorImport) -> Self {
235 let native = unsafe { &*(native as *const _ as *const c_void as *const nativeBolt12SemanticError) };
237 nativeBolt12SemanticError::AlreadyExpired => Bolt12SemanticError::AlreadyExpired,
238 nativeBolt12SemanticError::UnsupportedChain => Bolt12SemanticError::UnsupportedChain,
239 nativeBolt12SemanticError::UnexpectedChain => Bolt12SemanticError::UnexpectedChain,
240 nativeBolt12SemanticError::MissingAmount => Bolt12SemanticError::MissingAmount,
241 nativeBolt12SemanticError::InvalidAmount => Bolt12SemanticError::InvalidAmount,
242 nativeBolt12SemanticError::InsufficientAmount => Bolt12SemanticError::InsufficientAmount,
243 nativeBolt12SemanticError::UnexpectedAmount => Bolt12SemanticError::UnexpectedAmount,
244 nativeBolt12SemanticError::UnsupportedCurrency => Bolt12SemanticError::UnsupportedCurrency,
245 nativeBolt12SemanticError::UnknownRequiredFeatures => Bolt12SemanticError::UnknownRequiredFeatures,
246 nativeBolt12SemanticError::UnexpectedFeatures => Bolt12SemanticError::UnexpectedFeatures,
247 nativeBolt12SemanticError::MissingDescription => Bolt12SemanticError::MissingDescription,
248 nativeBolt12SemanticError::MissingSigningPubkey => Bolt12SemanticError::MissingSigningPubkey,
249 nativeBolt12SemanticError::InvalidSigningPubkey => Bolt12SemanticError::InvalidSigningPubkey,
250 nativeBolt12SemanticError::UnexpectedSigningPubkey => Bolt12SemanticError::UnexpectedSigningPubkey,
251 nativeBolt12SemanticError::MissingQuantity => Bolt12SemanticError::MissingQuantity,
252 nativeBolt12SemanticError::InvalidQuantity => Bolt12SemanticError::InvalidQuantity,
253 nativeBolt12SemanticError::UnexpectedQuantity => Bolt12SemanticError::UnexpectedQuantity,
254 nativeBolt12SemanticError::InvalidMetadata => Bolt12SemanticError::InvalidMetadata,
255 nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata,
256 nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata,
257 nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId,
258 nativeBolt12SemanticError::DuplicatePaymentId => Bolt12SemanticError::DuplicatePaymentId,
259 nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths,
260 nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo,
261 nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime,
262 nativeBolt12SemanticError::MissingPaymentHash => Bolt12SemanticError::MissingPaymentHash,
263 nativeBolt12SemanticError::MissingSignature => Bolt12SemanticError::MissingSignature,
267 pub(crate) fn native_into(native: nativeBolt12SemanticError) -> Self {
269 nativeBolt12SemanticError::AlreadyExpired => Bolt12SemanticError::AlreadyExpired,
270 nativeBolt12SemanticError::UnsupportedChain => Bolt12SemanticError::UnsupportedChain,
271 nativeBolt12SemanticError::UnexpectedChain => Bolt12SemanticError::UnexpectedChain,
272 nativeBolt12SemanticError::MissingAmount => Bolt12SemanticError::MissingAmount,
273 nativeBolt12SemanticError::InvalidAmount => Bolt12SemanticError::InvalidAmount,
274 nativeBolt12SemanticError::InsufficientAmount => Bolt12SemanticError::InsufficientAmount,
275 nativeBolt12SemanticError::UnexpectedAmount => Bolt12SemanticError::UnexpectedAmount,
276 nativeBolt12SemanticError::UnsupportedCurrency => Bolt12SemanticError::UnsupportedCurrency,
277 nativeBolt12SemanticError::UnknownRequiredFeatures => Bolt12SemanticError::UnknownRequiredFeatures,
278 nativeBolt12SemanticError::UnexpectedFeatures => Bolt12SemanticError::UnexpectedFeatures,
279 nativeBolt12SemanticError::MissingDescription => Bolt12SemanticError::MissingDescription,
280 nativeBolt12SemanticError::MissingSigningPubkey => Bolt12SemanticError::MissingSigningPubkey,
281 nativeBolt12SemanticError::InvalidSigningPubkey => Bolt12SemanticError::InvalidSigningPubkey,
282 nativeBolt12SemanticError::UnexpectedSigningPubkey => Bolt12SemanticError::UnexpectedSigningPubkey,
283 nativeBolt12SemanticError::MissingQuantity => Bolt12SemanticError::MissingQuantity,
284 nativeBolt12SemanticError::InvalidQuantity => Bolt12SemanticError::InvalidQuantity,
285 nativeBolt12SemanticError::UnexpectedQuantity => Bolt12SemanticError::UnexpectedQuantity,
286 nativeBolt12SemanticError::InvalidMetadata => Bolt12SemanticError::InvalidMetadata,
287 nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata,
288 nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata,
289 nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId,
290 nativeBolt12SemanticError::DuplicatePaymentId => Bolt12SemanticError::DuplicatePaymentId,
291 nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths,
292 nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo,
293 nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime,
294 nativeBolt12SemanticError::MissingPaymentHash => Bolt12SemanticError::MissingPaymentHash,
295 nativeBolt12SemanticError::MissingSignature => Bolt12SemanticError::MissingSignature,
299 /// Creates a copy of the Bolt12SemanticError
301 pub extern "C" fn Bolt12SemanticError_clone(orig: &Bolt12SemanticError) -> Bolt12SemanticError {
305 /// Used only if an object of this type is returned as a trait impl by a method
306 pub(crate) extern "C" fn Bolt12SemanticError_clone_void(this_ptr: *const c_void) -> *mut c_void {
307 Box::into_raw(Box::new(unsafe { (*(this_ptr as *const Bolt12SemanticError)).clone() })) as *mut c_void
310 /// Used only if an object of this type is returned as a trait impl by a method
311 pub(crate) extern "C" fn Bolt12SemanticError_free_void(this_ptr: *mut c_void) {
312 let _ = unsafe { Box::from_raw(this_ptr as *mut Bolt12SemanticError) };
315 /// Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
316 pub extern "C" fn Bolt12SemanticError_already_expired() -> Bolt12SemanticError {
317 Bolt12SemanticError::AlreadyExpired}
319 /// Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
320 pub extern "C" fn Bolt12SemanticError_unsupported_chain() -> Bolt12SemanticError {
321 Bolt12SemanticError::UnsupportedChain}
323 /// Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
324 pub extern "C" fn Bolt12SemanticError_unexpected_chain() -> Bolt12SemanticError {
325 Bolt12SemanticError::UnexpectedChain}
327 /// Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
328 pub extern "C" fn Bolt12SemanticError_missing_amount() -> Bolt12SemanticError {
329 Bolt12SemanticError::MissingAmount}
331 /// Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
332 pub extern "C" fn Bolt12SemanticError_invalid_amount() -> Bolt12SemanticError {
333 Bolt12SemanticError::InvalidAmount}
335 /// Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
336 pub extern "C" fn Bolt12SemanticError_insufficient_amount() -> Bolt12SemanticError {
337 Bolt12SemanticError::InsufficientAmount}
339 /// Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
340 pub extern "C" fn Bolt12SemanticError_unexpected_amount() -> Bolt12SemanticError {
341 Bolt12SemanticError::UnexpectedAmount}
343 /// Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
344 pub extern "C" fn Bolt12SemanticError_unsupported_currency() -> Bolt12SemanticError {
345 Bolt12SemanticError::UnsupportedCurrency}
347 /// Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
348 pub extern "C" fn Bolt12SemanticError_unknown_required_features() -> Bolt12SemanticError {
349 Bolt12SemanticError::UnknownRequiredFeatures}
351 /// Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
352 pub extern "C" fn Bolt12SemanticError_unexpected_features() -> Bolt12SemanticError {
353 Bolt12SemanticError::UnexpectedFeatures}
355 /// Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
356 pub extern "C" fn Bolt12SemanticError_missing_description() -> Bolt12SemanticError {
357 Bolt12SemanticError::MissingDescription}
359 /// Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
360 pub extern "C" fn Bolt12SemanticError_missing_signing_pubkey() -> Bolt12SemanticError {
361 Bolt12SemanticError::MissingSigningPubkey}
363 /// Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
364 pub extern "C" fn Bolt12SemanticError_invalid_signing_pubkey() -> Bolt12SemanticError {
365 Bolt12SemanticError::InvalidSigningPubkey}
367 /// Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
368 pub extern "C" fn Bolt12SemanticError_unexpected_signing_pubkey() -> Bolt12SemanticError {
369 Bolt12SemanticError::UnexpectedSigningPubkey}
371 /// Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
372 pub extern "C" fn Bolt12SemanticError_missing_quantity() -> Bolt12SemanticError {
373 Bolt12SemanticError::MissingQuantity}
375 /// Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
376 pub extern "C" fn Bolt12SemanticError_invalid_quantity() -> Bolt12SemanticError {
377 Bolt12SemanticError::InvalidQuantity}
379 /// Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
380 pub extern "C" fn Bolt12SemanticError_unexpected_quantity() -> Bolt12SemanticError {
381 Bolt12SemanticError::UnexpectedQuantity}
383 /// Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
384 pub extern "C" fn Bolt12SemanticError_invalid_metadata() -> Bolt12SemanticError {
385 Bolt12SemanticError::InvalidMetadata}
387 /// Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
388 pub extern "C" fn Bolt12SemanticError_unexpected_metadata() -> Bolt12SemanticError {
389 Bolt12SemanticError::UnexpectedMetadata}
391 /// Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
392 pub extern "C" fn Bolt12SemanticError_missing_payer_metadata() -> Bolt12SemanticError {
393 Bolt12SemanticError::MissingPayerMetadata}
395 /// Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
396 pub extern "C" fn Bolt12SemanticError_missing_payer_id() -> Bolt12SemanticError {
397 Bolt12SemanticError::MissingPayerId}
399 /// Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
400 pub extern "C" fn Bolt12SemanticError_duplicate_payment_id() -> Bolt12SemanticError {
401 Bolt12SemanticError::DuplicatePaymentId}
403 /// Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
404 pub extern "C" fn Bolt12SemanticError_missing_paths() -> Bolt12SemanticError {
405 Bolt12SemanticError::MissingPaths}
407 /// Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
408 pub extern "C" fn Bolt12SemanticError_invalid_pay_info() -> Bolt12SemanticError {
409 Bolt12SemanticError::InvalidPayInfo}
411 /// Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
412 pub extern "C" fn Bolt12SemanticError_missing_creation_time() -> Bolt12SemanticError {
413 Bolt12SemanticError::MissingCreationTime}
415 /// Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
416 pub extern "C" fn Bolt12SemanticError_missing_payment_hash() -> Bolt12SemanticError {
417 Bolt12SemanticError::MissingPaymentHash}
419 /// Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
420 pub extern "C" fn Bolt12SemanticError_missing_signature() -> Bolt12SemanticError {
421 Bolt12SemanticError::MissingSignature}
422 /// Get a string which allows debug introspection of a Bolt12SemanticError object
423 pub extern "C" fn Bolt12SemanticError_debug_str_void(o: *const c_void) -> Str {
424 alloc::format!("{:?}", unsafe { o as *const crate::lightning::offers::parse::Bolt12SemanticError }).into()}