Update auto-generated bindings to LDK 0.0.116
[ldk-c-bindings] / lightning-c-bindings / src / lightning_rapid_gossip_sync / mod.rs
index 87b15b2c0f4b4b34a4d86fd1790248c1c798d846..b4c2d51c082297506649db873b80bd6b8f4dbebd 100644 (file)
@@ -141,6 +141,33 @@ pub extern "C" fn RapidGossipSync_new(network_graph: &crate::lightning::routing:
        crate::lightning_rapid_gossip_sync::RapidGossipSync { inner: ObjOps::heap_alloc(ret), is_owned: true }
 }
 
+/// Sync gossip data from a file.
+/// Returns the last sync timestamp to be used the next time rapid sync data is queried.
+///
+/// `network_graph`: The network graph to apply the updates to
+///
+/// `sync_path`: Path to the file where the gossip update data is located
+///
+#[must_use]
+#[no_mangle]
+pub extern "C" fn RapidGossipSync_sync_network_graph_with_file_path(this_arg: &crate::lightning_rapid_gossip_sync::RapidGossipSync, mut sync_path: crate::c_types::Str) -> crate::c_types::derived::CResult_u32GraphSyncErrorZ {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.sync_network_graph_with_file_path(sync_path.into_str());
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { o }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning_rapid_gossip_sync::error::GraphSyncError::native_into(e) }).into() };
+       local_ret
+}
+
+/// Update network graph from binary data.
+/// Returns the last sync timestamp to be used the next time rapid sync data is queried.
+///
+/// `update_data`: `&[u8]` binary stream that comprises the update data
+#[must_use]
+#[no_mangle]
+pub extern "C" fn RapidGossipSync_update_network_graph(this_arg: &crate::lightning_rapid_gossip_sync::RapidGossipSync, mut update_data: crate::c_types::u8slice) -> crate::c_types::derived::CResult_u32GraphSyncErrorZ {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.update_network_graph(update_data.to_slice());
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { o }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning_rapid_gossip_sync::error::GraphSyncError::native_into(e) }).into() };
+       local_ret
+}
+
 /// Update network graph from binary data.
 /// Returns the last sync timestamp to be used the next time rapid sync data is queried.
 ///