let mut funding_txo_nonref = (*funding_txo).clone();
let mut user_channel_id_nonref = (*user_channel_id).clone();
nativeEvent::FundingBroadcastSafe {
- funding_txo: *unsafe { Box::from_raw(funding_txo_nonref.take_ptr()) },
+ funding_txo: *unsafe { Box::from_raw(funding_txo_nonref.take_inner()) },
user_channel_id: user_channel_id_nonref,
}
},
},
Event::FundingBroadcastSafe {mut funding_txo, mut user_channel_id, } => {
nativeEvent::FundingBroadcastSafe {
- funding_txo: *unsafe { Box::from_raw(funding_txo.take_ptr()) },
+ funding_txo: *unsafe { Box::from_raw(funding_txo.take_inner()) },
user_channel_id: user_channel_id,
}
},
pub extern "C" fn Event_clone(orig: &Event) -> Event {
orig.clone()
}
+#[no_mangle]
+pub extern "C" fn Event_write(obj: &Event) -> crate::c_types::derived::CVec_u8Z {
+ crate::c_types::serialize_obj(&unsafe { &*obj }.to_native())
+}
/// An event generated by ChannelManager which indicates a message should be sent to a peer (or
/// broadcast to most peers).
/// These events are handled by PeerManager::process_events if you are using a PeerManager.
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendAcceptChannel {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendOpenChannel {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendOpenChannel {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendFundingCreated {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendFundingCreated {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendFundingSigned {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendFundingSigned {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendFundingLocked {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendFundingLocked {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendAnnouncementSignatures {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendAnnouncementSignatures {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::UpdateHTLCs {ref node_id, ref updates, } => {
let mut updates_nonref = (*updates).clone();
nativeMessageSendEvent::UpdateHTLCs {
node_id: node_id_nonref.into_rust(),
- updates: *unsafe { Box::from_raw(updates_nonref.take_ptr()) },
+ updates: *unsafe { Box::from_raw(updates_nonref.take_inner()) },
}
},
MessageSendEvent::SendRevokeAndACK {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendRevokeAndACK {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendClosingSigned {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendClosingSigned {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendShutdown {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendShutdown {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendChannelReestablish {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendChannelReestablish {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::BroadcastChannelAnnouncement {ref msg, ref update_msg, } => {
let mut msg_nonref = (*msg).clone();
let mut update_msg_nonref = (*update_msg).clone();
nativeMessageSendEvent::BroadcastChannelAnnouncement {
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
- update_msg: *unsafe { Box::from_raw(update_msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
+ update_msg: *unsafe { Box::from_raw(update_msg_nonref.take_inner()) },
}
},
MessageSendEvent::BroadcastNodeAnnouncement {ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::BroadcastNodeAnnouncement {
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::BroadcastChannelUpdate {ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::BroadcastChannelUpdate {
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::HandleError {ref node_id, ref action, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendChannelRangeQuery {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
MessageSendEvent::SendShortIdsQuery {ref node_id, ref msg, } => {
let mut msg_nonref = (*msg).clone();
nativeMessageSendEvent::SendShortIdsQuery {
node_id: node_id_nonref.into_rust(),
- msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
}
MessageSendEvent::SendAcceptChannel {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendAcceptChannel {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendOpenChannel {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendOpenChannel {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendFundingCreated {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendFundingCreated {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendFundingSigned {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendFundingSigned {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendFundingLocked {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendFundingLocked {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendAnnouncementSignatures {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendAnnouncementSignatures {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::UpdateHTLCs {mut node_id, mut updates, } => {
nativeMessageSendEvent::UpdateHTLCs {
node_id: node_id.into_rust(),
- updates: *unsafe { Box::from_raw(updates.take_ptr()) },
+ updates: *unsafe { Box::from_raw(updates.take_inner()) },
}
},
MessageSendEvent::SendRevokeAndACK {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendRevokeAndACK {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendClosingSigned {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendClosingSigned {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendShutdown {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendShutdown {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendChannelReestablish {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendChannelReestablish {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::BroadcastChannelAnnouncement {mut msg, mut update_msg, } => {
nativeMessageSendEvent::BroadcastChannelAnnouncement {
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
- update_msg: *unsafe { Box::from_raw(update_msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
+ update_msg: *unsafe { Box::from_raw(update_msg.take_inner()) },
}
},
MessageSendEvent::BroadcastNodeAnnouncement {mut msg, } => {
nativeMessageSendEvent::BroadcastNodeAnnouncement {
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::BroadcastChannelUpdate {mut msg, } => {
nativeMessageSendEvent::BroadcastChannelUpdate {
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::HandleError {mut node_id, mut action, } => {
MessageSendEvent::SendChannelRangeQuery {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendChannelRangeQuery {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
MessageSendEvent::SendShortIdsQuery {mut node_id, mut msg, } => {
nativeMessageSendEvent::SendShortIdsQuery {
node_id: node_id.into_rust(),
- msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
}