-}
-impl Clone for MonitorEvent {
- fn clone(&self) -> Self {
- Self {
- inner: if self.inner.is_null() { std::ptr::null_mut() } else {
- Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
- is_owned: true,
+ #[allow(unused)]
+ pub(crate) fn from_native(native: &nativeMonitorEvent) -> Self {
+ match native {
+ nativeMonitorEvent::HTLCEvent (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ MonitorEvent::HTLCEvent (
+ crate::chain::channelmonitor::HTLCUpdate { inner: Box::into_raw(Box::new(a_nonref)), is_owned: true },
+ )
+ },
+ nativeMonitorEvent::CommitmentTxBroadcasted (ref a, ) => {
+ let mut a_nonref = (*a).clone();
+ MonitorEvent::CommitmentTxBroadcasted (
+ crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(a_nonref)), is_owned: true },
+ )
+ },
+ }
+ }
+ #[allow(unused)]
+ pub(crate) fn native_into(native: nativeMonitorEvent) -> Self {
+ match native {
+ nativeMonitorEvent::HTLCEvent (mut a, ) => {
+ MonitorEvent::HTLCEvent (
+ crate::chain::channelmonitor::HTLCUpdate { inner: Box::into_raw(Box::new(a)), is_owned: true },
+ )
+ },
+ nativeMonitorEvent::CommitmentTxBroadcasted (mut a, ) => {
+ MonitorEvent::CommitmentTxBroadcasted (
+ crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(a)), is_owned: true },
+ )
+ },