+#[no_mangle]
+/// Utility method to constructs a new APIMisuseError-variant APIError
+pub extern "C" fn APIError_apimisuse_error(err: crate::c_types::Str) -> APIError {
+ APIError::APIMisuseError {
+ err,
+ }
+}
+#[no_mangle]
+/// Utility method to constructs a new FeeRateTooHigh-variant APIError
+pub extern "C" fn APIError_fee_rate_too_high(err: crate::c_types::Str, feerate: u32) -> APIError {
+ APIError::FeeRateTooHigh {
+ err,
+ feerate,
+ }
+}
+#[no_mangle]
+/// Utility method to constructs a new RouteError-variant APIError
+pub extern "C" fn APIError_route_error(err: crate::c_types::Str) -> APIError {
+ APIError::RouteError {
+ err,
+ }
+}
+#[no_mangle]
+/// Utility method to constructs a new ChannelUnavailable-variant APIError
+pub extern "C" fn APIError_channel_unavailable(err: crate::c_types::Str) -> APIError {
+ APIError::ChannelUnavailable {
+ err,
+ }
+}
+#[no_mangle]
+/// Utility method to constructs a new MonitorUpdateInProgress-variant APIError
+pub extern "C" fn APIError_monitor_update_in_progress() -> APIError {
+ APIError::MonitorUpdateInProgress}
+#[no_mangle]
+/// Utility method to constructs a new IncompatibleShutdownScript-variant APIError
+pub extern "C" fn APIError_incompatible_shutdown_script(script: crate::lightning::ln::script::ShutdownScript) -> APIError {
+ APIError::IncompatibleShutdownScript {
+ script,
+ }
+}
+/// Checks if two APIErrors contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+#[no_mangle]
+pub extern "C" fn APIError_eq(a: &APIError, b: &APIError) -> bool {
+ if &a.to_native() == &b.to_native() { true } else { false }
+}