From: Matt Corallo Date: Thu, 22 Dec 2022 21:54:35 +0000 (+0000) Subject: Drop `EventHandler` support for `Future`s since its nonsense in bindings X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=6af7626f12fe53302402a19e263c450f636c81aa;p=rust-lightning Drop `EventHandler` support for `Future`s since its nonsense in bindings --- diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs index 03dc9361f..ae1a7d613 100644 --- a/lightning-invoice/src/payment.rs +++ b/lightning-invoice/src/payment.rs @@ -174,19 +174,12 @@ use crate::time_utils; #[cfg(feature = "no-std")] type ConfiguredTime = time_utils::Eternity; -/// Sealed trait with a blanket implementation to allow both sync and async implementations of event -/// handling to exist within the InvoicePayer. -mod sealed { - pub trait BaseEventHandler {} - impl BaseEventHandler for T {} -} - /// (C-not exported) generally all users should use the [`InvoicePayer`] type alias. pub struct InvoicePayerUsingTime< P: Deref, R: Router, L: Deref, - E: sealed::BaseEventHandler, + E: EventHandler, T: Time > where P::Target: Payer, @@ -316,7 +309,7 @@ pub enum PaymentError { Sending(PaymentSendFailure), } -impl +impl InvoicePayerUsingTime where P::Target: Payer, @@ -630,7 +623,7 @@ fn has_expired(route_params: &RouteParameters) -> bool { } else { false } } -impl +impl InvoicePayerUsingTime where P::Target: Payer, @@ -711,6 +704,7 @@ where } } +#[cfg(not(c_bindings))] impl F> InvoicePayerUsingTime where