X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Futil%2Fevents.rs;h=72d9de5e899bdc2d6d5a8c42ce564e8f3b72dc78;hb=b2f0ccc7e0ef8b31567cb017d0b7cce9f7204803;hp=3ec8def633d01bd28e3391e92ef19697ca73019a;hpb=04fcb2d0d013cfb63ed656de156f0659f1b1411e;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/util/events.rs b/lightning-c-bindings/src/util/events.rs index 3ec8def..72d9de5 100644 --- a/lightning-c-bindings/src/util/events.rs +++ b/lightning-c-bindings/src/util/events.rs @@ -1,3 +1,11 @@ +// This file is Copyright its original authors, visible in version control +// history and in the source files from which this was generated. +// +// This file is licensed under the license available in the LICENSE or LICENSE.md +// file in the root of this repository or, if no such file exists, the same +// license as that which applies to the original source files from which this +// source was automatically generated. + //! Events are returned from various bits in the library which indicate some action must be taken //! by the client. //! @@ -491,6 +499,14 @@ pub enum MessageSendEvent { /// The query_short_channel_ids which should be sent. msg: crate::ln::msgs::QueryShortChannelIds, }, + /// Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events + /// emitted during processing of the query. + SendReplyChannelRange { + /// The node_id of this message recipient + node_id: crate::c_types::PublicKey, + /// The reply_channel_range which should be sent. + msg: crate::ln::msgs::ReplyChannelRange, + }, } use lightning::util::events::MessageSendEvent as nativeMessageSendEvent; impl MessageSendEvent { @@ -635,6 +651,14 @@ impl MessageSendEvent { msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) }, } }, + MessageSendEvent::SendReplyChannelRange {ref node_id, ref msg, } => { + let mut node_id_nonref = (*node_id).clone(); + let mut msg_nonref = (*msg).clone(); + nativeMessageSendEvent::SendReplyChannelRange { + node_id: node_id_nonref.into_rust(), + msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) }, + } + }, } } #[allow(unused)] @@ -745,6 +769,12 @@ impl MessageSendEvent { msg: *unsafe { Box::from_raw(msg.take_inner()) }, } }, + MessageSendEvent::SendReplyChannelRange {mut node_id, mut msg, } => { + nativeMessageSendEvent::SendReplyChannelRange { + node_id: node_id.into_rust(), + msg: *unsafe { Box::from_raw(msg.take_inner()) }, + } + }, } } #[allow(unused)] @@ -888,6 +918,14 @@ impl MessageSendEvent { msg: crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true }, } }, + nativeMessageSendEvent::SendReplyChannelRange {ref node_id, ref msg, } => { + let mut node_id_nonref = (*node_id).clone(); + let mut msg_nonref = (*msg).clone(); + MessageSendEvent::SendReplyChannelRange { + node_id: crate::c_types::PublicKey::from_rust(&node_id_nonref), + msg: crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true }, + } + }, } } #[allow(unused)] @@ -998,6 +1036,12 @@ impl MessageSendEvent { msg: crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg)), is_owned: true }, } }, + nativeMessageSendEvent::SendReplyChannelRange {mut node_id, mut msg, } => { + MessageSendEvent::SendReplyChannelRange { + node_id: crate::c_types::PublicKey::from_rust(&node_id), + msg: crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg)), is_owned: true }, + } + }, } } } @@ -1019,8 +1063,8 @@ pub struct MessageSendEventsProvider { /// in the process. #[must_use] pub get_and_clear_pending_msg_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MessageSendEventZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } @@ -1061,8 +1105,8 @@ pub struct EventsProvider { /// in the process. #[must_use] pub get_and_clear_pending_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_EventZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, }