+impl ParseError {
+ #[allow(unused)]
+ pub(crate) fn to_native(&self) -> nativeParseError {
+ match self {
+ ParseError::Bech32Error (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ nativeParseError::Bech32Error (
+ a_nonref.into_rust(),
+ )
+ },
+ ParseError::ParseAmountError (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ nativeParseError::ParseAmountError (
+ u8::from_str_radix(" a", 10).unwrap_err() /*a_nonref*/,
+ )
+ },
+ ParseError::MalformedSignature (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ nativeParseError::MalformedSignature (
+ a_nonref.into_rust(),
+ )
+ },
+ ParseError::BadPrefix => nativeParseError::BadPrefix,
+ ParseError::UnknownCurrency => nativeParseError::UnknownCurrency,
+ ParseError::UnknownSiPrefix => nativeParseError::UnknownSiPrefix,
+ ParseError::MalformedHRP => nativeParseError::MalformedHRP,
+ ParseError::TooShortDataPart => nativeParseError::TooShortDataPart,
+ ParseError::UnexpectedEndOfTaggedFields => nativeParseError::UnexpectedEndOfTaggedFields,
+ ParseError::DescriptionDecodeError (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ nativeParseError::DescriptionDecodeError (
+ core::str::from_utf8(&[0xff]).unwrap_err() /*a_nonref*/,
+ )
+ },
+ ParseError::PaddingError => nativeParseError::PaddingError,
+ ParseError::IntegerOverflowError => nativeParseError::IntegerOverflowError,
+ ParseError::InvalidSegWitProgramLength => nativeParseError::InvalidSegWitProgramLength,
+ ParseError::InvalidPubKeyHashLength => nativeParseError::InvalidPubKeyHashLength,
+ ParseError::InvalidScriptHashLength => nativeParseError::InvalidScriptHashLength,
+ ParseError::InvalidRecoveryId => nativeParseError::InvalidRecoveryId,
+ ParseError::InvalidSliceLength (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ nativeParseError::InvalidSliceLength (
+ a_nonref.into_string(),
+ )
+ },
+ ParseError::Skip => nativeParseError::Skip,
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn into_native(self) -> nativeParseError {
+ match self {
+ ParseError::Bech32Error (mut a, ) => {
+ nativeParseError::Bech32Error (
+ a.into_rust(),
+ )
+ },
+ ParseError::ParseAmountError (mut a, ) => {
+ nativeParseError::ParseAmountError (
+ u8::from_str_radix(" a", 10).unwrap_err() /*a*/,
+ )
+ },
+ ParseError::MalformedSignature (mut a, ) => {
+ nativeParseError::MalformedSignature (
+ a.into_rust(),
+ )
+ },
+ ParseError::BadPrefix => nativeParseError::BadPrefix,
+ ParseError::UnknownCurrency => nativeParseError::UnknownCurrency,
+ ParseError::UnknownSiPrefix => nativeParseError::UnknownSiPrefix,
+ ParseError::MalformedHRP => nativeParseError::MalformedHRP,
+ ParseError::TooShortDataPart => nativeParseError::TooShortDataPart,
+ ParseError::UnexpectedEndOfTaggedFields => nativeParseError::UnexpectedEndOfTaggedFields,
+ ParseError::DescriptionDecodeError (mut a, ) => {
+ nativeParseError::DescriptionDecodeError (
+ core::str::from_utf8(&[0xff]).unwrap_err() /*a*/,
+ )
+ },
+ ParseError::PaddingError => nativeParseError::PaddingError,
+ ParseError::IntegerOverflowError => nativeParseError::IntegerOverflowError,
+ ParseError::InvalidSegWitProgramLength => nativeParseError::InvalidSegWitProgramLength,
+ ParseError::InvalidPubKeyHashLength => nativeParseError::InvalidPubKeyHashLength,
+ ParseError::InvalidScriptHashLength => nativeParseError::InvalidScriptHashLength,
+ ParseError::InvalidRecoveryId => nativeParseError::InvalidRecoveryId,
+ ParseError::InvalidSliceLength (mut a, ) => {
+ nativeParseError::InvalidSliceLength (
+ a.into_string(),
+ )
+ },
+ ParseError::Skip => nativeParseError::Skip,
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn from_native(native: &nativeParseError) -> Self {
+ match native {
+ nativeParseError::Bech32Error (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ ParseError::Bech32Error (
+ crate::c_types::Bech32Error::from_rust(a_nonref),
+ )
+ },
+ nativeParseError::ParseAmountError (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ ParseError::ParseAmountError (
+ crate::c_types::Error { _dummy: 0 } /*a_nonref*/,
+ )
+ },
+ nativeParseError::MalformedSignature (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ ParseError::MalformedSignature (
+ crate::c_types::Secp256k1Error::from_rust(a_nonref),
+ )
+ },
+ nativeParseError::BadPrefix => ParseError::BadPrefix,
+ nativeParseError::UnknownCurrency => ParseError::UnknownCurrency,
+ nativeParseError::UnknownSiPrefix => ParseError::UnknownSiPrefix,
+ nativeParseError::MalformedHRP => ParseError::MalformedHRP,
+ nativeParseError::TooShortDataPart => ParseError::TooShortDataPart,
+ nativeParseError::UnexpectedEndOfTaggedFields => ParseError::UnexpectedEndOfTaggedFields,
+ nativeParseError::DescriptionDecodeError (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ ParseError::DescriptionDecodeError (
+ crate::c_types::Error { _dummy: 0 } /*a_nonref*/,
+ )
+ },
+ nativeParseError::PaddingError => ParseError::PaddingError,
+ nativeParseError::IntegerOverflowError => ParseError::IntegerOverflowError,
+ nativeParseError::InvalidSegWitProgramLength => ParseError::InvalidSegWitProgramLength,
+ nativeParseError::InvalidPubKeyHashLength => ParseError::InvalidPubKeyHashLength,
+ nativeParseError::InvalidScriptHashLength => ParseError::InvalidScriptHashLength,
+ nativeParseError::InvalidRecoveryId => ParseError::InvalidRecoveryId,
+ nativeParseError::InvalidSliceLength (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ ParseError::InvalidSliceLength (
+ a_nonref.into(),
+ )
+ },
+ nativeParseError::Skip => ParseError::Skip,
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn native_into(native: nativeParseError) -> Self {
+ match native {
+ nativeParseError::Bech32Error (mut a, ) => {
+ ParseError::Bech32Error (
+ crate::c_types::Bech32Error::from_rust(a),
+ )
+ },
+ nativeParseError::ParseAmountError (mut a, ) => {
+ ParseError::ParseAmountError (
+ crate::c_types::Error { _dummy: 0 } /*a*/,
+ )
+ },
+ nativeParseError::MalformedSignature (mut a, ) => {
+ ParseError::MalformedSignature (
+ crate::c_types::Secp256k1Error::from_rust(a),
+ )
+ },
+ nativeParseError::BadPrefix => ParseError::BadPrefix,
+ nativeParseError::UnknownCurrency => ParseError::UnknownCurrency,
+ nativeParseError::UnknownSiPrefix => ParseError::UnknownSiPrefix,
+ nativeParseError::MalformedHRP => ParseError::MalformedHRP,
+ nativeParseError::TooShortDataPart => ParseError::TooShortDataPart,
+ nativeParseError::UnexpectedEndOfTaggedFields => ParseError::UnexpectedEndOfTaggedFields,
+ nativeParseError::DescriptionDecodeError (mut a, ) => {
+ ParseError::DescriptionDecodeError (
+ crate::c_types::Error { _dummy: 0 } /*a*/,
+ )
+ },
+ nativeParseError::PaddingError => ParseError::PaddingError,
+ nativeParseError::IntegerOverflowError => ParseError::IntegerOverflowError,
+ nativeParseError::InvalidSegWitProgramLength => ParseError::InvalidSegWitProgramLength,
+ nativeParseError::InvalidPubKeyHashLength => ParseError::InvalidPubKeyHashLength,
+ nativeParseError::InvalidScriptHashLength => ParseError::InvalidScriptHashLength,
+ nativeParseError::InvalidRecoveryId => ParseError::InvalidRecoveryId,
+ nativeParseError::InvalidSliceLength (mut a, ) => {
+ ParseError::InvalidSliceLength (
+ a.into(),
+ )
+ },
+ nativeParseError::Skip => ParseError::Skip,
+ }
+ }
+}
+/// Frees any resources used by the ParseError
+#[no_mangle]
+pub extern "C" fn ParseError_free(this_ptr: ParseError) { }
+/// Creates a copy of the ParseError
+#[no_mangle]
+pub extern "C" fn ParseError_clone(orig: &ParseError) -> ParseError {
+ orig.clone()
+}
+#[no_mangle]
+/// Utility method to constructs a new Bech32Error-variant ParseError
+pub extern "C" fn ParseError_bech32_error(a: crate::c_types::Bech32Error) -> ParseError {
+ ParseError::Bech32Error(a, )
+}
+#[no_mangle]
+/// Utility method to constructs a new ParseAmountError-variant ParseError
+pub extern "C" fn ParseError_parse_amount_error(a: crate::c_types::Error) -> ParseError {
+ ParseError::ParseAmountError(a, )
+}
+#[no_mangle]
+/// Utility method to constructs a new MalformedSignature-variant ParseError
+pub extern "C" fn ParseError_malformed_signature(a: crate::c_types::Secp256k1Error) -> ParseError {
+ ParseError::MalformedSignature(a, )
+}
+#[no_mangle]
+/// Utility method to constructs a new BadPrefix-variant ParseError
+pub extern "C" fn ParseError_bad_prefix() -> ParseError {
+ ParseError::BadPrefix}
+#[no_mangle]
+/// Utility method to constructs a new UnknownCurrency-variant ParseError
+pub extern "C" fn ParseError_unknown_currency() -> ParseError {
+ ParseError::UnknownCurrency}
+#[no_mangle]
+/// Utility method to constructs a new UnknownSiPrefix-variant ParseError
+pub extern "C" fn ParseError_unknown_si_prefix() -> ParseError {
+ ParseError::UnknownSiPrefix}
+#[no_mangle]
+/// Utility method to constructs a new MalformedHRP-variant ParseError
+pub extern "C" fn ParseError_malformed_hrp() -> ParseError {
+ ParseError::MalformedHRP}
+#[no_mangle]
+/// Utility method to constructs a new TooShortDataPart-variant ParseError
+pub extern "C" fn ParseError_too_short_data_part() -> ParseError {
+ ParseError::TooShortDataPart}
+#[no_mangle]
+/// Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
+pub extern "C" fn ParseError_unexpected_end_of_tagged_fields() -> ParseError {
+ ParseError::UnexpectedEndOfTaggedFields}
+#[no_mangle]
+/// Utility method to constructs a new DescriptionDecodeError-variant ParseError
+pub extern "C" fn ParseError_description_decode_error(a: crate::c_types::Error) -> ParseError {
+ ParseError::DescriptionDecodeError(a, )