From 10c45786abb10b8d108655a6fb4bc758491dc1ef Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 25 Oct 2020 22:49:05 -0400 Subject: [PATCH 01/16] [bindings] Drop some significantly-overly-verbose logging in gen --- c-bindings-gen/src/main.rs | 3 +-- c-bindings-gen/src/types.rs | 30 ++++++------------------------ 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 97fc9b87318..02521503bb1 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -588,7 +588,7 @@ fn declare_struct<'a, 'b>(s: &'a syn::ItemStruct, types: &mut TypeResolver<'b, ' } } - types.struct_imported(&s.ident, format!("{}", s.ident)); + types.struct_imported(&s.ident); true } @@ -601,7 +601,6 @@ fn writeln_struct<'a, 'b, W: std::io::Write>(w: &mut W, s: &'a syn::ItemStruct, let struct_name = &format!("{}", s.ident); writeln_opaque(w, &s.ident, struct_name, &s.generics, &s.attrs, types, extra_headers, cpp_headers); - eprintln!("exporting fields for {}", struct_name); if let syn::Fields::Named(fields) = &s.fields { let mut gen_types = GenericTypes::new(); assert!(gen_types.learn_generics(&s.generics, types)); diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 0cf809c3605..75995b8435f 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -466,10 +466,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "ln::features::InitFeatures" if is_ref && ptr_for_ref => Some("crate::ln::features::InitFeatures"), "ln::features::InitFeatures" if is_ref => Some("*const crate::ln::features::InitFeatures"), "ln::features::InitFeatures" => Some("crate::ln::features::InitFeatures"), - _ => { - eprintln!(" Type {} (ref: {}) unresolvable in C", full_path, is_ref); - None - }, + _ => None, } } @@ -534,10 +531,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // List of traits we map (possibly during processing of other files): "crate::util::logger::Logger" => Some(""), - _ => { - eprintln!(" Type {} unconvertable from C", full_path); - None - }, + _ => None, }.map(|s| s.to_owned()) } fn from_c_conversion_suffix_from_path<'b>(&self, full_path: &str, is_ref: bool) -> Option { @@ -593,10 +587,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // List of traits we map (possibly during processing of other files): "crate::util::logger::Logger" => Some(""), - _ => { - eprintln!(" Type {} unconvertable from C", full_path); - None - }, + _ => None, }.map(|s| s.to_owned()) } @@ -678,10 +669,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "ln::features::InitFeatures" if is_ref => Some("Box::into_raw(Box::new(crate::ln::features::InitFeatures { inner: &mut "), "ln::features::InitFeatures" if !is_ref => Some("crate::ln::features::InitFeatures { inner: Box::into_raw(Box::new("), - _ => { - eprintln!(" Type {} (is_ref: {}) unconvertable to C", full_path, is_ref); - None - }, + _ => None, }.map(|s| s.to_owned()) } fn to_c_conversion_inline_suffix_from_path(&self, full_path: &str, is_ref: bool, ptr_for_ref: bool) -> Option { @@ -743,10 +731,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "ln::features::InitFeatures" if is_ref => Some(", is_owned: false }))"), "ln::features::InitFeatures" => Some(")), is_owned: true }"), - _ => { - eprintln!(" Type {} unconvertable to C", full_path); - None - }, + _ => None, }.map(|s| s.to_owned()) } @@ -930,14 +915,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { } pub fn mirrored_enum_declared(&mut self, ident: &syn::Ident) { - eprintln!("{} mirrored", ident); self.declared.insert(ident.clone(), DeclType::MirroredEnum); } pub fn enum_ignored(&mut self, ident: &'c syn::Ident) { self.declared.insert(ident.clone(), DeclType::EnumIgnored); } - pub fn struct_imported(&mut self, ident: &'c syn::Ident, named: String) { - eprintln!("Imported {} as {}", ident, named); + pub fn struct_imported(&mut self, ident: &'c syn::Ident) { self.declared.insert(ident.clone(), DeclType::StructImported); } pub fn struct_ignored(&mut self, ident: &syn::Ident) { @@ -945,7 +928,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { self.declared.insert(ident.clone(), DeclType::StructIgnored); } pub fn trait_declared(&mut self, ident: &syn::Ident, t: &'c syn::ItemTrait) { - eprintln!("Trait {} created", ident); self.declared.insert(ident.clone(), DeclType::Trait(t)); } pub fn get_declared_type(&'a self, ident: &syn::Ident) -> Option<&'a DeclType<'c>> { From 9e596e24600b4ea660ca4d9a92e7923d48738b0b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 5 Feb 2021 23:26:53 -0500 Subject: [PATCH 02/16] [bindings] Use resolved, not local ident in generic mangling In traits with associated types which are returned in generics (ie `trait T { type A: B; fn c() -> Result {} }`), we created a new generic mapping with the local type name (in this case A) instead of using the real type (in this case B). This is confusing as it results in generic manglings that don't reference the real type (eg `LDKCResult_ChanKeySignerDecodeErrorZ`) and may have multiple generic definitions that are identical. Instead, we now use the final ident in the resolved mapping. The biggest win is `LDKCResult_ChanKeySignerDecodeErrorZ` changing to `CResult_ChannelKeysDecodeErrorZ`. However, there are several types where `secp256k1::Error` was imported as `SecpError` and types like `LDKCResult_SecretKeySecpErrorZ` are now `LDKCResult_SecretKeyErrorZ` instead. Still, the type of the error field remains `LDKSecp256k1Error`, which should avoid any confusion. --- c-bindings-gen/src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 75995b8435f..ed88c502a19 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -1878,7 +1878,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { generics, &subtype, is_ref, is_mut, ptr_for_ref, true); } } else { - let id = &&$p_arg.path.segments.iter().rev().next().unwrap().ident; + let id = subtype.rsplitn(2, ':').next().unwrap(); // Get the "Base" name of the resolved type write!(w, "{}", id).unwrap(); write!(mangled_type, "{}", id).unwrap(); if let Some(w2) = $extra_write as Option<&mut Vec> { From be74b366d2af242d688f8ce567d49b7c19813c26 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 7 Feb 2021 00:58:36 -0500 Subject: [PATCH 03/16] Gen bindings with rustc --pretty=expanded instead of reading files Instead of walking individual rust files and reading the AST from those, we instead call `RUSTC_BOOTSTRAP=1 cargo rustc --profile=check -- -Zunstable-options --pretty=expanded` and let it create one giant lib.rs which we can parse as a whole. This allows us to parse a post-macro crate, working with structs and functions created inside macros just fine. It does require handling a few things that we didn't previously, most notably Clone via `impl ::core::clone::Clone` blocks instead of just looking for `#![derive(Clone)]`. This ends up resolving a few types slightly differently, resulting in different bindings, but only in ways which don't impact the runtime. --- c-bindings-gen/Cargo.toml | 3 + c-bindings-gen/src/main.rs | 585 +++++++++++++++++------------------- c-bindings-gen/src/types.rs | 32 +- genbindings.sh | 9 +- 4 files changed, 298 insertions(+), 331 deletions(-) diff --git a/c-bindings-gen/Cargo.toml b/c-bindings-gen/Cargo.toml index 6f4716e82a3..dedeade8f8e 100644 --- a/c-bindings-gen/Cargo.toml +++ b/c-bindings-gen/Cargo.toml @@ -8,5 +8,8 @@ edition = "2018" syn = { version = "1", features = ["full", "extra-traits"] } proc-macro2 = "1" +[profile.release] +debug = true + # We're not in the workspace as we're just a binary code generator: [workspace] diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 02521503bb1..f8475bbdcf9 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -14,7 +14,6 @@ use std::collections::{HashMap, HashSet}; use std::env; use std::fs::File; use std::io::{Read, Write}; -use std::path::Path; use std::process; use proc_macro2::{TokenTree, TokenStream, Span}; @@ -555,25 +554,6 @@ fn writeln_opaque(w: &mut W, ident: &syn::Ident, struct_name: writeln!(w, "\t\tret").unwrap(); writeln!(w, "\t}}\n}}").unwrap(); - if attrs_derives_clone(attrs) { - writeln!(w, "impl Clone for {} {{", struct_name).unwrap(); - writeln!(w, "\tfn clone(&self) -> Self {{").unwrap(); - writeln!(w, "\t\tSelf {{").unwrap(); - writeln!(w, "\t\t\tinner: if self.inner.is_null() {{ std::ptr::null_mut() }} else {{").unwrap(); - writeln!(w, "\t\t\t\tBox::into_raw(Box::new(unsafe {{ &*self.inner }}.clone())) }},").unwrap(); - writeln!(w, "\t\t\tis_owned: true,").unwrap(); - writeln!(w, "\t\t}}\n\t}}\n}}").unwrap(); - writeln!(w, "#[allow(unused)]").unwrap(); - writeln!(w, "/// Used only if an object of this type is returned as a trait impl by a method").unwrap(); - writeln!(w, "pub(crate) extern \"C\" fn {}_clone_void(this_ptr: *const c_void) -> *mut c_void {{", struct_name).unwrap(); - writeln!(w, "\tBox::into_raw(Box::new(unsafe {{ (*(this_ptr as *mut native{})).clone() }})) as *mut c_void", struct_name).unwrap(); - writeln!(w, "}}").unwrap(); - writeln!(w, "#[no_mangle]").unwrap(); - writeln!(w, "pub extern \"C\" fn {}_clone(orig: &{}) -> {} {{", struct_name, struct_name, struct_name).unwrap(); - writeln!(w, "\torig.clone()").unwrap(); - writeln!(w, "}}").unwrap(); - } - write_cpp_wrapper(cpp_headers, &format!("{}", ident), true); } @@ -933,20 +913,31 @@ fn writeln_impl(w: &mut W, i: &syn::ItemImpl, types: &mut Typ } ) ); write!(w, "\n").unwrap(); - } else if let Some(trait_ident) = trait_path.1.get_ident() { - //XXX: implement for other things like ToString - match &format!("{}", trait_ident) as &str { - "From" => {}, - "Default" => { - write!(w, "#[must_use]\n#[no_mangle]\npub extern \"C\" fn {}_default() -> {} {{\n", ident, ident).unwrap(); - write!(w, "\t{} {{ inner: Box::into_raw(Box::new(Default::default())), is_owned: true }}\n", ident).unwrap(); - write!(w, "}}\n").unwrap(); - }, - "PartialEq" => {}, - // If we have no generics, try a manual implementation: - _ => maybe_convert_trait_impl(w, &trait_path.1, &*i.self_ty, types, &gen_types), - } + } else if path_matches_nongeneric(&trait_path.1, &["From"]) { + } else if path_matches_nongeneric(&trait_path.1, &["Default"]) { + write!(w, "#[must_use]\n#[no_mangle]\npub extern \"C\" fn {}_default() -> {} {{\n", ident, ident).unwrap(); + write!(w, "\t{} {{ inner: Box::into_raw(Box::new(Default::default())), is_owned: true }}\n", ident).unwrap(); + write!(w, "}}\n").unwrap(); + } else if path_matches_nongeneric(&trait_path.1, &["core", "cmp", "PartialEq"]) { + } else if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) && types.c_type_has_inner_from_path(&resolved_path) { + writeln!(w, "impl Clone for {} {{", ident).unwrap(); + writeln!(w, "\tfn clone(&self) -> Self {{").unwrap(); + writeln!(w, "\t\tSelf {{").unwrap(); + writeln!(w, "\t\t\tinner: if self.inner.is_null() {{ std::ptr::null_mut() }} else {{").unwrap(); + writeln!(w, "\t\t\t\tBox::into_raw(Box::new(unsafe {{ &*self.inner }}.clone())) }},").unwrap(); + writeln!(w, "\t\t\tis_owned: true,").unwrap(); + writeln!(w, "\t\t}}\n\t}}\n}}").unwrap(); + writeln!(w, "#[allow(unused)]").unwrap(); + writeln!(w, "/// Used only if an object of this type is returned as a trait impl by a method").unwrap(); + writeln!(w, "pub(crate) extern \"C\" fn {}_clone_void(this_ptr: *const c_void) -> *mut c_void {{", ident).unwrap(); + writeln!(w, "\tBox::into_raw(Box::new(unsafe {{ (*(this_ptr as *mut native{})).clone() }})) as *mut c_void", ident).unwrap(); + writeln!(w, "}}").unwrap(); + writeln!(w, "#[no_mangle]").unwrap(); + writeln!(w, "pub extern \"C\" fn {}_clone(orig: &{}) -> {} {{", ident, ident, ident).unwrap(); + writeln!(w, "\torig.clone()").unwrap(); + writeln!(w, "}}").unwrap(); } else { + //XXX: implement for other things like ToString // If we have no generics, try a manual implementation: maybe_convert_trait_impl(w, &trait_path.1, &*i.self_ty, types, &gen_types); } @@ -1194,207 +1185,189 @@ fn writeln_fn<'a, 'b, W: std::io::Write>(w: &mut W, f: &'a syn::ItemFn, types: & // ******************************** // *** File/Crate Walking Logic *** // ******************************** - -/// Simple utility to walk the modules in a crate - iterating over the modules (with file paths) in -/// a single File. -struct FileIter<'a, I: Iterator> { - in_dir: &'a str, - path: &'a str, - module: &'a str, - item_iter: I, +/// A public module +struct ASTModule { + pub attrs: Vec, + pub items: Vec, + pub submods: Vec, } -impl<'a, I: Iterator> Iterator for FileIter<'a, I> { - type Item = (String, String, &'a syn::ItemMod); - fn next(&mut self) -> std::option::Option<::Item> { - loop { - match self.item_iter.next() { - Some(syn::Item::Mod(m)) => { - if let syn::Visibility::Public(_) = m.vis { - match export_status(&m.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => continue, - } - - let f_path = format!("{}/{}.rs", (self.path.as_ref() as &Path).parent().unwrap().display(), m.ident); - let new_mod = if self.module.is_empty() { format!("{}", m.ident) } else { format!("{}::{}", self.module, m.ident) }; - if let Ok(_) = File::open(&format!("{}/{}", self.in_dir, f_path)) { - return Some((f_path, new_mod, m)); - } else { - return Some(( - format!("{}/{}/mod.rs", (self.path.as_ref() as &Path).parent().unwrap().display(), m.ident), - new_mod, m)); +/// A struct containing the syn::File AST for each file in the crate. +struct FullLibraryAST { + modules: HashMap, +} +impl FullLibraryAST { + fn load_module(&mut self, module: String, attrs: Vec, mut items: Vec) { + let mut non_mod_items = Vec::with_capacity(items.len()); + let mut submods = Vec::with_capacity(items.len()); + for item in items.drain(..) { + match item { + syn::Item::Mod(m) if m.content.is_some() => { + if export_status(&m.attrs) == ExportStatus::Export { + if let syn::Visibility::Public(_) = m.vis { + let modident = format!("{}", m.ident); + let modname = if module != "" { + module.clone() + "::" + &modident + } else { + modident.clone() + }; + self.load_module(modname, m.attrs, m.content.unwrap().1); + submods.push(modident); } } }, - Some(_) => {}, - None => return None, + _ => { non_mod_items.push(item); } } } + self.modules.insert(module, ASTModule { attrs, items: non_mod_items, submods }); } -} -fn file_iter<'a>(file: &'a syn::File, in_dir: &'a str, path: &'a str, module: &'a str) -> - impl Iterator + 'a { - FileIter { in_dir, path, module, item_iter: file.items.iter() } -} -/// A struct containing the syn::File AST for each file in the crate. -struct FullLibraryAST { - files: HashMap, + pub fn load_lib(lib: syn::File) -> Self { + assert_eq!(export_status(&lib.attrs), ExportStatus::Export); + let mut res = Self { modules: HashMap::default() }; + res.load_module("".to_owned(), lib.attrs, lib.items); + res + } } /// Do the Real Work of mapping an original file to C-callable wrappers. Creates a new file at /// `out_path` and fills it with wrapper structs/functions to allow calling the things in the AST /// at `module` from C. -fn convert_file<'a, 'b>(libast: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a>, in_dir: &str, out_dir: &str, path: &str, orig_crate: &str, module: &str, header_file: &mut File, cpp_header_file: &mut File) { - let syntax = if let Some(ast) = libast.files.get(module) { ast } else { return }; - - assert!(syntax.shebang.is_none()); // Not sure what this is, hope we dont have one - - let new_file_path = format!("{}/{}", out_dir, path); - let _ = std::fs::create_dir((&new_file_path.as_ref() as &std::path::Path).parent().unwrap()); - let mut out = std::fs::OpenOptions::new().write(true).create(true).truncate(true) - .open(new_file_path).expect("Unable to open new src file"); - - assert_eq!(export_status(&syntax.attrs), ExportStatus::Export); - writeln_docs(&mut out, &syntax.attrs, ""); - - if path.ends_with("/lib.rs") { - // Special-case the top-level lib.rs with various lint allows and a pointer to the c_types - // and bitcoin hand-written modules. - writeln!(out, "#![allow(unknown_lints)]").unwrap(); - writeln!(out, "#![allow(non_camel_case_types)]").unwrap(); - writeln!(out, "#![allow(non_snake_case)]").unwrap(); - writeln!(out, "#![allow(unused_imports)]").unwrap(); - writeln!(out, "#![allow(unused_variables)]").unwrap(); - writeln!(out, "#![allow(unused_mut)]").unwrap(); - writeln!(out, "#![allow(unused_parens)]").unwrap(); - writeln!(out, "#![allow(unused_unsafe)]").unwrap(); - writeln!(out, "#![allow(unused_braces)]").unwrap(); - writeln!(out, "mod c_types;").unwrap(); - writeln!(out, "mod bitcoin;").unwrap(); - } else { - writeln!(out, "\nuse std::ffi::c_void;\nuse bitcoin::hashes::Hash;\nuse crate::c_types::*;\n").unwrap(); - } +fn convert_file<'a, 'b>(libast: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a>, out_dir: &str, orig_crate: &str, header_file: &mut File, cpp_header_file: &mut File) { + for (module, astmod) in libast.modules.iter() { + let ASTModule { ref attrs, ref items, ref submods } = astmod; + assert_eq!(export_status(&attrs), ExportStatus::Export); + + let new_file_path = if submods.is_empty() { + format!("{}/{}.rs", out_dir, module.replace("::", "/")) + } else if module != "" { + format!("{}/{}/mod.rs", out_dir, module.replace("::", "/")) + } else { + format!("{}/lib.rs", out_dir) + }; + let _ = std::fs::create_dir((&new_file_path.as_ref() as &std::path::Path).parent().unwrap()); + let mut out = std::fs::OpenOptions::new().write(true).create(true).truncate(true) + .open(new_file_path).expect("Unable to open new src file"); + + writeln_docs(&mut out, &attrs, ""); + + if module == "" { + // Special-case the top-level lib.rs with various lint allows and a pointer to the c_types + // and bitcoin hand-written modules. + writeln!(out, "#![allow(unknown_lints)]").unwrap(); + writeln!(out, "#![allow(non_camel_case_types)]").unwrap(); + writeln!(out, "#![allow(non_snake_case)]").unwrap(); + writeln!(out, "#![allow(unused_imports)]").unwrap(); + writeln!(out, "#![allow(unused_variables)]").unwrap(); + writeln!(out, "#![allow(unused_mut)]").unwrap(); + writeln!(out, "#![allow(unused_parens)]").unwrap(); + writeln!(out, "#![allow(unused_unsafe)]").unwrap(); + writeln!(out, "#![allow(unused_braces)]").unwrap(); + writeln!(out, "mod c_types;").unwrap(); + writeln!(out, "mod bitcoin;").unwrap(); + } else { + writeln!(out, "\nuse std::ffi::c_void;\nuse bitcoin::hashes::Hash;\nuse crate::c_types::*;\n").unwrap(); + } - for (path, new_mod, m) in file_iter(&syntax, in_dir, path, &module) { - writeln_docs(&mut out, &m.attrs, ""); - writeln!(out, "pub mod {};", m.ident).unwrap(); - convert_file(libast, crate_types, in_dir, out_dir, &path, - orig_crate, &new_mod, header_file, cpp_header_file); - } + for m in submods { + writeln!(out, "pub mod {};", m).unwrap(); + } - eprintln!("Converting {} entries...", path); + eprintln!("Converting {} entries...", module); - let mut type_resolver = TypeResolver::new(orig_crate, module, crate_types); + let mut type_resolver = TypeResolver::new(orig_crate, module, crate_types); - // First pass over the items and fill in imports and file-declared objects in the type resolver - for item in syntax.items.iter() { - match item { - syn::Item::Use(u) => type_resolver.process_use(&mut out, &u), - syn::Item::Struct(s) => { - if let syn::Visibility::Public(_) = s.vis { - declare_struct(&s, &mut type_resolver); - } - }, - syn::Item::Enum(e) => { - if let syn::Visibility::Public(_) = e.vis { - declare_enum(&e, &mut type_resolver); - } - }, - _ => {}, + // First pass over the items and fill in imports and file-declared objects in the type resolver + for item in items.iter() { + match item { + syn::Item::Use(u) => type_resolver.process_use(&mut out, &u), + syn::Item::Struct(s) => { + if let syn::Visibility::Public(_) = s.vis { + declare_struct(&s, &mut type_resolver); + } + }, + syn::Item::Enum(e) => { + if let syn::Visibility::Public(_) = e.vis { + declare_enum(&e, &mut type_resolver); + } + }, + _ => {}, + } } - } - for item in syntax.items.iter() { - match item { - syn::Item::Use(_) => {}, // Handled above - syn::Item::Static(_) => {}, - syn::Item::Enum(e) => { - if let syn::Visibility::Public(_) = e.vis { - writeln_enum(&mut out, &e, &mut type_resolver, header_file, cpp_header_file); - } - }, - syn::Item::Impl(i) => { - writeln_impl(&mut out, &i, &mut type_resolver); - }, - syn::Item::Struct(s) => { - if let syn::Visibility::Public(_) = s.vis { - writeln_struct(&mut out, &s, &mut type_resolver, header_file, cpp_header_file); - } - }, - syn::Item::Trait(t) => { - if let syn::Visibility::Public(_) = t.vis { - writeln_trait(&mut out, &t, &mut type_resolver, header_file, cpp_header_file); - } - }, - syn::Item::Mod(_) => {}, // We don't have to do anything - the top loop handles these. - syn::Item::Const(c) => { - // Re-export any primitive-type constants. - if let syn::Visibility::Public(_) = c.vis { - if let syn::Type::Path(p) = &*c.ty { - let resolved_path = type_resolver.resolve_path(&p.path, None); - if type_resolver.is_primitive(&resolved_path) { - writeln!(out, "\n#[no_mangle]").unwrap(); - writeln!(out, "pub static {}: {} = {}::{}::{};", c.ident, resolved_path, orig_crate, module, c.ident).unwrap(); - } + for item in items.iter() { + match item { + syn::Item::Use(_) => {}, // Handled above + syn::Item::Static(_) => {}, + syn::Item::Enum(e) => { + if let syn::Visibility::Public(_) = e.vis { + writeln_enum(&mut out, &e, &mut type_resolver, header_file, cpp_header_file); } - } - }, - syn::Item::Type(t) => { - if let syn::Visibility::Public(_) = t.vis { - match export_status(&t.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => continue, + }, + syn::Item::Impl(i) => { + writeln_impl(&mut out, &i, &mut type_resolver); + }, + syn::Item::Struct(s) => { + if let syn::Visibility::Public(_) = s.vis { + writeln_struct(&mut out, &s, &mut type_resolver, header_file, cpp_header_file); } - - let mut process_alias = true; - for tok in t.generics.params.iter() { - if let syn::GenericParam::Lifetime(_) = tok {} - else { process_alias = false; } + }, + syn::Item::Trait(t) => { + if let syn::Visibility::Public(_) = t.vis { + writeln_trait(&mut out, &t, &mut type_resolver, header_file, cpp_header_file); } - if process_alias { - match &*t.ty { - syn::Type::Path(_) => - writeln_opaque(&mut out, &t.ident, &format!("{}", t.ident), &t.generics, &t.attrs, &type_resolver, header_file, cpp_header_file), - _ => {} + }, + syn::Item::Mod(_) => {}, // We don't have to do anything - the top loop handles these. + syn::Item::Const(c) => { + // Re-export any primitive-type constants. + if let syn::Visibility::Public(_) = c.vis { + if let syn::Type::Path(p) = &*c.ty { + let resolved_path = type_resolver.resolve_path(&p.path, None); + if type_resolver.is_primitive(&resolved_path) { + writeln!(out, "\n#[no_mangle]").unwrap(); + writeln!(out, "pub static {}: {} = {}::{}::{};", c.ident, resolved_path, orig_crate, module, c.ident).unwrap(); + } } } - } - }, - syn::Item::Fn(f) => { - if let syn::Visibility::Public(_) = f.vis { - writeln_fn(&mut out, &f, &mut type_resolver); - } - }, - syn::Item::Macro(m) => { - if m.ident.is_none() { // If its not a macro definition - convert_macro(&mut out, &m.mac.path, &m.mac.tokens, &type_resolver); - } - }, - syn::Item::Verbatim(_) => {}, - syn::Item::ExternCrate(_) => {}, - _ => unimplemented!(), - } - } - - out.flush().unwrap(); -} - -/// Load the AST for each file in the crate, filling the FullLibraryAST object -fn load_ast(in_dir: &str, path: &str, module: String, ast_storage: &mut FullLibraryAST) { - eprintln!("Loading {}{}...", in_dir, path); - - let mut file = File::open(format!("{}/{}", in_dir, path)).expect("Unable to open file"); - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - let syntax = syn::parse_file(&src).expect("Unable to parse file"); + }, + syn::Item::Type(t) => { + if let syn::Visibility::Public(_) = t.vis { + match export_status(&t.attrs) { + ExportStatus::Export => {}, + ExportStatus::NoExport|ExportStatus::TestOnly => continue, + } - assert_eq!(export_status(&syntax.attrs), ExportStatus::Export); + let mut process_alias = true; + for tok in t.generics.params.iter() { + if let syn::GenericParam::Lifetime(_) = tok {} + else { process_alias = false; } + } + if process_alias { + match &*t.ty { + syn::Type::Path(_) => + writeln_opaque(&mut out, &t.ident, &format!("{}", t.ident), &t.generics, &t.attrs, &type_resolver, header_file, cpp_header_file), + _ => {} + } + } + } + }, + syn::Item::Fn(f) => { + if let syn::Visibility::Public(_) = f.vis { + writeln_fn(&mut out, &f, &mut type_resolver); + } + }, + syn::Item::Macro(m) => { + if m.ident.is_none() { // If its not a macro definition + convert_macro(&mut out, &m.mac.path, &m.mac.tokens, &type_resolver); + } + }, + syn::Item::Verbatim(_) => {}, + syn::Item::ExternCrate(_) => {}, + _ => unimplemented!(), + } + } - for (path, new_mod, _) in file_iter(&syntax, in_dir, path, &module) { - load_ast(in_dir, &path, new_mod, ast_storage); + out.flush().unwrap(); } - ast_storage.files.insert(module, syntax); } /// Insert ident -> absolute Path resolutions into imports from the given UseTree and path-prefix. @@ -1444,120 +1417,120 @@ fn resolve_imported_refs(imports: &HashMap<&syn::Ident, syn::Path>, mut ty: syn: } /// Walk the FullLibraryAST, deciding how things will be mapped and adding tracking to CrateTypes. -fn walk_ast<'a>(in_dir: &str, path: &str, module: String, ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a>) { - let syntax = if let Some(ast) = ast_storage.files.get(&module) { ast } else { return }; - assert_eq!(export_status(&syntax.attrs), ExportStatus::Export); - - for (path, new_mod, _) in file_iter(&syntax, in_dir, path, &module) { - walk_ast(in_dir, &path, new_mod, ast_storage, crate_types); - } - - let mut import_maps = HashMap::new(); - - for item in syntax.items.iter() { - match item { - syn::Item::Use(u) => { - process_use_intern(&u.tree, syn::punctuated::Punctuated::new(), &mut import_maps); - }, - syn::Item::Struct(s) => { - if let syn::Visibility::Public(_) = s.vis { - match export_status(&s.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => continue, - } - let struct_path = format!("{}::{}", module, s.ident); - if attrs_derives_clone(&s.attrs) { - crate_types.clonable_types.insert("crate::".to_owned() + &struct_path); - } - - crate_types.opaques.insert(struct_path, &s.ident); - } - }, - syn::Item::Trait(t) => { - if let syn::Visibility::Public(_) = t.vis { - match export_status(&t.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => continue, - } - let trait_path = format!("{}::{}", module, t.ident); - walk_supertraits!(t, None, ( - ("Clone", _) => { - crate_types.clonable_types.insert("crate::".to_owned() + &trait_path); - }, - (_, _) => {} - ) ); - crate_types.traits.insert(trait_path, &t); - } - }, - syn::Item::Type(t) => { - if let syn::Visibility::Public(_) = t.vis { - match export_status(&t.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => continue, - } - let type_path = format!("{}::{}", module, t.ident); - let mut process_alias = true; - for tok in t.generics.params.iter() { - if let syn::GenericParam::Lifetime(_) = tok {} - else { process_alias = false; } +fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a>) { + for (module, astmod) in ast_storage.modules.iter() { + let ASTModule { ref attrs, ref items, submods: _ } = astmod; + assert_eq!(export_status(&attrs), ExportStatus::Export); + let mut import_maps = HashMap::new(); + + for item in items.iter() { + match item { + syn::Item::Use(u) => { + process_use_intern(&u.tree, syn::punctuated::Punctuated::new(), &mut import_maps); + }, + syn::Item::Struct(s) => { + if let syn::Visibility::Public(_) = s.vis { + match export_status(&s.attrs) { + ExportStatus::Export => {}, + ExportStatus::NoExport|ExportStatus::TestOnly => continue, + } + let struct_path = format!("{}::{}", module, s.ident); + crate_types.opaques.insert(struct_path, &s.ident); } - if process_alias { - match &*t.ty { - syn::Type::Path(_) => { - // If its a path with no generics, assume we don't map the aliased type and map it opaque - crate_types.opaques.insert(type_path, &t.ident); + }, + syn::Item::Trait(t) => { + if let syn::Visibility::Public(_) = t.vis { + match export_status(&t.attrs) { + ExportStatus::Export => {}, + ExportStatus::NoExport|ExportStatus::TestOnly => continue, + } + let trait_path = format!("{}::{}", module, t.ident); + walk_supertraits!(t, None, ( + ("Clone", _) => { + crate_types.clonable_types.insert("crate::".to_owned() + &trait_path); }, - _ => { - crate_types.type_aliases.insert(type_path, resolve_imported_refs(&import_maps, (*t.ty).clone())); + (_, _) => {} + ) ); + crate_types.traits.insert(trait_path, &t); + } + }, + syn::Item::Type(t) => { + if let syn::Visibility::Public(_) = t.vis { + match export_status(&t.attrs) { + ExportStatus::Export => {}, + ExportStatus::NoExport|ExportStatus::TestOnly => continue, + } + let type_path = format!("{}::{}", module, t.ident); + let mut process_alias = true; + for tok in t.generics.params.iter() { + if let syn::GenericParam::Lifetime(_) = tok {} + else { process_alias = false; } + } + if process_alias { + match &*t.ty { + syn::Type::Path(_) => { + // If its a path with no generics, assume we don't map the aliased type and map it opaque + crate_types.opaques.insert(type_path, &t.ident); + }, + _ => { + crate_types.type_aliases.insert(type_path, resolve_imported_refs(&import_maps, (*t.ty).clone())); + } } } } - } - }, - syn::Item::Enum(e) if is_enum_opaque(e) => { - if let syn::Visibility::Public(_) = e.vis { - match export_status(&e.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => continue, - } - let enum_path = format!("{}::{}", module, e.ident); - if attrs_derives_clone(&e.attrs) { - crate_types.clonable_types.insert("crate::".to_owned() + &enum_path); + }, + syn::Item::Enum(e) if is_enum_opaque(e) => { + if let syn::Visibility::Public(_) = e.vis { + match export_status(&e.attrs) { + ExportStatus::Export => {}, + ExportStatus::NoExport|ExportStatus::TestOnly => continue, + } + let enum_path = format!("{}::{}", module, e.ident); + crate_types.opaques.insert(enum_path, &e.ident); } - crate_types.opaques.insert(enum_path, &e.ident); - } - }, - syn::Item::Enum(e) => { - if let syn::Visibility::Public(_) = e.vis { - match export_status(&e.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => continue, + }, + syn::Item::Enum(e) => { + if let syn::Visibility::Public(_) = e.vis { + match export_status(&e.attrs) { + ExportStatus::Export => {}, + ExportStatus::NoExport|ExportStatus::TestOnly => continue, + } + let enum_path = format!("{}::{}", module, e.ident); + crate_types.mirrored_enums.insert(enum_path, &e); } - let enum_path = format!("{}::{}", module, e.ident); - if attrs_derives_clone(&e.attrs) { - crate_types.clonable_types.insert("crate::".to_owned() + &enum_path); + }, + syn::Item::Impl(i) => { + if let &syn::Type::Path(ref p) = &*i.self_ty { + if let Some(trait_path) = i.trait_.as_ref() { + if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) { + // Note, we should probably have more full-featured type resolution here, + // but for now we don't have any cases where we impl X for A::B. + let ident = single_ident_generic_path_to_ident(&p.path).expect("impl X for A::B currently unsupported"); + assert!(import_maps.get(&ident).is_none()); + crate_types.clonable_types.insert(format!("crate::{}::{}", module, ident)); + } + } } - crate_types.mirrored_enums.insert(enum_path, &e); - } - }, - _ => {}, + }, + _ => {}, + } } } } fn main() { let args: Vec = env::args().collect(); - if args.len() != 7 { - eprintln!("Usage: source/dir target/dir source_crate_name derived_templates.rs extra/includes.h extra/cpp/includes.hpp"); + if args.len() != 6 { + eprintln!("Usage: target/dir source_crate_name derived_templates.rs extra/includes.h extra/cpp/includes.hpp"); process::exit(1); } let mut derived_templates = std::fs::OpenOptions::new().write(true).create(true).truncate(true) - .open(&args[4]).expect("Unable to open new header file"); + .open(&args[3]).expect("Unable to open new header file"); let mut header_file = std::fs::OpenOptions::new().write(true).create(true).truncate(true) - .open(&args[5]).expect("Unable to open new header file"); + .open(&args[4]).expect("Unable to open new header file"); let mut cpp_header_file = std::fs::OpenOptions::new().write(true).create(true).truncate(true) - .open(&args[6]).expect("Unable to open new header file"); + .open(&args[5]).expect("Unable to open new header file"); writeln!(header_file, "#if defined(__GNUC__)").unwrap(); writeln!(header_file, "#define MUST_USE_STRUCT __attribute__((warn_unused))").unwrap(); @@ -1575,18 +1548,20 @@ fn main() { // First parse the full crate's ASTs, caching them so that we can hold references to the AST // objects in other datastructures: - let mut libast = FullLibraryAST { files: HashMap::new() }; - load_ast(&args[1], "/lib.rs", "".to_string(), &mut libast); + let mut lib_src = String::new(); + std::io::stdin().lock().read_to_string(&mut lib_src).unwrap(); + let lib_syntax = syn::parse_file(&lib_src).expect("Unable to parse file"); + let libast = FullLibraryAST::load_lib(lib_syntax); // ...then walk the ASTs tracking what types we will map, and how, so that we can resolve them // when parsing other file ASTs... let mut libtypes = CrateTypes { traits: HashMap::new(), opaques: HashMap::new(), mirrored_enums: HashMap::new(), type_aliases: HashMap::new(), templates_defined: HashMap::default(), template_file: &mut derived_templates, clonable_types: HashSet::new() }; - walk_ast(&args[1], "/lib.rs", "".to_string(), &libast, &mut libtypes); + walk_ast(&libast, &mut libtypes); // ... finally, do the actual file conversion/mapping, writing out types as we go. - convert_file(&libast, &mut libtypes, &args[1], &args[2], "/lib.rs", &args[3], "", &mut header_file, &mut cpp_header_file); + convert_file(&libast, &mut libtypes, &args[1], &args[2], &mut header_file, &mut cpp_header_file); // For container templates which we created while walking the crate, make sure we add C++ // mapped types so that C++ users can utilize the auto-destructors available. diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index ed88c502a19..7f979a56752 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -41,28 +41,13 @@ pub fn single_ident_generic_path_to_ident(p: &syn::Path) -> Option<&syn::Ident> } else { None } } -pub fn attrs_derives_clone(attrs: &[syn::Attribute]) -> bool { - for attr in attrs.iter() { - let tokens_clone = attr.tokens.clone(); - let mut token_iter = tokens_clone.into_iter(); - if let Some(token) = token_iter.next() { - match token { - TokenTree::Group(g) => { - if format!("{}", single_ident_generic_path_to_ident(&attr.path).unwrap()) == "derive" { - for id in g.stream().into_iter() { - if let TokenTree::Ident(i) = id { - if i == "Clone" { - return true; - } - } - } - } - }, - _ => {}, - } - } +pub fn path_matches_nongeneric(p: &syn::Path, exp: &[&str]) -> bool { + if p.segments.len() != exp.len() { return false; } + for (seg, e) in p.segments.iter().zip(exp.iter()) { + if seg.arguments != syn::PathArguments::None { return false; } + if &format!("{}", seg.ident) != *e { return false; } } - false + true } #[derive(Debug, PartialEq)] @@ -165,6 +150,7 @@ impl<'a> GenericTypes<'a> { if let Some(ident) = single_ident_generic_path_to_ident(&trait_bound.path) { match &format!("{}", ident) as &str { "Send" => continue, "Sync" => continue, _ => {} } } + if path_matches_nongeneric(&trait_bound.path, &["core", "clone", "Clone"]) { continue; } assert_simple_bound(&trait_bound); if let Some(mut path) = types.maybe_resolve_path(&trait_bound.path, None) { @@ -298,7 +284,7 @@ pub enum DeclType<'a> { // the sorting is stable across runs. It is deprecated, but the "replacement" doesn't actually // accomplish the same goals, so we just ignore it. #[allow(deprecated)] -type NonRandomHash = hash::BuildHasherDefault; +pub type NonRandomHash = hash::BuildHasherDefault; /// Top-level struct tracking everything which has been defined while walking the crate. pub struct CrateTypes<'a> { @@ -900,6 +886,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { eprintln!("Ignoring pub(use) tree!"); return; } + if u.leading_colon.is_some() { eprintln!("Ignoring leading-colon use!"); return; } match &u.tree { syn::UseTree::Path(p) => { let new_path = format!("{}", p.ident); @@ -911,7 +898,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { }, _ => unimplemented!(), } - if u.leading_colon.is_some() { unimplemented!() } } pub fn mirrored_enum_declared(&mut self, ident: &syn::Ident) { diff --git a/genbindings.sh b/genbindings.sh index 29e6ac1867e..1ca2f6e8e88 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -6,7 +6,7 @@ set -x # Generate (and reasonably test) C bindings # First build the latest c-bindings-gen binary -cd c-bindings-gen && cargo build && cd .. +cd c-bindings-gen && cargo build --release && cd .. # Then wipe all the existing C bindings (because we're being run in the right directory) # note that we keep the few manually-generated files first: @@ -20,12 +20,15 @@ mv ./mod.rs lightning-c-bindings/src/c_types/ mv ./bitcoin lightning-c-bindings/src/ # Finally, run the c-bindings-gen binary, building fresh bindings. -SRC="$(pwd)/lightning/src" OUT="$(pwd)/lightning-c-bindings/src" OUT_TEMPL="$(pwd)/lightning-c-bindings/src/c_types/derived.rs" OUT_F="$(pwd)/lightning-c-bindings/include/rust_types.h" OUT_CPP="$(pwd)/lightning-c-bindings/include/lightningpp.hpp" -RUST_BACKTRACE=1 ./c-bindings-gen/target/debug/c-bindings-gen $SRC/ $OUT/ lightning $OUT_TEMPL $OUT_F $OUT_CPP + +cd lightning +RUSTC_BOOTSTRAP=1 cargo rustc --profile=check -- -Zunstable-options --pretty=expanded | + RUST_BACKTRACE=1 ../c-bindings-gen/target/release/c-bindings-gen $OUT/ lightning $OUT_TEMPL $OUT_F $OUT_CPP +cd .. # Now cd to lightning-c-bindings, build the generated bindings, and call cbindgen to build a C header file PATH="$PATH:~/.cargo/bin" From 0dcc937bf146a10105ff6f3a1103e523cd9d6db4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 7 Feb 2021 00:58:49 -0500 Subject: [PATCH 04/16] Update demo C++ bindings example for new bindings --- lightning-c-bindings/demo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lightning-c-bindings/demo.cpp b/lightning-c-bindings/demo.cpp index 37bb8d3188d..32c8d605c11 100644 --- a/lightning-c-bindings/demo.cpp +++ b/lightning-c-bindings/demo.cpp @@ -385,8 +385,9 @@ int main() { assert(channels2->datalen == 0); LDK::RoutingMessageHandler net_msgs2 = NetGraphMsgHandler_as_RoutingMessageHandler(&net_graph2); - LDK::ChannelAnnouncement chan_ann = ChannelAnnouncement_read(LDKu8slice { .data = valid_node_announcement, .datalen = sizeof(valid_node_announcement) }); - LDK::CResult_boolLightningErrorZ ann_res = net_msgs2->handle_channel_announcement(net_msgs2->this_arg, &chan_ann); + LDK::CResult_ChannelAnnouncementDecodeErrorZ chan_ann = ChannelAnnouncement_read(LDKu8slice { .data = valid_node_announcement, .datalen = sizeof(valid_node_announcement) }); + assert(chan_ann->result_ok); + LDK::CResult_boolLightningErrorZ ann_res = net_msgs2->handle_channel_announcement(net_msgs2->this_arg, chan_ann->contents.result); assert(ann_res->result_ok); LDK::MessageHandler msg_handler2 = MessageHandler_new(ChannelManager_as_ChannelMessageHandler(&cm2), std::move(net_msgs2)); From dd1ca585b30819b18b718711c45ec37cdb56a681 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 8 Feb 2021 16:14:53 -0500 Subject: [PATCH 05/16] [bindings] Extract import resolution logic into a separate struct This will allow us to reuse the same ident-resolution logic both during the initial AST pass and during the second conversion pass. --- c-bindings-gen/src/types.rs | 277 +++++++++++++++++++++--------------- 1 file changed, 161 insertions(+), 116 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 7f979a56752..7e0099cfc47 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -279,6 +279,153 @@ pub enum DeclType<'a> { EnumIgnored, } +pub struct ImportResolver<'mod_lifetime, 'crate_lft: 'mod_lifetime> { + module_path: &'mod_lifetime str, + imports: HashMap, + declared: HashMap>, +} +impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'crate_lft> { + pub fn new(module_path: &'mod_lifetime str) -> Self { + let mut imports = HashMap::new(); + // Add primitives to the "imports" list: + imports.insert(syn::Ident::new("bool", Span::call_site()), "bool".to_string()); + imports.insert(syn::Ident::new("u64", Span::call_site()), "u64".to_string()); + imports.insert(syn::Ident::new("u32", Span::call_site()), "u32".to_string()); + imports.insert(syn::Ident::new("u16", Span::call_site()), "u16".to_string()); + imports.insert(syn::Ident::new("u8", Span::call_site()), "u8".to_string()); + imports.insert(syn::Ident::new("usize", Span::call_site()), "usize".to_string()); + imports.insert(syn::Ident::new("str", Span::call_site()), "str".to_string()); + imports.insert(syn::Ident::new("String", Span::call_site()), "String".to_string()); + + // These are here to allow us to print native Rust types in trait fn impls even if we don't + // have C mappings: + imports.insert(syn::Ident::new("Result", Span::call_site()), "Result".to_string()); + imports.insert(syn::Ident::new("Vec", Span::call_site()), "Vec".to_string()); + imports.insert(syn::Ident::new("Option", Span::call_site()), "Option".to_string()); + Self { module_path, imports, declared: HashMap::new() } + } + + fn process_use_intern(&mut self, u: &syn::UseTree, partial_path: &str) { + match u { + syn::UseTree::Path(p) => { + let new_path = format!("{}::{}", partial_path, p.ident); + self.process_use_intern(&p.tree, &new_path); + }, + syn::UseTree::Name(n) => { + let full_path = format!("{}::{}", partial_path, n.ident); + self.imports.insert(n.ident.clone(), full_path); + }, + syn::UseTree::Group(g) => { + for i in g.items.iter() { + self.process_use_intern(i, partial_path); + } + }, + syn::UseTree::Rename(r) => { + let full_path = format!("{}::{}", partial_path, r.ident); + self.imports.insert(r.rename.clone(), full_path); + }, + syn::UseTree::Glob(_) => { + eprintln!("Ignoring * use for {} - this may result in resolution failures", partial_path); + }, + } + } + + pub fn process_use(&mut self, u: &syn::ItemUse) { + if let syn::Visibility::Public(_) = u.vis { + // We actually only use these for #[cfg(fuzztarget)] + eprintln!("Ignoring pub(use) tree!"); + return; + } + if u.leading_colon.is_some() { eprintln!("Ignoring leading-colon use!"); return; } + match &u.tree { + syn::UseTree::Path(p) => { + let new_path = format!("{}", p.ident); + self.process_use_intern(&p.tree, &new_path); + }, + syn::UseTree::Name(n) => { + let full_path = format!("{}", n.ident); + self.imports.insert(n.ident.clone(), full_path); + }, + _ => unimplemented!(), + } + } + + pub fn mirrored_enum_declared(&mut self, ident: &syn::Ident) { + self.declared.insert(ident.clone(), DeclType::MirroredEnum); + } + pub fn enum_ignored(&mut self, ident: &'crate_lft syn::Ident) { + self.declared.insert(ident.clone(), DeclType::EnumIgnored); + } + pub fn struct_imported(&mut self, ident: &'crate_lft syn::Ident) { + self.declared.insert(ident.clone(), DeclType::StructImported); + } + pub fn struct_ignored(&mut self, ident: &syn::Ident) { + self.declared.insert(ident.clone(), DeclType::StructIgnored); + } + pub fn trait_declared(&mut self, ident: &syn::Ident, t: &'crate_lft syn::ItemTrait) { + self.declared.insert(ident.clone(), DeclType::Trait(t)); + } + pub fn get_declared_type(&self, ident: &syn::Ident) -> Option<&DeclType<'crate_lft>> { + self.declared.get(ident) + } + + pub fn maybe_resolve_declared(&self, id: &syn::Ident) -> Option<&DeclType<'crate_lft>> { + self.declared.get(id) + } + + pub fn maybe_resolve_ident(&self, id: &syn::Ident) -> Option { + if let Some(imp) = self.imports.get(id) { + Some(imp.clone()) + } else if self.declared.get(id).is_some() { + Some(self.module_path.to_string() + "::" + &format!("{}", id)) + } else { None } + } + + pub fn maybe_resolve_non_ignored_ident(&self, id: &syn::Ident) -> Option { + if let Some(imp) = self.imports.get(id) { + Some(imp.clone()) + } else if let Some(decl_type) = self.declared.get(id) { + match decl_type { + DeclType::StructIgnored => None, + _ => Some(self.module_path.to_string() + "::" + &format!("{}", id)), + } + } else { None } + } + + pub fn maybe_resolve_path(&self, p_arg: &syn::Path, generics: Option<&GenericTypes>) -> Option { + let p = if let Some(gen_types) = generics { + if let Some((_, synpath)) = gen_types.maybe_resolve_path(p_arg) { + synpath + } else { p_arg } + } else { p_arg }; + + if p.leading_colon.is_some() { + Some(p.segments.iter().enumerate().map(|(idx, seg)| { + format!("{}{}", if idx == 0 { "" } else { "::" }, seg.ident) + }).collect()) + } else if let Some(id) = p.get_ident() { + self.maybe_resolve_ident(id) + } else { + if p.segments.len() == 1 { + let seg = p.segments.iter().next().unwrap(); + return self.maybe_resolve_ident(&seg.ident); + } + let mut seg_iter = p.segments.iter(); + let first_seg = seg_iter.next().unwrap(); + let remaining: String = seg_iter.map(|seg| { + format!("::{}", seg.ident) + }).collect(); + if let Some(imp) = self.imports.get(&first_seg.ident) { + if remaining != "" { + Some(imp.clone() + &remaining) + } else { + Some(imp.clone()) + } + } else { None } + } + } +} + // templates_defined is walked to write the C++ header, so if we use the default hashing it get // reordered on each genbindings run. Instead, we use SipHasher (which defaults to 0-keys) so that // the sorting is stable across runs. It is deprecated, but the "replacement" doesn't actually @@ -314,10 +461,8 @@ pub struct CrateTypes<'a> { pub struct TypeResolver<'mod_lifetime, 'crate_lft: 'mod_lifetime> { pub orig_crate: &'mod_lifetime str, pub module_path: &'mod_lifetime str, - imports: HashMap, - // ident -> is-mirrored-enum - declared: HashMap>, pub crate_types: &'mod_lifetime mut CrateTypes<'crate_lft>, + types: ImportResolver<'mod_lifetime, 'crate_lft>, } /// Returned by write_empty_rust_val_check_suffix to indicate what type of dereferencing needs to @@ -333,23 +478,7 @@ enum EmptyValExpectedTy { impl<'a, 'c: 'a> TypeResolver<'a, 'c> { pub fn new(orig_crate: &'a str, module_path: &'a str, crate_types: &'a mut CrateTypes<'c>) -> Self { - let mut imports = HashMap::new(); - // Add primitives to the "imports" list: - imports.insert(syn::Ident::new("bool", Span::call_site()), "bool".to_string()); - imports.insert(syn::Ident::new("u64", Span::call_site()), "u64".to_string()); - imports.insert(syn::Ident::new("u32", Span::call_site()), "u32".to_string()); - imports.insert(syn::Ident::new("u16", Span::call_site()), "u16".to_string()); - imports.insert(syn::Ident::new("u8", Span::call_site()), "u8".to_string()); - imports.insert(syn::Ident::new("usize", Span::call_site()), "usize".to_string()); - imports.insert(syn::Ident::new("str", Span::call_site()), "str".to_string()); - imports.insert(syn::Ident::new("String", Span::call_site()), "String".to_string()); - - // These are here to allow us to print native Rust types in trait fn impls even if we don't - // have C mappings: - imports.insert(syn::Ident::new("Result", Span::call_site()), "Result".to_string()); - imports.insert(syn::Ident::new("Vec", Span::call_site()), "Vec".to_string()); - imports.insert(syn::Ident::new("Option", Span::call_site()), "Option".to_string()); - Self { orig_crate, module_path, imports, declared: HashMap::new(), crate_types } + Self { orig_crate, module_path, types: ImportResolver::new(module_path), crate_types } } // ************************************************* @@ -856,68 +985,27 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // *** Type definition during main.rs processing *** // ************************************************* - fn process_use_intern(&mut self, w: &mut W, u: &syn::UseTree, partial_path: &str) { - match u { - syn::UseTree::Path(p) => { - let new_path = format!("{}::{}", partial_path, p.ident); - self.process_use_intern(w, &p.tree, &new_path); - }, - syn::UseTree::Name(n) => { - let full_path = format!("{}::{}", partial_path, n.ident); - self.imports.insert(n.ident.clone(), full_path); - }, - syn::UseTree::Group(g) => { - for i in g.items.iter() { - self.process_use_intern(w, i, partial_path); - } - }, - syn::UseTree::Rename(r) => { - let full_path = format!("{}::{}", partial_path, r.ident); - self.imports.insert(r.rename.clone(), full_path); - }, - syn::UseTree::Glob(_) => { - eprintln!("Ignoring * use for {} - this may result in resolution failures", partial_path); - }, - } - } pub fn process_use(&mut self, w: &mut W, u: &syn::ItemUse) { - if let syn::Visibility::Public(_) = u.vis { - // We actually only use these for #[cfg(fuzztarget)] - eprintln!("Ignoring pub(use) tree!"); - return; - } - if u.leading_colon.is_some() { eprintln!("Ignoring leading-colon use!"); return; } - match &u.tree { - syn::UseTree::Path(p) => { - let new_path = format!("{}", p.ident); - self.process_use_intern(w, &p.tree, &new_path); - }, - syn::UseTree::Name(n) => { - let full_path = format!("{}", n.ident); - self.imports.insert(n.ident.clone(), full_path); - }, - _ => unimplemented!(), - } + self.types.process_use(u); } pub fn mirrored_enum_declared(&mut self, ident: &syn::Ident) { - self.declared.insert(ident.clone(), DeclType::MirroredEnum); + self.types.mirrored_enum_declared(ident); } pub fn enum_ignored(&mut self, ident: &'c syn::Ident) { - self.declared.insert(ident.clone(), DeclType::EnumIgnored); + self.types.enum_ignored(ident); } pub fn struct_imported(&mut self, ident: &'c syn::Ident) { - self.declared.insert(ident.clone(), DeclType::StructImported); + self.types.struct_imported(ident); } pub fn struct_ignored(&mut self, ident: &syn::Ident) { - eprintln!("Not importing {}", ident); - self.declared.insert(ident.clone(), DeclType::StructIgnored); + self.types.struct_ignored(ident); } pub fn trait_declared(&mut self, ident: &syn::Ident, t: &'c syn::ItemTrait) { - self.declared.insert(ident.clone(), DeclType::Trait(t)); + self.types.trait_declared(ident, t); } pub fn get_declared_type(&'a self, ident: &syn::Ident) -> Option<&'a DeclType<'c>> { - self.declared.get(ident) + self.types.get_declared_type(ident) } /// Returns true if the object at the given path is mapped as X { inner: *mut origX, .. }. pub fn c_type_has_inner_from_path(&self, full_path: &str) -> bool{ @@ -925,55 +1013,15 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { } pub fn maybe_resolve_ident(&self, id: &syn::Ident) -> Option { - if let Some(imp) = self.imports.get(id) { - Some(imp.clone()) - } else if self.declared.get(id).is_some() { - Some(self.module_path.to_string() + "::" + &format!("{}", id)) - } else { None } + self.types.maybe_resolve_ident(id) } pub fn maybe_resolve_non_ignored_ident(&self, id: &syn::Ident) -> Option { - if let Some(imp) = self.imports.get(id) { - Some(imp.clone()) - } else if let Some(decl_type) = self.declared.get(id) { - match decl_type { - DeclType::StructIgnored => None, - _ => Some(self.module_path.to_string() + "::" + &format!("{}", id)), - } - } else { None } + self.types.maybe_resolve_non_ignored_ident(id) } pub fn maybe_resolve_path(&self, p_arg: &syn::Path, generics: Option<&GenericTypes>) -> Option { - let p = if let Some(gen_types) = generics { - if let Some((_, synpath)) = gen_types.maybe_resolve_path(p_arg) { - synpath - } else { p_arg } - } else { p_arg }; - - if p.leading_colon.is_some() { - Some(p.segments.iter().enumerate().map(|(idx, seg)| { - format!("{}{}", if idx == 0 { "" } else { "::" }, seg.ident) - }).collect()) - } else if let Some(id) = p.get_ident() { - self.maybe_resolve_ident(id) - } else { - if p.segments.len() == 1 { - let seg = p.segments.iter().next().unwrap(); - return self.maybe_resolve_ident(&seg.ident); - } - let mut seg_iter = p.segments.iter(); - let first_seg = seg_iter.next().unwrap(); - let remaining: String = seg_iter.map(|seg| { - format!("::{}", seg.ident) - }).collect(); - if let Some(imp) = self.imports.get(&first_seg.ident) { - if remaining != "" { - Some(imp.clone() + &remaining) - } else { - Some(imp.clone()) - } - } else { None } - } + self.types.maybe_resolve_path(p_arg, generics) } pub fn resolve_path(&self, p: &syn::Path, generics: Option<&GenericTypes>) -> String { self.maybe_resolve_path(p, generics).unwrap() @@ -1263,10 +1311,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { } else if let Some(t) = self.crate_types.traits.get(&resolved_path) { decl_lookup(w, &DeclType::Trait(t), &resolved_path, is_ref, is_mut); } else if let Some(ident) = single_ident_generic_path_to_ident(&p.path) { - if let Some(_) = self.imports.get(ident) { - // crate_types lookup has to have succeeded: - panic!("Failed to print inline conversion for {}", ident); - } else if let Some(decl_type) = self.declared.get(ident) { + if let Some(decl_type) = self.types.maybe_resolve_declared(ident) { decl_lookup(w, decl_type, &self.maybe_resolve_ident(ident).unwrap(), is_ref, is_mut); } else { unimplemented!(); } } else { unimplemented!(); } @@ -1591,7 +1636,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if let Some((prefix, suffix)) = path_lookup(&resolved_path, is_ref) { write!(w, "let mut local_{} = {}{}{};", ident, prefix, var, suffix).unwrap(); true - } else if self.declared.get(ty_ident).is_some() { + } else if self.types.maybe_resolve_declared(ty_ident).is_some() { false } else { false } } else { false } From 494e0fd8a01dc0b7dfa61f14782805dd7da92395 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 8 Feb 2021 21:09:48 -0500 Subject: [PATCH 06/16] [bindings] Track all declared types in ImportResolver construction This allows an ImportResolver to handle more than imports, allowing ident resolution of objects constructed in the same module. --- c-bindings-gen/src/main.rs | 70 +----------------- c-bindings-gen/src/types.rs | 144 ++++++++++++++++++++---------------- 2 files changed, 84 insertions(+), 130 deletions(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index f8475bbdcf9..07948ed42fa 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -517,7 +517,6 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty writeln!(w, "\t\t}}\n\t}}\n}}").unwrap(); write_cpp_wrapper(cpp_headers, &trait_name, true); - types.trait_declared(&t.ident, t); } /// Write out a simple "opaque" type (eg structs) which contain a pointer to the native Rust type @@ -557,26 +556,11 @@ fn writeln_opaque(w: &mut W, ident: &syn::Ident, struct_name: write_cpp_wrapper(cpp_headers, &format!("{}", ident), true); } -fn declare_struct<'a, 'b>(s: &'a syn::ItemStruct, types: &mut TypeResolver<'b, 'a>) -> bool { - let export = export_status(&s.attrs); - match export { - ExportStatus::Export => {}, - ExportStatus::TestOnly => return false, - ExportStatus::NoExport => { - types.struct_ignored(&s.ident); - return false; - } - } - - types.struct_imported(&s.ident); - true -} - /// Writes out all the relevant mappings for a Rust struct, deferring to writeln_opaque to generate /// the struct itself, and then writing getters and setters for public, understood-type fields and /// a constructor if every field is public. fn writeln_struct<'a, 'b, W: std::io::Write>(w: &mut W, s: &'a syn::ItemStruct, types: &mut TypeResolver<'b, 'a>, extra_headers: &mut File, cpp_headers: &mut File) { - if !declare_struct(s, types) { return; } + if export_status(&s.attrs) != ExportStatus::Export { return; } let struct_name = &format!("{}", s.ident); writeln_opaque(w, &s.ident, struct_name, &s.generics, &s.attrs, types, extra_headers, cpp_headers); @@ -998,37 +982,6 @@ fn writeln_impl(w: &mut W, i: &syn::ItemImpl, types: &mut Typ } } -/// Returns true if the enum will be mapped as an opaue (ie struct with a pointer to the underlying -/// type), otherwise it is mapped into a transparent, C-compatible version of itself. -fn is_enum_opaque(e: &syn::ItemEnum) -> bool { - for var in e.variants.iter() { - if let syn::Fields::Unit = var.fields { - } else if let syn::Fields::Named(fields) = &var.fields { - for field in fields.named.iter() { - match export_status(&field.attrs) { - ExportStatus::Export|ExportStatus::TestOnly => {}, - ExportStatus::NoExport => return true, - } - } - } else { - return true; - } - } - false -} - -fn declare_enum<'a, 'b>(e: &'a syn::ItemEnum, types: &mut TypeResolver<'b, 'a>) { - match export_status(&e.attrs) { - ExportStatus::Export => {}, - ExportStatus::NoExport|ExportStatus::TestOnly => return, - } - - if is_enum_opaque(e) { - types.enum_ignored(&e.ident); - } else { - types.mirrored_enum_declared(&e.ident); - } -} /// Print a mapping of an enum. If all of the enum's fields are C-mapped in some form (or the enum /// is unitary), we generate an equivalent enum with all types replaced with their C mapped @@ -1274,25 +1227,8 @@ fn convert_file<'a, 'b>(libast: &'a FullLibraryAST, crate_types: &mut CrateTypes eprintln!("Converting {} entries...", module); - let mut type_resolver = TypeResolver::new(orig_crate, module, crate_types); - - // First pass over the items and fill in imports and file-declared objects in the type resolver - for item in items.iter() { - match item { - syn::Item::Use(u) => type_resolver.process_use(&mut out, &u), - syn::Item::Struct(s) => { - if let syn::Visibility::Public(_) = s.vis { - declare_struct(&s, &mut type_resolver); - } - }, - syn::Item::Enum(e) => { - if let syn::Visibility::Public(_) = e.vis { - declare_enum(&e, &mut type_resolver); - } - }, - _ => {}, - } - } + let import_resolver = ImportResolver::new(module, items); + let mut type_resolver = TypeResolver::new(orig_crate, module, import_resolver, crate_types); for item in items.iter() { match item { diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 7e0099cfc47..46973e0b17c 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -110,6 +110,25 @@ pub fn assert_simple_bound(bound: &syn::TraitBound) { if let syn::TraitBoundModifier::Maybe(_) = bound.modifier { unimplemented!(); } } +/// Returns true if the enum will be mapped as an opaue (ie struct with a pointer to the underlying +/// type), otherwise it is mapped into a transparent, C-compatible version of itself. +pub fn is_enum_opaque(e: &syn::ItemEnum) -> bool { + for var in e.variants.iter() { + if let syn::Fields::Unit = var.fields { + } else if let syn::Fields::Named(fields) = &var.fields { + for field in fields.named.iter() { + match export_status(&field.attrs) { + ExportStatus::Export|ExportStatus::TestOnly => {}, + ExportStatus::NoExport => return true, + } + } + } else { + return true; + } + } + false +} + /// A stack of sets of generic resolutions. /// /// This tracks the template parameters for a function, struct, or trait, allowing resolution into @@ -285,44 +304,24 @@ pub struct ImportResolver<'mod_lifetime, 'crate_lft: 'mod_lifetime> { declared: HashMap>, } impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'crate_lft> { - pub fn new(module_path: &'mod_lifetime str) -> Self { - let mut imports = HashMap::new(); - // Add primitives to the "imports" list: - imports.insert(syn::Ident::new("bool", Span::call_site()), "bool".to_string()); - imports.insert(syn::Ident::new("u64", Span::call_site()), "u64".to_string()); - imports.insert(syn::Ident::new("u32", Span::call_site()), "u32".to_string()); - imports.insert(syn::Ident::new("u16", Span::call_site()), "u16".to_string()); - imports.insert(syn::Ident::new("u8", Span::call_site()), "u8".to_string()); - imports.insert(syn::Ident::new("usize", Span::call_site()), "usize".to_string()); - imports.insert(syn::Ident::new("str", Span::call_site()), "str".to_string()); - imports.insert(syn::Ident::new("String", Span::call_site()), "String".to_string()); - - // These are here to allow us to print native Rust types in trait fn impls even if we don't - // have C mappings: - imports.insert(syn::Ident::new("Result", Span::call_site()), "Result".to_string()); - imports.insert(syn::Ident::new("Vec", Span::call_site()), "Vec".to_string()); - imports.insert(syn::Ident::new("Option", Span::call_site()), "Option".to_string()); - Self { module_path, imports, declared: HashMap::new() } - } - - fn process_use_intern(&mut self, u: &syn::UseTree, partial_path: &str) { + fn process_use_intern(imports: &mut HashMap, u: &syn::UseTree, partial_path: &str) { match u { syn::UseTree::Path(p) => { let new_path = format!("{}::{}", partial_path, p.ident); - self.process_use_intern(&p.tree, &new_path); + Self::process_use_intern(imports, &p.tree, &new_path); }, syn::UseTree::Name(n) => { let full_path = format!("{}::{}", partial_path, n.ident); - self.imports.insert(n.ident.clone(), full_path); + imports.insert(n.ident.clone(), full_path); }, syn::UseTree::Group(g) => { for i in g.items.iter() { - self.process_use_intern(i, partial_path); + Self::process_use_intern(imports, i, partial_path); } }, syn::UseTree::Rename(r) => { let full_path = format!("{}::{}", partial_path, r.ident); - self.imports.insert(r.rename.clone(), full_path); + imports.insert(r.rename.clone(), full_path); }, syn::UseTree::Glob(_) => { eprintln!("Ignoring * use for {} - this may result in resolution failures", partial_path); @@ -330,7 +329,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } } - pub fn process_use(&mut self, u: &syn::ItemUse) { + pub fn process_use(imports: &mut HashMap, u: &syn::ItemUse) { if let syn::Visibility::Public(_) = u.vis { // We actually only use these for #[cfg(fuzztarget)] eprintln!("Ignoring pub(use) tree!"); @@ -340,31 +339,69 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr match &u.tree { syn::UseTree::Path(p) => { let new_path = format!("{}", p.ident); - self.process_use_intern(&p.tree, &new_path); + Self::process_use_intern(imports, &p.tree, &new_path); }, syn::UseTree::Name(n) => { let full_path = format!("{}", n.ident); - self.imports.insert(n.ident.clone(), full_path); + imports.insert(n.ident.clone(), full_path); }, _ => unimplemented!(), } } - pub fn mirrored_enum_declared(&mut self, ident: &syn::Ident) { - self.declared.insert(ident.clone(), DeclType::MirroredEnum); - } - pub fn enum_ignored(&mut self, ident: &'crate_lft syn::Ident) { - self.declared.insert(ident.clone(), DeclType::EnumIgnored); - } - pub fn struct_imported(&mut self, ident: &'crate_lft syn::Ident) { - self.declared.insert(ident.clone(), DeclType::StructImported); - } - pub fn struct_ignored(&mut self, ident: &syn::Ident) { - self.declared.insert(ident.clone(), DeclType::StructIgnored); - } - pub fn trait_declared(&mut self, ident: &syn::Ident, t: &'crate_lft syn::ItemTrait) { - self.declared.insert(ident.clone(), DeclType::Trait(t)); + pub fn new(module_path: &'mod_lifetime str, contents: &'crate_lft [syn::Item]) -> Self { + let mut imports = HashMap::new(); + // Add primitives to the "imports" list: + imports.insert(syn::Ident::new("bool", Span::call_site()), "bool".to_string()); + imports.insert(syn::Ident::new("u64", Span::call_site()), "u64".to_string()); + imports.insert(syn::Ident::new("u32", Span::call_site()), "u32".to_string()); + imports.insert(syn::Ident::new("u16", Span::call_site()), "u16".to_string()); + imports.insert(syn::Ident::new("u8", Span::call_site()), "u8".to_string()); + imports.insert(syn::Ident::new("usize", Span::call_site()), "usize".to_string()); + imports.insert(syn::Ident::new("str", Span::call_site()), "str".to_string()); + imports.insert(syn::Ident::new("String", Span::call_site()), "String".to_string()); + + // These are here to allow us to print native Rust types in trait fn impls even if we don't + // have C mappings: + imports.insert(syn::Ident::new("Result", Span::call_site()), "Result".to_string()); + imports.insert(syn::Ident::new("Vec", Span::call_site()), "Vec".to_string()); + imports.insert(syn::Ident::new("Option", Span::call_site()), "Option".to_string()); + + let mut declared = HashMap::new(); + + for item in contents.iter() { + match item { + syn::Item::Use(u) => Self::process_use(&mut imports, &u), + syn::Item::Struct(s) => { + if let syn::Visibility::Public(_) = s.vis { + match export_status(&s.attrs) { + ExportStatus::Export => { declared.insert(s.ident.clone(), DeclType::StructImported); }, + ExportStatus::NoExport => { declared.insert(s.ident.clone(), DeclType::StructIgnored); }, + ExportStatus::TestOnly => continue, + } + } + }, + syn::Item::Enum(e) => { + if let syn::Visibility::Public(_) = e.vis { + match export_status(&e.attrs) { + ExportStatus::Export if is_enum_opaque(e) => { declared.insert(e.ident.clone(), DeclType::EnumIgnored); }, + ExportStatus::Export => { declared.insert(e.ident.clone(), DeclType::MirroredEnum); }, + _ => continue, + } + } + }, + syn::Item::Trait(t) if export_status(&t.attrs) == ExportStatus::Export => { + if let syn::Visibility::Public(_) = t.vis { + declared.insert(t.ident.clone(), DeclType::Trait(t)); + } + }, + _ => {}, + } + } + + Self { module_path, imports, declared } } + pub fn get_declared_type(&self, ident: &syn::Ident) -> Option<&DeclType<'crate_lft>> { self.declared.get(ident) } @@ -477,8 +514,8 @@ enum EmptyValExpectedTy { } impl<'a, 'c: 'a> TypeResolver<'a, 'c> { - pub fn new(orig_crate: &'a str, module_path: &'a str, crate_types: &'a mut CrateTypes<'c>) -> Self { - Self { orig_crate, module_path, types: ImportResolver::new(module_path), crate_types } + pub fn new(orig_crate: &'a str, module_path: &'a str, types: ImportResolver<'a, 'c>, crate_types: &'a mut CrateTypes<'c>) -> Self { + Self { orig_crate, module_path, types, crate_types } } // ************************************************* @@ -985,25 +1022,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // *** Type definition during main.rs processing *** // ************************************************* - pub fn process_use(&mut self, w: &mut W, u: &syn::ItemUse) { - self.types.process_use(u); - } - - pub fn mirrored_enum_declared(&mut self, ident: &syn::Ident) { - self.types.mirrored_enum_declared(ident); - } - pub fn enum_ignored(&mut self, ident: &'c syn::Ident) { - self.types.enum_ignored(ident); - } - pub fn struct_imported(&mut self, ident: &'c syn::Ident) { - self.types.struct_imported(ident); - } - pub fn struct_ignored(&mut self, ident: &syn::Ident) { - self.types.struct_ignored(ident); - } - pub fn trait_declared(&mut self, ident: &syn::Ident, t: &'c syn::ItemTrait) { - self.types.trait_declared(ident, t); - } pub fn get_declared_type(&'a self, ident: &syn::Ident) -> Option<&'a DeclType<'c>> { self.types.get_declared_type(ident) } From 3bbecbef21ec3bf3f4f665128cbf254d85374e6e Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 8 Feb 2021 22:19:48 -0500 Subject: [PATCH 07/16] [bindings] Use new ImportResolver during first AST pass This removes some redundant logic and ensures we handle more import-resolution cases in both contexts. --- c-bindings-gen/src/main.rs | 61 ++--------------------- c-bindings-gen/src/types.rs | 96 +++++++++++++++++++++++-------------- 2 files changed, 66 insertions(+), 91 deletions(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 07948ed42fa..198e0cfdd39 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -1306,64 +1306,15 @@ fn convert_file<'a, 'b>(libast: &'a FullLibraryAST, crate_types: &mut CrateTypes } } -/// Insert ident -> absolute Path resolutions into imports from the given UseTree and path-prefix. -fn process_use_intern<'a>(u: &'a syn::UseTree, mut path: syn::punctuated::Punctuated, imports: &mut HashMap<&'a syn::Ident, syn::Path>) { - match u { - syn::UseTree::Path(p) => { - path.push(syn::PathSegment { ident: p.ident.clone(), arguments: syn::PathArguments::None }); - process_use_intern(&p.tree, path, imports); - }, - syn::UseTree::Name(n) => { - path.push(syn::PathSegment { ident: n.ident.clone(), arguments: syn::PathArguments::None }); - imports.insert(&n.ident, syn::Path { leading_colon: Some(syn::Token![::](Span::call_site())), segments: path }); - }, - syn::UseTree::Group(g) => { - for i in g.items.iter() { - process_use_intern(i, path.clone(), imports); - } - }, - _ => {} - } -} - -/// Map all the Paths in a Type into absolute paths given a set of imports (generated via process_use_intern) -fn resolve_imported_refs(imports: &HashMap<&syn::Ident, syn::Path>, mut ty: syn::Type) -> syn::Type { - match &mut ty { - syn::Type::Path(p) => { - if let Some(ident) = p.path.get_ident() { - if let Some(newpath) = imports.get(ident) { - p.path = newpath.clone(); - } - } else { unimplemented!(); } - }, - syn::Type::Reference(r) => { - r.elem = Box::new(resolve_imported_refs(imports, (*r.elem).clone())); - }, - syn::Type::Slice(s) => { - s.elem = Box::new(resolve_imported_refs(imports, (*s.elem).clone())); - }, - syn::Type::Tuple(t) => { - for e in t.elems.iter_mut() { - *e = resolve_imported_refs(imports, e.clone()); - } - }, - _ => unimplemented!(), - } - ty -} - /// Walk the FullLibraryAST, deciding how things will be mapped and adding tracking to CrateTypes. fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a>) { for (module, astmod) in ast_storage.modules.iter() { let ASTModule { ref attrs, ref items, submods: _ } = astmod; assert_eq!(export_status(&attrs), ExportStatus::Export); - let mut import_maps = HashMap::new(); + let import_resolver = ImportResolver::new(module, items); for item in items.iter() { match item { - syn::Item::Use(u) => { - process_use_intern(&u.tree, syn::punctuated::Punctuated::new(), &mut import_maps); - }, syn::Item::Struct(s) => { if let syn::Visibility::Public(_) = s.vis { match export_status(&s.attrs) { @@ -1409,7 +1360,7 @@ fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a crate_types.opaques.insert(type_path, &t.ident); }, _ => { - crate_types.type_aliases.insert(type_path, resolve_imported_refs(&import_maps, (*t.ty).clone())); + crate_types.type_aliases.insert(type_path, import_resolver.resolve_imported_refs((*t.ty).clone())); } } } @@ -1439,11 +1390,9 @@ fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a if let &syn::Type::Path(ref p) = &*i.self_ty { if let Some(trait_path) = i.trait_.as_ref() { if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) { - // Note, we should probably have more full-featured type resolution here, - // but for now we don't have any cases where we impl X for A::B. - let ident = single_ident_generic_path_to_ident(&p.path).expect("impl X for A::B currently unsupported"); - assert!(import_maps.get(&ident).is_none()); - crate_types.clonable_types.insert(format!("crate::{}::{}", module, ident)); + if let Some(full_path) = import_resolver.maybe_resolve_path(&p.path, None) { + crate_types.clonable_types.insert("crate::".to_owned() + &full_path); + } } } } diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 46973e0b17c..cba9407ae12 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -300,28 +300,31 @@ pub enum DeclType<'a> { pub struct ImportResolver<'mod_lifetime, 'crate_lft: 'mod_lifetime> { module_path: &'mod_lifetime str, - imports: HashMap, + imports: HashMap, declared: HashMap>, } impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'crate_lft> { - fn process_use_intern(imports: &mut HashMap, u: &syn::UseTree, partial_path: &str) { + fn process_use_intern(imports: &mut HashMap, u: &syn::UseTree, partial_path: &str, mut path: syn::punctuated::Punctuated) { match u { syn::UseTree::Path(p) => { - let new_path = format!("{}::{}", partial_path, p.ident); - Self::process_use_intern(imports, &p.tree, &new_path); + let new_path = format!("{}{}::", partial_path, p.ident); + path.push(syn::PathSegment { ident: p.ident.clone(), arguments: syn::PathArguments::None }); + Self::process_use_intern(imports, &p.tree, &new_path, path); }, syn::UseTree::Name(n) => { - let full_path = format!("{}::{}", partial_path, n.ident); - imports.insert(n.ident.clone(), full_path); + let full_path = format!("{}{}", partial_path, n.ident); + path.push(syn::PathSegment { ident: n.ident.clone(), arguments: syn::PathArguments::None }); + imports.insert(n.ident.clone(), (full_path, syn::Path { leading_colon: Some(syn::Token![::](Span::call_site())), segments: path })); }, syn::UseTree::Group(g) => { for i in g.items.iter() { - Self::process_use_intern(imports, i, partial_path); + Self::process_use_intern(imports, i, partial_path, path.clone()); } }, syn::UseTree::Rename(r) => { - let full_path = format!("{}::{}", partial_path, r.ident); - imports.insert(r.rename.clone(), full_path); + let full_path = format!("{}{}", partial_path, r.ident); + path.push(syn::PathSegment { ident: r.ident.clone(), arguments: syn::PathArguments::None }); + imports.insert(r.rename.clone(), (full_path, syn::Path { leading_colon: Some(syn::Token![::](Span::call_site())), segments: path })); }, syn::UseTree::Glob(_) => { eprintln!("Ignoring * use for {} - this may result in resolution failures", partial_path); @@ -329,43 +332,40 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } } - pub fn process_use(imports: &mut HashMap, u: &syn::ItemUse) { + fn process_use(imports: &mut HashMap, u: &syn::ItemUse) { if let syn::Visibility::Public(_) = u.vis { // We actually only use these for #[cfg(fuzztarget)] eprintln!("Ignoring pub(use) tree!"); return; } if u.leading_colon.is_some() { eprintln!("Ignoring leading-colon use!"); return; } - match &u.tree { - syn::UseTree::Path(p) => { - let new_path = format!("{}", p.ident); - Self::process_use_intern(imports, &p.tree, &new_path); - }, - syn::UseTree::Name(n) => { - let full_path = format!("{}", n.ident); - imports.insert(n.ident.clone(), full_path); - }, - _ => unimplemented!(), - } + Self::process_use_intern(imports, &u.tree, "", syn::punctuated::Punctuated::new()); + } + + fn insert_primitive(imports: &mut HashMap, id: &str) { + let ident = syn::Ident::new(id, Span::call_site()); + let mut path = syn::punctuated::Punctuated::new(); + path.push(syn::PathSegment { ident: ident.clone(), arguments: syn::PathArguments::None }); + imports.insert(ident, (id.to_owned(), syn::Path { leading_colon: Some(syn::Token![::](Span::call_site())), segments: path })); } pub fn new(module_path: &'mod_lifetime str, contents: &'crate_lft [syn::Item]) -> Self { let mut imports = HashMap::new(); // Add primitives to the "imports" list: - imports.insert(syn::Ident::new("bool", Span::call_site()), "bool".to_string()); - imports.insert(syn::Ident::new("u64", Span::call_site()), "u64".to_string()); - imports.insert(syn::Ident::new("u32", Span::call_site()), "u32".to_string()); - imports.insert(syn::Ident::new("u16", Span::call_site()), "u16".to_string()); - imports.insert(syn::Ident::new("u8", Span::call_site()), "u8".to_string()); - imports.insert(syn::Ident::new("usize", Span::call_site()), "usize".to_string()); - imports.insert(syn::Ident::new("str", Span::call_site()), "str".to_string()); - imports.insert(syn::Ident::new("String", Span::call_site()), "String".to_string()); + Self::insert_primitive(&mut imports, "bool"); + Self::insert_primitive(&mut imports, "u64"); + Self::insert_primitive(&mut imports, "u32"); + Self::insert_primitive(&mut imports, "u16"); + Self::insert_primitive(&mut imports, "u8"); + Self::insert_primitive(&mut imports, "usize"); + Self::insert_primitive(&mut imports, "str"); + Self::insert_primitive(&mut imports, "String"); // These are here to allow us to print native Rust types in trait fn impls even if we don't // have C mappings: - imports.insert(syn::Ident::new("Result", Span::call_site()), "Result".to_string()); - imports.insert(syn::Ident::new("Vec", Span::call_site()), "Vec".to_string()); - imports.insert(syn::Ident::new("Option", Span::call_site()), "Option".to_string()); + Self::insert_primitive(&mut imports, "Result"); + Self::insert_primitive(&mut imports, "Vec"); + Self::insert_primitive(&mut imports, "Option"); let mut declared = HashMap::new(); @@ -411,7 +411,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } pub fn maybe_resolve_ident(&self, id: &syn::Ident) -> Option { - if let Some(imp) = self.imports.get(id) { + if let Some((imp, _)) = self.imports.get(id) { Some(imp.clone()) } else if self.declared.get(id).is_some() { Some(self.module_path.to_string() + "::" + &format!("{}", id)) @@ -419,7 +419,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } pub fn maybe_resolve_non_ignored_ident(&self, id: &syn::Ident) -> Option { - if let Some(imp) = self.imports.get(id) { + if let Some((imp, _)) = self.imports.get(id) { Some(imp.clone()) } else if let Some(decl_type) = self.declared.get(id) { match decl_type { @@ -452,7 +452,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr let remaining: String = seg_iter.map(|seg| { format!("::{}", seg.ident) }).collect(); - if let Some(imp) = self.imports.get(&first_seg.ident) { + if let Some((imp, _)) = self.imports.get(&first_seg.ident) { if remaining != "" { Some(imp.clone() + &remaining) } else { @@ -461,6 +461,32 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } else { None } } } + + /// Map all the Paths in a Type into absolute paths given a set of imports (generated via process_use_intern) + pub fn resolve_imported_refs(&self, mut ty: syn::Type) -> syn::Type { + match &mut ty { + syn::Type::Path(p) => { + if let Some(ident) = p.path.get_ident() { + if let Some((_, newpath)) = self.imports.get(ident) { + p.path = newpath.clone(); + } + } else { unimplemented!(); } + }, + syn::Type::Reference(r) => { + r.elem = Box::new(self.resolve_imported_refs((*r.elem).clone())); + }, + syn::Type::Slice(s) => { + s.elem = Box::new(self.resolve_imported_refs((*s.elem).clone())); + }, + syn::Type::Tuple(t) => { + for e in t.elems.iter_mut() { + *e = self.resolve_imported_refs(e.clone()); + } + }, + _ => unimplemented!(), + } + ty + } } // templates_defined is walked to write the C++ header, so if we use the default hashing it get From 61f5e79062d3ff3a1c12923530183910a30702d9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 10:23:41 -0500 Subject: [PATCH 08/16] Drop a useless import and use `Self` in return values in Features `Result` is in the standard prelude, so no need to ever use it. Sadly, returning a Features in the `impl Futures {}` block will confuse our new alias-impl-printing logic, as we end up running through the normal impl-block-printing logic as if we had an explicit `impl ConcreteFeatures` block. --- lightning/src/ln/features.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 3ce3d4fa7e6..c97e18100fc 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -26,7 +26,6 @@ //! [`Context`]: sealed/trait.Context.html use std::{cmp, fmt}; -use std::result::Result; use std::marker::PhantomData; use ln::msgs::DecodeError; @@ -352,7 +351,7 @@ impl InitFeatures { impl Features { /// Create a blank Features with no features set - pub fn empty() -> Features { + pub fn empty() -> Self { Features { flags: Vec::new(), mark: PhantomData, @@ -362,7 +361,7 @@ impl Features { /// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. /// /// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS - pub fn known() -> Features { + pub fn known() -> Self { Self { flags: T::KNOWN_FEATURE_FLAGS.to_vec(), mark: PhantomData, From b49781e8d81dc400033c1ea6660f06eda9a87347 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 11:34:16 -0500 Subject: [PATCH 09/16] [bindings] Allow resolution of private types in some cases We need this specifically for resolving the features::sealed::Context trait which is inside the non-pub `sealed` module. --- c-bindings-gen/src/main.rs | 3 +++ c-bindings-gen/src/types.rs | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 198e0cfdd39..f8e5b48492f 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -1165,9 +1165,12 @@ impl FullLibraryAST { }; self.load_module(modname, m.attrs, m.content.unwrap().1); submods.push(modident); + } else { + non_mod_items.push(syn::Item::Mod(m)); } } }, + syn::Item::Mod(_) => panic!("--pretty=expanded output should never have non-body modules"), _ => { non_mod_items.push(item); } } } diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index cba9407ae12..afe719ffe2c 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -302,6 +302,7 @@ pub struct ImportResolver<'mod_lifetime, 'crate_lft: 'mod_lifetime> { module_path: &'mod_lifetime str, imports: HashMap, declared: HashMap>, + priv_modules: HashSet, } impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'crate_lft> { fn process_use_intern(imports: &mut HashMap, u: &syn::UseTree, partial_path: &str, mut path: syn::punctuated::Punctuated) { @@ -368,6 +369,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr Self::insert_primitive(&mut imports, "Option"); let mut declared = HashMap::new(); + let mut priv_modules = HashSet::new(); for item in contents.iter() { match item { @@ -395,11 +397,14 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr declared.insert(t.ident.clone(), DeclType::Trait(t)); } }, + syn::Item::Mod(m) => { + priv_modules.insert(m.ident.clone()); + }, _ => {}, } } - Self { module_path, imports, declared } + Self { module_path, imports, declared, priv_modules } } pub fn get_declared_type(&self, ident: &syn::Ident) -> Option<&DeclType<'crate_lft>> { @@ -458,6 +463,8 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } else { Some(imp.clone()) } + } else if let Some(_) = self.priv_modules.get(&first_seg.ident) { + Some(format!("{}::{}{}", self.module_path, first_seg.ident, remaining)) } else { None } } } From f3ce70660dfeb2e772b5a8285298e5e897a17e6f Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 11:38:31 -0500 Subject: [PATCH 10/16] [bindings] Track structs impling traits, incl priv traits --- c-bindings-gen/src/main.rs | 35 ++++++++++++++++++++++++++++++++++- c-bindings-gen/src/types.rs | 2 ++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index f8e5b48492f..6eac851f1b6 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -1309,6 +1309,30 @@ fn convert_file<'a, 'b>(libast: &'a FullLibraryAST, crate_types: &mut CrateTypes } } +fn walk_private_mod<'a>(module: String, items: &'a syn::ItemMod, crate_types: &mut CrateTypes<'a>) { + let import_resolver = ImportResolver::new(&module, &items.content.as_ref().unwrap().1); + for item in items.content.as_ref().unwrap().1.iter() { + match item { + syn::Item::Mod(m) => walk_private_mod(format!("{}::{}", module, m.ident), m, crate_types), + syn::Item::Impl(i) => { + if let &syn::Type::Path(ref p) = &*i.self_ty { + if let Some(trait_path) = i.trait_.as_ref() { + if let Some(tp) = import_resolver.maybe_resolve_path(&trait_path.1, None) { + if let Some(sp) = import_resolver.maybe_resolve_path(&p.path, None) { + match crate_types.trait_impls.entry(sp) { + hash_map::Entry::Occupied(mut e) => { e.get_mut().push(tp); }, + hash_map::Entry::Vacant(e) => { e.insert(vec![tp]); }, + } + } + } + } + } + }, + _ => {}, + } + } +} + /// Walk the FullLibraryAST, deciding how things will be mapped and adding tracking to CrateTypes. fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a>) { for (module, astmod) in ast_storage.modules.iter() { @@ -1397,9 +1421,18 @@ fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a crate_types.clonable_types.insert("crate::".to_owned() + &full_path); } } + if let Some(tp) = import_resolver.maybe_resolve_path(&trait_path.1, None) { + if let Some(sp) = import_resolver.maybe_resolve_path(&p.path, None) { + match crate_types.trait_impls.entry(sp) { + hash_map::Entry::Occupied(mut e) => { e.get_mut().push(tp); }, + hash_map::Entry::Vacant(e) => { e.insert(vec![tp]); }, + } + } + } } } }, + syn::Item::Mod(m) => walk_private_mod(format!("{}::{}", module, m.ident), m, crate_types), _ => {}, } } @@ -1445,7 +1478,7 @@ fn main() { // when parsing other file ASTs... let mut libtypes = CrateTypes { traits: HashMap::new(), opaques: HashMap::new(), mirrored_enums: HashMap::new(), type_aliases: HashMap::new(), templates_defined: HashMap::default(), template_file: &mut derived_templates, - clonable_types: HashSet::new() }; + clonable_types: HashSet::new(), trait_impls: HashMap::new() }; walk_ast(&libast, &mut libtypes); // ... finally, do the actual file conversion/mapping, writing out types as we go. diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index afe719ffe2c..4f5e4612c61 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -524,6 +524,8 @@ pub struct CrateTypes<'a> { pub template_file: &'a mut File, /// Set of containers which are clonable pub clonable_types: HashSet, + /// Key impls Value + pub trait_impls: HashMap>, } /// A struct which tracks resolving rust types into C-mapped equivalents, exists for one specific From 842d2f6ce7da27ddc439501cf4025c9daaf6b0e8 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 11:39:21 -0500 Subject: [PATCH 11/16] [bindings] Resolve type aliases mapped as opaque types We already map type aliases which alias private types as opaque, but we don't resolve them like we would any other opaque type, preventing conversion printing or type use. --- c-bindings-gen/src/types.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 4f5e4612c61..ad9cd0497f9 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -383,6 +383,21 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } } }, + syn::Item::Type(t) if export_status(&t.attrs) == ExportStatus::Export => { + if let syn::Visibility::Public(_) = t.vis { + let mut process_alias = true; + for tok in t.generics.params.iter() { + if let syn::GenericParam::Lifetime(_) = tok {} + else { process_alias = false; } + } + if process_alias { + match &*t.ty { + syn::Type::Path(_) => { declared.insert(t.ident.clone(), DeclType::StructImported); }, + _ => {}, + } + } + } + }, syn::Item::Enum(e) => { if let syn::Visibility::Public(_) = e.vis { match export_status(&e.attrs) { From a387badfe87b6fa1c2f8f0ea488723c1fd5aa3e0 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 11:47:51 -0500 Subject: [PATCH 12/16] [bindings] Handle generic-ized impl blocks by concretizing them This handles, for example, the `impl for Features` blocks which are generic across a number of different contexts. We do so by walking the set of structs which alias Features and then walking their generic arguments to check that they meet the bounds specified in the impl block. For each alias which does, we create a dummy, explicit, `impl XFeatures` block with the same content as the original and recurse. --- c-bindings-gen/src/main.rs | 77 ++++++++++++++++++++++++++++++++++--- c-bindings-gen/src/types.rs | 2 + 2 files changed, 74 insertions(+), 5 deletions(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 6eac851f1b6..a93122daf83 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -10,7 +10,7 @@ //! It also generates relevant memory-management functions and free-standing functions with //! parameters mapped. -use std::collections::{HashMap, HashSet}; +use std::collections::{HashMap, hash_map, HashSet}; use std::env; use std::fs::File; use std::io::{Read, Write}; @@ -975,8 +975,62 @@ fn writeln_impl(w: &mut W, i: &syn::ItemImpl, types: &mut Typ } } } + } else if let Some(resolved_path) = types.maybe_resolve_ident(&ident) { + if let Some(aliases) = types.crate_types.reverse_alias_map.get(&resolved_path).cloned() { + 'alias_impls: for (alias, arguments) in aliases { + let alias_resolved = types.resolve_path(&alias, None); + for (idx, gen) in i.generics.params.iter().enumerate() { + match gen { + syn::GenericParam::Type(type_param) => { + 'bounds_check: for bound in type_param.bounds.iter() { + if let syn::TypeParamBound::Trait(trait_bound) = bound { + if let syn::PathArguments::AngleBracketed(ref t) = &arguments { + assert!(idx < t.args.len()); + if let syn::GenericArgument::Type(syn::Type::Path(p)) = &t.args[idx] { + let generic_arg = types.resolve_path(&p.path, None); + let generic_bound = types.resolve_path(&trait_bound.path, None); + if let Some(traits_impld) = types.crate_types.trait_impls.get(&generic_arg) { + for trait_impld in traits_impld { + if *trait_impld == generic_bound { continue 'bounds_check; } + } + eprintln!("struct {}'s generic arg {} didn't match bound {}", alias_resolved, generic_arg, generic_bound); + continue 'alias_impls; + } else { + eprintln!("struct {}'s generic arg {} didn't match bound {}", alias_resolved, generic_arg, generic_bound); + continue 'alias_impls; + } + } else { unimplemented!(); } + } else { unimplemented!(); } + } else { unimplemented!(); } + } + }, + syn::GenericParam::Lifetime(_) => {}, + syn::GenericParam::Const(_) => unimplemented!(), + } + } + let aliased_impl = syn::ItemImpl { + attrs: i.attrs.clone(), + brace_token: syn::token::Brace(Span::call_site()), + defaultness: None, + generics: syn::Generics { + lt_token: None, + params: syn::punctuated::Punctuated::new(), + gt_token: None, + where_clause: None, + }, + impl_token: syn::Token![impl](Span::call_site()), + items: i.items.clone(), + self_ty: Box::new(syn::Type::Path(syn::TypePath { qself: None, path: alias.clone() })), + trait_: i.trait_.clone(), + unsafety: None, + }; + writeln_impl(w, &aliased_impl, types); + } + } else { + eprintln!("Not implementing anything for {} due to it being marked not exported", ident); + } } else { - eprintln!("Not implementing anything for {} due to no-resolve (probably the type isn't pub or its marked not exported)", ident); + eprintln!("Not implementing anything for {} due to no-resolve (probably the type isn't pub)", ident); } } } @@ -1382,9 +1436,21 @@ fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a } if process_alias { match &*t.ty { - syn::Type::Path(_) => { + syn::Type::Path(p) => { // If its a path with no generics, assume we don't map the aliased type and map it opaque - crate_types.opaques.insert(type_path, &t.ident); + let mut segments = syn::punctuated::Punctuated::new(); + segments.push(syn::PathSegment { + ident: t.ident.clone(), + arguments: syn::PathArguments::None, + }); + let path_obj = syn::Path { leading_colon: None, segments }; + let args_obj = p.path.segments.last().unwrap().arguments.clone(); + match crate_types.reverse_alias_map.entry(import_resolver.maybe_resolve_path(&p.path, None).unwrap()) { + hash_map::Entry::Occupied(mut e) => { e.get_mut().push((path_obj, args_obj)); }, + hash_map::Entry::Vacant(e) => { e.insert(vec![(path_obj, args_obj)]); }, + } + + crate_types.opaques.insert(type_path.clone(), &t.ident); }, _ => { crate_types.type_aliases.insert(type_path, import_resolver.resolve_imported_refs((*t.ty).clone())); @@ -1477,7 +1543,8 @@ fn main() { // ...then walk the ASTs tracking what types we will map, and how, so that we can resolve them // when parsing other file ASTs... let mut libtypes = CrateTypes { traits: HashMap::new(), opaques: HashMap::new(), mirrored_enums: HashMap::new(), - type_aliases: HashMap::new(), templates_defined: HashMap::default(), template_file: &mut derived_templates, + type_aliases: HashMap::new(), reverse_alias_map: HashMap::new(), templates_defined: HashMap::default(), + template_file: &mut derived_templates, clonable_types: HashSet::new(), trait_impls: HashMap::new() }; walk_ast(&libast, &mut libtypes); diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index ad9cd0497f9..656ec13f96c 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -529,6 +529,8 @@ pub struct CrateTypes<'a> { pub traits: HashMap, /// Aliases from paths to some other Type pub type_aliases: HashMap, + /// Value is an alias to Key (maybe with some generics) + pub reverse_alias_map: HashMap>, /// Template continer types defined, map from mangled type name -> whether a destructor fn /// exists. /// From cdbe8333faf138876f391a1567b521f959e5a9fc Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 12:57:14 -0500 Subject: [PATCH 13/16] [bindings] Drop manual implementations of Features conversion We now handle features properly in our own resolution, and these appear to be self-inconsistent in some cases. --- c-bindings-gen/src/types.rs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 656ec13f96c..8c15b1258da 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -666,10 +666,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // Override the default since Records contain an fmt with a lifetime: "util::logger::Record" => Some("*const std::os::raw::c_char"), - // List of structs we map that aren't detected: - "ln::features::InitFeatures" if is_ref && ptr_for_ref => Some("crate::ln::features::InitFeatures"), - "ln::features::InitFeatures" if is_ref => Some("*const crate::ln::features::InitFeatures"), - "ln::features::InitFeatures" => Some("crate::ln::features::InitFeatures"), _ => None, } } @@ -729,9 +725,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "ln::channelmanager::PaymentPreimage" if is_ref => Some("&::lightning::ln::channelmanager::PaymentPreimage(unsafe { *"), "ln::channelmanager::PaymentSecret" => Some("::lightning::ln::channelmanager::PaymentSecret("), - // List of structs we map (possibly during processing of other files): - "ln::features::InitFeatures" if !is_ref => Some("*unsafe { Box::from_raw("), - // List of traits we map (possibly during processing of other files): "crate::util::logger::Logger" => Some(""), @@ -784,10 +777,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "ln::channelmanager::PaymentPreimage" if is_ref => Some(" })"), "ln::channelmanager::PaymentSecret" => Some(".data)"), - // List of structs we map (possibly during processing of other files): - "ln::features::InitFeatures" if is_ref => Some(".inner) }"), - "ln::features::InitFeatures" if !is_ref => Some(".take_inner()) }"), - // List of traits we map (possibly during processing of other files): "crate::util::logger::Logger" => Some(""), @@ -868,11 +857,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // Override the default since Records contain an fmt with a lifetime: "util::logger::Record" => Some("local_"), - // List of structs we map (possibly during processing of other files): - "ln::features::InitFeatures" if is_ref && ptr_for_ref => Some("crate::ln::features::InitFeatures { inner: &mut "), - "ln::features::InitFeatures" if is_ref => Some("Box::into_raw(Box::new(crate::ln::features::InitFeatures { inner: &mut "), - "ln::features::InitFeatures" if !is_ref => Some("crate::ln::features::InitFeatures { inner: Box::into_raw(Box::new("), - _ => None, }.map(|s| s.to_owned()) } @@ -930,11 +914,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // Override the default since Records contain an fmt with a lifetime: "util::logger::Record" => Some(".as_ptr()"), - // List of structs we map (possibly during processing of other files): - "ln::features::InitFeatures" if is_ref && ptr_for_ref => Some(", is_owned: false }"), - "ln::features::InitFeatures" if is_ref => Some(", is_owned: false }))"), - "ln::features::InitFeatures" => Some(")), is_owned: true }"), - _ => None, }.map(|s| s.to_owned()) } From 6f5f27e9013ff9d30ef4f1912f48b09d5e8e6148 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 16:14:58 -0500 Subject: [PATCH 14/16] [bindings] Handle `impl Clone` like `impl ::core::clone::Clone` --- c-bindings-gen/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index a93122daf83..e919dc75828 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -903,7 +903,8 @@ fn writeln_impl(w: &mut W, i: &syn::ItemImpl, types: &mut Typ write!(w, "\t{} {{ inner: Box::into_raw(Box::new(Default::default())), is_owned: true }}\n", ident).unwrap(); write!(w, "}}\n").unwrap(); } else if path_matches_nongeneric(&trait_path.1, &["core", "cmp", "PartialEq"]) { - } else if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) && types.c_type_has_inner_from_path(&resolved_path) { + } else if (path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) || path_matches_nongeneric(&trait_path.1, &["Clone"])) && + types.c_type_has_inner_from_path(&resolved_path) { writeln!(w, "impl Clone for {} {{", ident).unwrap(); writeln!(w, "\tfn clone(&self) -> Self {{").unwrap(); writeln!(w, "\t\tSelf {{").unwrap(); From 0a9a7c5d739525d2eb44d3cf778f62f6a865ff01 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 16:18:47 -0500 Subject: [PATCH 15/16] [bindings] Silence c-bindings-gen compile warnings --- c-bindings-gen/src/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 8c15b1258da..2b195e2dcb9 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -612,7 +612,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { } /// Gets the C-mapped type for types which are outside of the crate, or which are manually /// ignored by for some reason need mapping anyway. - fn c_type_from_path<'b>(&self, full_path: &'b str, is_ref: bool, ptr_for_ref: bool) -> Option<&'b str> { + fn c_type_from_path<'b>(&self, full_path: &'b str, is_ref: bool, _ptr_for_ref: bool) -> Option<&'b str> { if self.is_primitive(full_path) { return Some(full_path); } @@ -804,7 +804,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { _ => None, }.map(|s| s.to_owned()) } - fn to_c_conversion_inline_prefix_from_path(&self, full_path: &str, is_ref: bool, ptr_for_ref: bool) -> Option { + fn to_c_conversion_inline_prefix_from_path(&self, full_path: &str, is_ref: bool, _ptr_for_ref: bool) -> Option { if self.is_primitive(full_path) { return Some("".to_owned()); } @@ -860,7 +860,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { _ => None, }.map(|s| s.to_owned()) } - fn to_c_conversion_inline_suffix_from_path(&self, full_path: &str, is_ref: bool, ptr_for_ref: bool) -> Option { + fn to_c_conversion_inline_suffix_from_path(&self, full_path: &str, is_ref: bool, _ptr_for_ref: bool) -> Option { if self.is_primitive(full_path) { return Some("".to_owned()); } From 954e66ed08dd1e6f92974938244c9442b03bfe60 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 18 Feb 2021 12:31:29 -0500 Subject: [PATCH 16/16] Update auto-generated bindings --- lightning-c-bindings/include/lightning.h | 3864 +++++++----- lightning-c-bindings/include/lightningpp.hpp | 3656 ++++++----- lightning-c-bindings/include/rust_types.h | 126 +- lightning-c-bindings/src/c_types/derived.rs | 5602 ++++++++++++----- .../src/chain/channelmonitor.rs | 48 +- .../src/chain/keysinterface.rs | 40 +- lightning-c-bindings/src/chain/transaction.rs | 48 +- lightning-c-bindings/src/ln/chan_utils.rs | 358 +- lightning-c-bindings/src/ln/channelmanager.rs | 38 +- lightning-c-bindings/src/ln/features.rs | 150 + lightning-c-bindings/src/ln/msgs.rs | 1412 ++--- lightning-c-bindings/src/ln/peer_handler.rs | 36 +- .../src/routing/network_graph.rs | 168 +- lightning-c-bindings/src/routing/router.rs | 108 +- lightning-c-bindings/src/util/config.rs | 156 +- 15 files changed, 9784 insertions(+), 6026 deletions(-) diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index d8299b407ba..d5a8b3491c2 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -220,556 +220,951 @@ typedef struct LDKTxOut { uint64_t value; } LDKTxOut; +typedef struct LDKSecretKey { + uint8_t bytes[32]; +} LDKSecretKey; +typedef union LDKCResult_SecretKeyErrorZPtr { + struct LDKSecretKey *result; + enum LDKSecp256k1Error *err; +} LDKCResult_SecretKeyErrorZPtr; -/** - * A reference to a transaction output. - * - * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32 - * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way. - */ -typedef struct MUST_USE_STRUCT LDKOutPoint { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeOutPoint *inner; - bool is_owned; -} LDKOutPoint; +typedef struct LDKCResult_SecretKeyErrorZ { + union LDKCResult_SecretKeyErrorZPtr contents; + bool result_ok; +} LDKCResult_SecretKeyErrorZ; typedef struct LDKPublicKey { uint8_t compressed_form[33]; } LDKPublicKey; -/** - * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to - * look up the corresponding function in rust-lightning's docs. - */ -typedef struct LDKThirtyTwoBytes { - uint8_t data[32]; -} LDKThirtyTwoBytes; - -/** - * When on-chain outputs are created by rust-lightning (which our counterparty is not able to - * claim at any point in the future) an event is generated which you must track and be able to - * spend on-chain. The information needed to do this is provided in this enum, including the - * outpoint describing which txid and output index is available, the full output which exists at - * that txid/index, and any keys or other information required to sign. - */ -typedef enum LDKSpendableOutputDescriptor_Tag { - /** - * An output to a script which was provided via KeysInterface directly, either from - * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to - * spend it. No secret keys are provided as rust-lightning was never given any key. - * These may include outputs from a transaction punishing our counterparty or claiming an HTLC - * on-chain using the payment preimage or after it has timed out. - */ - LDKSpendableOutputDescriptor_StaticOutput, - /** - * An output to a P2WSH script which can be spent with a single signature after a CSV delay. - * - * The witness in the spending input should be: - * (MINIMALIF standard rule) - * - * Note that the nSequence field in the spending input must be set to to_self_delay - * (which means the transaction is not broadcastable until at least to_self_delay - * blocks after the outpoint confirms). - * - * These are generally the result of a \"revocable\" output to us, spendable only by us unless - * it is an output from an old state which we broadcast (which should never happen). - * - * To derive the delayed_payment key which is used to sign for this input, you must pass the - * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in - * ChannelKeys::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to - * chan_utils::derive_private_key. The public key can be generated without the secret key - * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in - * ChannelKeys::pubkeys(). - * - * To derive the revocation_pubkey provided here (which is used in the witness - * script generation), you must pass the counterparty revocation_basepoint (which appears in the - * call to ChannelKeys::ready_channel) and the provided per_commitment point - * to chan_utils::derive_public_revocation_key. - * - * The witness script which is hashed and included in the output script_pubkey may be - * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey - * (derived as above), and the to_self_delay contained here to - * chan_utils::get_revokeable_redeemscript. - */ - LDKSpendableOutputDescriptor_DynamicOutputP2WSH, - /** - * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which - * corresponds to the public key in ChannelKeys::pubkeys().payment_point). - * The witness in the spending input, is, thus, simply: - * - * - * These are generally the result of our counterparty having broadcast the current state, - * allowing us to claim the non-HTLC-encumbered outputs immediately. - */ - LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment, - /** - * Must be last for serialization purposes - */ - LDKSpendableOutputDescriptor_Sentinel, -} LDKSpendableOutputDescriptor_Tag; - -typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body { - struct LDKOutPoint outpoint; - struct LDKTxOut output; -} LDKSpendableOutputDescriptor_LDKStaticOutput_Body; - -typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body { - struct LDKOutPoint outpoint; - struct LDKPublicKey per_commitment_point; - uint16_t to_self_delay; - struct LDKTxOut output; - struct LDKPublicKey revocation_pubkey; - struct LDKThirtyTwoBytes channel_keys_id; - uint64_t channel_value_satoshis; -} LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body; - -typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body { - struct LDKOutPoint outpoint; - struct LDKTxOut output; - struct LDKThirtyTwoBytes channel_keys_id; - uint64_t channel_value_satoshis; -} LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body; - -typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor { - LDKSpendableOutputDescriptor_Tag tag; - union { - LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output; - LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body dynamic_output_p2wsh; - LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body static_output_counterparty_payment; - }; -} LDKSpendableOutputDescriptor; +typedef union LDKCResult_PublicKeyErrorZPtr { + struct LDKPublicKey *result; + enum LDKSecp256k1Error *err; +} LDKCResult_PublicKeyErrorZPtr; -typedef struct LDKCVec_SpendableOutputDescriptorZ { - struct LDKSpendableOutputDescriptor *data; - uintptr_t datalen; -} LDKCVec_SpendableOutputDescriptorZ; +typedef struct LDKCResult_PublicKeyErrorZ { + union LDKCResult_PublicKeyErrorZPtr contents; + bool result_ok; +} LDKCResult_PublicKeyErrorZ; /** - * An accept_channel message to be sent or received from a peer + * The set of public keys which are used in the creation of one commitment transaction. + * These are derived from the channel base keys and per-commitment data. + * + * A broadcaster key is provided from potential broadcaster of the computed transaction. + * A countersignatory key is coming from a protocol participant unable to broadcast the + * transaction. + * + * These keys are assumed to be good, either because the code derived them from + * channel basepoints via the new function, or they were obtained via + * CommitmentTransaction.trust().keys() because we trusted the source of the + * pre-calculated keys. */ -typedef struct MUST_USE_STRUCT LDKAcceptChannel { +typedef struct MUST_USE_STRUCT LDKTxCreationKeys { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeAcceptChannel *inner; + LDKnativeTxCreationKeys *inner; bool is_owned; -} LDKAcceptChannel; +} LDKTxCreationKeys; /** - * An open_channel message to be sent or received from a peer + * An error in decoding a message or struct. */ -typedef struct MUST_USE_STRUCT LDKOpenChannel { +typedef struct MUST_USE_STRUCT LDKDecodeError { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeOpenChannel *inner; + LDKnativeDecodeError *inner; bool is_owned; -} LDKOpenChannel; +} LDKDecodeError; + +typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr { + struct LDKTxCreationKeys *result; + struct LDKDecodeError *err; +} LDKCResult_TxCreationKeysDecodeErrorZPtr; + +typedef struct LDKCResult_TxCreationKeysDecodeErrorZ { + union LDKCResult_TxCreationKeysDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_TxCreationKeysDecodeErrorZ; /** - * A funding_created message to be sent or received from a peer + * One counterparty's public keys which do not change over the life of a channel. */ -typedef struct MUST_USE_STRUCT LDKFundingCreated { +typedef struct MUST_USE_STRUCT LDKChannelPublicKeys { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeFundingCreated *inner; + LDKnativeChannelPublicKeys *inner; bool is_owned; -} LDKFundingCreated; +} LDKChannelPublicKeys; +typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr { + struct LDKChannelPublicKeys *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelPublicKeysDecodeErrorZPtr; +typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ { + union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelPublicKeysDecodeErrorZ; -/** - * A funding_signed message to be sent or received from a peer - */ -typedef struct MUST_USE_STRUCT LDKFundingSigned { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeFundingSigned *inner; - bool is_owned; -} LDKFundingSigned; +typedef union LDKCResult_TxCreationKeysErrorZPtr { + struct LDKTxCreationKeys *result; + enum LDKSecp256k1Error *err; +} LDKCResult_TxCreationKeysErrorZPtr; + +typedef struct LDKCResult_TxCreationKeysErrorZ { + union LDKCResult_TxCreationKeysErrorZPtr contents; + bool result_ok; +} LDKCResult_TxCreationKeysErrorZ; /** - * A funding_locked message to be sent or received from a peer + * Information about an HTLC as it appears in a commitment transaction */ -typedef struct MUST_USE_STRUCT LDKFundingLocked { +typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeFundingLocked *inner; + LDKnativeHTLCOutputInCommitment *inner; bool is_owned; -} LDKFundingLocked; +} LDKHTLCOutputInCommitment; + +typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr { + struct LDKHTLCOutputInCommitment *result; + struct LDKDecodeError *err; +} LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr; + +typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ { + union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_HTLCOutputInCommitmentDecodeErrorZ; /** - * An announcement_signatures message to be sent or received from a peer + * Late-bound per-channel counterparty data used to build transactions. */ -typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures { +typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeAnnouncementSignatures *inner; + LDKnativeCounterpartyChannelTransactionParameters *inner; bool is_owned; -} LDKAnnouncementSignatures; +} LDKCounterpartyChannelTransactionParameters; + +typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { + struct LDKCounterpartyChannelTransactionParameters *result; + struct LDKDecodeError *err; +} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr; + +typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ; /** - * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment - * transaction updates if they were pending. + * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction). + * The fields are organized by holder/counterparty. + * + * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters + * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions. */ -typedef struct MUST_USE_STRUCT LDKCommitmentUpdate { +typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeCommitmentUpdate *inner; + LDKnativeChannelTransactionParameters *inner; bool is_owned; -} LDKCommitmentUpdate; +} LDKChannelTransactionParameters; + +typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr { + struct LDKChannelTransactionParameters *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelTransactionParametersDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ { + union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelTransactionParametersDecodeErrorZ; + +typedef struct LDKSignature { + uint8_t compact_form[64]; +} LDKSignature; + +typedef struct LDKCVec_SignatureZ { + struct LDKSignature *data; + uintptr_t datalen; +} LDKCVec_SignatureZ; /** - * A revoke_and_ack message to be sent or received from a peer + * Information needed to build and sign a holder's commitment transaction. + * + * The transaction is only signed once we are ready to broadcast. */ -typedef struct MUST_USE_STRUCT LDKRevokeAndACK { +typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeRevokeAndACK *inner; + LDKnativeHolderCommitmentTransaction *inner; bool is_owned; -} LDKRevokeAndACK; +} LDKHolderCommitmentTransaction; + +typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr { + struct LDKHolderCommitmentTransaction *result; + struct LDKDecodeError *err; +} LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr; + +typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ { + union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_HolderCommitmentTransactionDecodeErrorZ; /** - * A closing_signed message to be sent or received from a peer + * A pre-built Bitcoin commitment transaction and its txid. */ -typedef struct MUST_USE_STRUCT LDKClosingSigned { +typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeClosingSigned *inner; + LDKnativeBuiltCommitmentTransaction *inner; bool is_owned; -} LDKClosingSigned; +} LDKBuiltCommitmentTransaction; + +typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr { + struct LDKBuiltCommitmentTransaction *result; + struct LDKDecodeError *err; +} LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr; + +typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ { + union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_BuiltCommitmentTransactionDecodeErrorZ; /** - * A shutdown message to be sent or received from a peer + * This class tracks the per-transaction information needed to build a commitment transaction and to + * actually build it and sign. It is used for holder transactions that we sign only when needed + * and for transactions we sign for the counterparty. + * + * This class can be used inside a signer implementation to generate a signature given the relevant + * secret key. */ -typedef struct MUST_USE_STRUCT LDKShutdown { +typedef struct MUST_USE_STRUCT LDKCommitmentTransaction { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeShutdown *inner; + LDKnativeCommitmentTransaction *inner; bool is_owned; -} LDKShutdown; +} LDKCommitmentTransaction; + +typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr { + struct LDKCommitmentTransaction *result; + struct LDKDecodeError *err; +} LDKCResult_CommitmentTransactionDecodeErrorZPtr; + +typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ { + union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_CommitmentTransactionDecodeErrorZ; /** - * A channel_reestablish message to be sent or received from a peer + * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin + * transaction and the transaction creation keys) are trusted. + * + * See trust() and verify() functions on CommitmentTransaction. + * + * This structure implements Deref. */ -typedef struct MUST_USE_STRUCT LDKChannelReestablish { +typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeChannelReestablish *inner; + LDKnativeTrustedCommitmentTransaction *inner; bool is_owned; -} LDKChannelReestablish; +} LDKTrustedCommitmentTransaction; + +typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr { + struct LDKTrustedCommitmentTransaction *result; + /** + * Note that this value is always NULL, as there are no contents in the Err variant + */ + void *err; +} LDKCResult_TrustedCommitmentTransactionNoneZPtr; + +typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ { + union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents; + bool result_ok; +} LDKCResult_TrustedCommitmentTransactionNoneZ; + +typedef union LDKCResult_CVec_SignatureZNoneZPtr { + struct LDKCVec_SignatureZ *result; + /** + * Note that this value is always NULL, as there are no contents in the Err variant + */ + void *err; +} LDKCResult_CVec_SignatureZNoneZPtr; + +typedef struct LDKCResult_CVec_SignatureZNoneZ { + union LDKCResult_CVec_SignatureZNoneZPtr contents; + bool result_ok; +} LDKCResult_CVec_SignatureZNoneZ; + +typedef struct LDKCVec_PublicKeyZ { + struct LDKPublicKey *data; + uintptr_t datalen; +} LDKCVec_PublicKeyZ; /** - * A channel_announcement message to be sent or received from a peer + * Error for PeerManager errors. If you get one of these, you must disconnect the socket and + * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the + * descriptor. */ -typedef struct MUST_USE_STRUCT LDKChannelAnnouncement { +typedef struct MUST_USE_STRUCT LDKPeerHandleError { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeChannelAnnouncement *inner; + LDKnativePeerHandleError *inner; bool is_owned; -} LDKChannelAnnouncement; +} LDKPeerHandleError; + +typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr { + struct LDKCVec_u8Z *result; + struct LDKPeerHandleError *err; +} LDKCResult_CVec_u8ZPeerHandleErrorZPtr; + +typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ { + union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents; + bool result_ok; +} LDKCResult_CVec_u8ZPeerHandleErrorZ; + +typedef union LDKCResult_NonePeerHandleErrorZPtr { + /** + * Note that this value is always NULL, as there are no contents in the OK variant + */ + void *result; + struct LDKPeerHandleError *err; +} LDKCResult_NonePeerHandleErrorZPtr; + +typedef struct LDKCResult_NonePeerHandleErrorZ { + union LDKCResult_NonePeerHandleErrorZPtr contents; + bool result_ok; +} LDKCResult_NonePeerHandleErrorZ; + +typedef union LDKCResult_boolPeerHandleErrorZPtr { + bool *result; + struct LDKPeerHandleError *err; +} LDKCResult_boolPeerHandleErrorZPtr; + +typedef struct LDKCResult_boolPeerHandleErrorZ { + union LDKCResult_boolPeerHandleErrorZPtr contents; + bool result_ok; +} LDKCResult_boolPeerHandleErrorZ; /** - * A channel_update message to be sent or received from a peer + * Features used within an `init` message. */ -typedef struct MUST_USE_STRUCT LDKChannelUpdate { +typedef struct MUST_USE_STRUCT LDKInitFeatures { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeChannelUpdate *inner; + LDKnativeInitFeatures *inner; bool is_owned; -} LDKChannelUpdate; +} LDKInitFeatures; + +typedef union LDKCResult_InitFeaturesDecodeErrorZPtr { + struct LDKInitFeatures *result; + struct LDKDecodeError *err; +} LDKCResult_InitFeaturesDecodeErrorZPtr; + +typedef struct LDKCResult_InitFeaturesDecodeErrorZ { + union LDKCResult_InitFeaturesDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_InitFeaturesDecodeErrorZ; /** - * A node_announcement message to be sent or received from a peer + * Features used within a `node_announcement` message. */ -typedef struct MUST_USE_STRUCT LDKNodeAnnouncement { +typedef struct MUST_USE_STRUCT LDKNodeFeatures { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeNodeAnnouncement *inner; + LDKnativeNodeFeatures *inner; bool is_owned; -} LDKNodeAnnouncement; +} LDKNodeFeatures; + +typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr { + struct LDKNodeFeatures *result; + struct LDKDecodeError *err; +} LDKCResult_NodeFeaturesDecodeErrorZPtr; + +typedef struct LDKCResult_NodeFeaturesDecodeErrorZ { + union LDKCResult_NodeFeaturesDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_NodeFeaturesDecodeErrorZ; /** - * An error message to be sent or received from a peer + * Features used within a `channel_announcement` message. */ -typedef struct MUST_USE_STRUCT LDKErrorMessage { +typedef struct MUST_USE_STRUCT LDKChannelFeatures { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeErrorMessage *inner; + LDKnativeChannelFeatures *inner; bool is_owned; -} LDKErrorMessage; +} LDKChannelFeatures; + +typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr { + struct LDKChannelFeatures *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelFeaturesDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ { + union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelFeaturesDecodeErrorZ; + + /** - * Used to put an error message in a LightningError + * Options which apply on a per-channel basis and may change at runtime or based on negotiation + * with our counterparty. */ -typedef enum LDKErrorAction_Tag { - /** - * The peer took some action which made us think they were useless. Disconnect them. - */ - LDKErrorAction_DisconnectPeer, - /** - * The peer did something harmless that we weren't able to process, just log and ignore - */ - LDKErrorAction_IgnoreError, - /** - * The peer did something incorrect. Tell them. - */ - LDKErrorAction_SendErrorMessage, +typedef struct MUST_USE_STRUCT LDKChannelConfig { /** - * Must be last for serialization purposes + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKErrorAction_Sentinel, -} LDKErrorAction_Tag; + LDKnativeChannelConfig *inner; + bool is_owned; +} LDKChannelConfig; -typedef struct LDKErrorAction_LDKDisconnectPeer_Body { - struct LDKErrorMessage msg; -} LDKErrorAction_LDKDisconnectPeer_Body; +typedef union LDKCResult_ChannelConfigDecodeErrorZPtr { + struct LDKChannelConfig *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelConfigDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelConfigDecodeErrorZ { + union LDKCResult_ChannelConfigDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelConfigDecodeErrorZ; -typedef struct LDKErrorAction_LDKSendErrorMessage_Body { - struct LDKErrorMessage msg; -} LDKErrorAction_LDKSendErrorMessage_Body; -typedef struct MUST_USE_STRUCT LDKErrorAction { - LDKErrorAction_Tag tag; - union { - LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer; - LDKErrorAction_LDKSendErrorMessage_Body send_error_message; - }; -} LDKErrorAction; /** - * The information we received from a peer along the route of a payment we originated. This is - * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into - * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map. + * An Err type for failure to process messages. */ -typedef enum LDKHTLCFailChannelUpdate_Tag { - /** - * We received an error which included a full ChannelUpdate message. - */ - LDKHTLCFailChannelUpdate_ChannelUpdateMessage, - /** - * We received an error which indicated only that a channel has been closed - */ - LDKHTLCFailChannelUpdate_ChannelClosed, - /** - * We received an error which indicated only that a node has failed - */ - LDKHTLCFailChannelUpdate_NodeFailure, +typedef struct MUST_USE_STRUCT LDKLightningError { /** - * Must be last for serialization purposes + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKHTLCFailChannelUpdate_Sentinel, -} LDKHTLCFailChannelUpdate_Tag; - -typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body { - struct LDKChannelUpdate msg; -} LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body; - -typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body { - uint64_t short_channel_id; - bool is_permanent; -} LDKHTLCFailChannelUpdate_LDKChannelClosed_Body; + LDKnativeLightningError *inner; + bool is_owned; +} LDKLightningError; -typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body { - struct LDKPublicKey node_id; - bool is_permanent; -} LDKHTLCFailChannelUpdate_LDKNodeFailure_Body; +typedef union LDKCResult_boolLightningErrorZPtr { + bool *result; + struct LDKLightningError *err; +} LDKCResult_boolLightningErrorZPtr; -typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate { - LDKHTLCFailChannelUpdate_Tag tag; - union { - LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message; - LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed; - LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure; - }; -} LDKHTLCFailChannelUpdate; +typedef struct LDKCResult_boolLightningErrorZ { + union LDKCResult_boolLightningErrorZPtr contents; + bool result_ok; +} LDKCResult_boolLightningErrorZ; /** - * A query_channel_range message is used to query a peer for channel - * UTXOs in a range of blocks. The recipient of a query makes a best - * effort to reply to the query using one or more reply_channel_range - * messages. + * A channel_announcement message to be sent or received from a peer */ -typedef struct MUST_USE_STRUCT LDKQueryChannelRange { +typedef struct MUST_USE_STRUCT LDKChannelAnnouncement { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeQueryChannelRange *inner; + LDKnativeChannelAnnouncement *inner; bool is_owned; -} LDKQueryChannelRange; +} LDKChannelAnnouncement; /** - * A query_short_channel_ids message is used to query a peer for - * routing gossip messages related to one or more short_channel_ids. - * The query recipient will reply with the latest, if available, - * channel_announcement, channel_update and node_announcement messages - * it maintains for the requested short_channel_ids followed by a - * reply_short_channel_ids_end message. The short_channel_ids sent in - * this query are encoded. We only support encoding_type=0 uncompressed - * serialization and do not support encoding_type=1 zlib serialization. + * A channel_update message to be sent or received from a peer */ -typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds { +typedef struct MUST_USE_STRUCT LDKChannelUpdate { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeQueryShortChannelIds *inner; + LDKnativeChannelUpdate *inner; bool is_owned; -} LDKQueryShortChannelIds; +} LDKChannelUpdate; + +typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + struct LDKChannelAnnouncement a; + struct LDKChannelUpdate b; + struct LDKChannelUpdate c; +} LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ; + +typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { + struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data; + uintptr_t datalen; +} LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ; + + /** - * 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. + * A node_announcement message to be sent or received from a peer */ -typedef enum LDKMessageSendEvent_Tag { +typedef struct MUST_USE_STRUCT LDKNodeAnnouncement { /** - * Used to indicate that we've accepted a channel open and should send the accept_channel - * message provided to the given peer. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendAcceptChannel, + LDKnativeNodeAnnouncement *inner; + bool is_owned; +} LDKNodeAnnouncement; + +typedef struct LDKCVec_NodeAnnouncementZ { + struct LDKNodeAnnouncement *data; + uintptr_t datalen; +} LDKCVec_NodeAnnouncementZ; + +typedef union LDKCResult_NoneLightningErrorZPtr { /** - * Used to indicate that we've initiated a channel open and should send the open_channel - * message provided to the given peer. + * Note that this value is always NULL, as there are no contents in the OK variant */ - LDKMessageSendEvent_SendOpenChannel, + void *result; + struct LDKLightningError *err; +} LDKCResult_NoneLightningErrorZPtr; + +typedef struct LDKCResult_NoneLightningErrorZ { + union LDKCResult_NoneLightningErrorZPtr contents; + bool result_ok; +} LDKCResult_NoneLightningErrorZ; + + + +/** + * An accept_channel message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKAcceptChannel { /** - * Used to indicate that a funding_created message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendFundingCreated, + LDKnativeAcceptChannel *inner; + bool is_owned; +} LDKAcceptChannel; + + + +/** + * An open_channel message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKOpenChannel { /** - * Used to indicate that a funding_signed message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendFundingSigned, + LDKnativeOpenChannel *inner; + bool is_owned; +} LDKOpenChannel; + + + +/** + * A funding_created message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKFundingCreated { /** - * Used to indicate that a funding_locked message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendFundingLocked, + LDKnativeFundingCreated *inner; + bool is_owned; +} LDKFundingCreated; + + + +/** + * A funding_signed message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKFundingSigned { /** - * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendAnnouncementSignatures, + LDKnativeFundingSigned *inner; + bool is_owned; +} LDKFundingSigned; + + + +/** + * A funding_locked message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKFundingLocked { /** - * Used to indicate that a series of HTLC update messages, as well as a commitment_signed - * message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_UpdateHTLCs, + LDKnativeFundingLocked *inner; + bool is_owned; +} LDKFundingLocked; + + + +/** + * An announcement_signatures message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures { /** - * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendRevokeAndACK, + LDKnativeAnnouncementSignatures *inner; + bool is_owned; +} LDKAnnouncementSignatures; + + + +/** + * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment + * transaction updates if they were pending. + */ +typedef struct MUST_USE_STRUCT LDKCommitmentUpdate { /** - * Used to indicate that a closing_signed message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendClosingSigned, + LDKnativeCommitmentUpdate *inner; + bool is_owned; +} LDKCommitmentUpdate; + + + +/** + * A revoke_and_ack message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKRevokeAndACK { /** - * Used to indicate that a shutdown message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendShutdown, + LDKnativeRevokeAndACK *inner; + bool is_owned; +} LDKRevokeAndACK; + + + +/** + * A closing_signed message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKClosingSigned { /** - * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_SendChannelReestablish, + LDKnativeClosingSigned *inner; + bool is_owned; +} LDKClosingSigned; + + + +/** + * A shutdown message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKShutdown { /** - * Used to indicate that a channel_announcement and channel_update should be broadcast to all - * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2). - * - * Note that after doing so, you very likely (unless you did so very recently) want to call - * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event. - * This ensures that any nodes which see our channel_announcement also have a relevant - * node_announcement, including relevant feature flags which may be important for routing - * through or to us. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_BroadcastChannelAnnouncement, + LDKnativeShutdown *inner; + bool is_owned; +} LDKShutdown; + + + +/** + * A channel_reestablish message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKChannelReestablish { /** - * Used to indicate that a node_announcement should be broadcast to all peers. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_BroadcastNodeAnnouncement, + LDKnativeChannelReestablish *inner; + bool is_owned; +} LDKChannelReestablish; + + + +/** + * An error message to be sent or received from a peer + */ +typedef struct MUST_USE_STRUCT LDKErrorMessage { /** - * Used to indicate that a channel_update should be broadcast to all peers. + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKMessageSendEvent_BroadcastChannelUpdate, + LDKnativeErrorMessage *inner; + bool is_owned; +} LDKErrorMessage; + +/** + * Used to put an error message in a LightningError + */ +typedef enum LDKErrorAction_Tag { /** - * Broadcast an error downstream to be handled + * The peer took some action which made us think they were useless. Disconnect them. */ - LDKMessageSendEvent_HandleError, + LDKErrorAction_DisconnectPeer, /** - * When a payment fails we may receive updates back from the hop where it failed. In such - * cases this event is generated so that we can inform the network graph of this information. + * The peer did something harmless that we weren't able to process, just log and ignore */ - LDKMessageSendEvent_PaymentFailureNetworkUpdate, + LDKErrorAction_IgnoreError, /** - * Query a peer for channels with funding transaction UTXOs in a block range. + * The peer did something incorrect. Tell them. */ - LDKMessageSendEvent_SendChannelRangeQuery, + LDKErrorAction_SendErrorMessage, /** - * Request routing gossip messages from a peer for a list of channels identified by - * their short_channel_ids. + * Must be last for serialization purposes + */ + LDKErrorAction_Sentinel, +} LDKErrorAction_Tag; + +typedef struct LDKErrorAction_LDKDisconnectPeer_Body { + struct LDKErrorMessage msg; +} LDKErrorAction_LDKDisconnectPeer_Body; + +typedef struct LDKErrorAction_LDKSendErrorMessage_Body { + struct LDKErrorMessage msg; +} LDKErrorAction_LDKSendErrorMessage_Body; + +typedef struct MUST_USE_STRUCT LDKErrorAction { + LDKErrorAction_Tag tag; + union { + LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer; + LDKErrorAction_LDKSendErrorMessage_Body send_error_message; + }; +} LDKErrorAction; + +/** + * The information we received from a peer along the route of a payment we originated. This is + * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into + * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map. + */ +typedef enum LDKHTLCFailChannelUpdate_Tag { + /** + * We received an error which included a full ChannelUpdate message. + */ + LDKHTLCFailChannelUpdate_ChannelUpdateMessage, + /** + * We received an error which indicated only that a channel has been closed + */ + LDKHTLCFailChannelUpdate_ChannelClosed, + /** + * We received an error which indicated only that a node has failed + */ + LDKHTLCFailChannelUpdate_NodeFailure, + /** + * Must be last for serialization purposes + */ + LDKHTLCFailChannelUpdate_Sentinel, +} LDKHTLCFailChannelUpdate_Tag; + +typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body { + struct LDKChannelUpdate msg; +} LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body; + +typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body { + uint64_t short_channel_id; + bool is_permanent; +} LDKHTLCFailChannelUpdate_LDKChannelClosed_Body; + +typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body { + struct LDKPublicKey node_id; + bool is_permanent; +} LDKHTLCFailChannelUpdate_LDKNodeFailure_Body; + +typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate { + LDKHTLCFailChannelUpdate_Tag tag; + union { + LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message; + LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed; + LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure; + }; +} LDKHTLCFailChannelUpdate; + + + +/** + * A query_channel_range message is used to query a peer for channel + * UTXOs in a range of blocks. The recipient of a query makes a best + * effort to reply to the query using one or more reply_channel_range + * messages. + */ +typedef struct MUST_USE_STRUCT LDKQueryChannelRange { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeQueryChannelRange *inner; + bool is_owned; +} LDKQueryChannelRange; + + + +/** + * A query_short_channel_ids message is used to query a peer for + * routing gossip messages related to one or more short_channel_ids. + * The query recipient will reply with the latest, if available, + * channel_announcement, channel_update and node_announcement messages + * it maintains for the requested short_channel_ids followed by a + * reply_short_channel_ids_end message. The short_channel_ids sent in + * this query are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ +typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeQueryShortChannelIds *inner; + bool is_owned; +} LDKQueryShortChannelIds; + +/** + * 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. + */ +typedef enum LDKMessageSendEvent_Tag { + /** + * Used to indicate that we've accepted a channel open and should send the accept_channel + * message provided to the given peer. + */ + LDKMessageSendEvent_SendAcceptChannel, + /** + * Used to indicate that we've initiated a channel open and should send the open_channel + * message provided to the given peer. + */ + LDKMessageSendEvent_SendOpenChannel, + /** + * Used to indicate that a funding_created message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendFundingCreated, + /** + * Used to indicate that a funding_signed message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendFundingSigned, + /** + * Used to indicate that a funding_locked message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendFundingLocked, + /** + * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendAnnouncementSignatures, + /** + * Used to indicate that a series of HTLC update messages, as well as a commitment_signed + * message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_UpdateHTLCs, + /** + * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendRevokeAndACK, + /** + * Used to indicate that a closing_signed message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendClosingSigned, + /** + * Used to indicate that a shutdown message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendShutdown, + /** + * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id. + */ + LDKMessageSendEvent_SendChannelReestablish, + /** + * Used to indicate that a channel_announcement and channel_update should be broadcast to all + * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2). + * + * Note that after doing so, you very likely (unless you did so very recently) want to call + * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event. + * This ensures that any nodes which see our channel_announcement also have a relevant + * node_announcement, including relevant feature flags which may be important for routing + * through or to us. + */ + LDKMessageSendEvent_BroadcastChannelAnnouncement, + /** + * Used to indicate that a node_announcement should be broadcast to all peers. + */ + LDKMessageSendEvent_BroadcastNodeAnnouncement, + /** + * Used to indicate that a channel_update should be broadcast to all peers. + */ + LDKMessageSendEvent_BroadcastChannelUpdate, + /** + * Broadcast an error downstream to be handled + */ + LDKMessageSendEvent_HandleError, + /** + * When a payment fails we may receive updates back from the hop where it failed. In such + * cases this event is generated so that we can inform the network graph of this information. + */ + LDKMessageSendEvent_PaymentFailureNetworkUpdate, + /** + * Query a peer for channels with funding transaction UTXOs in a block range. + */ + LDKMessageSendEvent_SendChannelRangeQuery, + /** + * Request routing gossip messages from a peer for a list of channels identified by + * their short_channel_ids. */ LDKMessageSendEvent_SendShortIdsQuery, /** @@ -851,48 +1246,442 @@ typedef struct LDKMessageSendEvent_LDKHandleError_Body { struct LDKErrorAction action; } LDKMessageSendEvent_LDKHandleError_Body; -typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body { - struct LDKHTLCFailChannelUpdate update; -} LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body; +typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body { + struct LDKHTLCFailChannelUpdate update; +} LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body; + +typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body { + struct LDKPublicKey node_id; + struct LDKQueryChannelRange msg; +} LDKMessageSendEvent_LDKSendChannelRangeQuery_Body; + +typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body { + struct LDKPublicKey node_id; + struct LDKQueryShortChannelIds msg; +} LDKMessageSendEvent_LDKSendShortIdsQuery_Body; + +typedef struct MUST_USE_STRUCT LDKMessageSendEvent { + LDKMessageSendEvent_Tag tag; + union { + LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel; + LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel; + LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created; + LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed; + LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked; + LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures; + LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs; + LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack; + LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed; + LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown; + LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish; + LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement; + LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement; + LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update; + LDKMessageSendEvent_LDKHandleError_Body handle_error; + LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update; + LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query; + LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query; + }; +} LDKMessageSendEvent; + +typedef struct LDKCVec_MessageSendEventZ { + struct LDKMessageSendEvent *data; + uintptr_t datalen; +} LDKCVec_MessageSendEventZ; + + + +/** + * Details about one direction of a channel. Received + * within a channel update. + */ +typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeDirectionalChannelInfo *inner; + bool is_owned; +} LDKDirectionalChannelInfo; + +typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr { + struct LDKDirectionalChannelInfo *result; + struct LDKDecodeError *err; +} LDKCResult_DirectionalChannelInfoDecodeErrorZPtr; + +typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ { + union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_DirectionalChannelInfoDecodeErrorZ; + + + +/** + * Details about a channel (both directions). + * Received within a channel announcement. + */ +typedef struct MUST_USE_STRUCT LDKChannelInfo { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeChannelInfo *inner; + bool is_owned; +} LDKChannelInfo; + +typedef union LDKCResult_ChannelInfoDecodeErrorZPtr { + struct LDKChannelInfo *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelInfoDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelInfoDecodeErrorZ { + union LDKCResult_ChannelInfoDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelInfoDecodeErrorZ; + + + +/** + * Fees for routing via a given channel or a node + */ +typedef struct MUST_USE_STRUCT LDKRoutingFees { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeRoutingFees *inner; + bool is_owned; +} LDKRoutingFees; + +typedef union LDKCResult_RoutingFeesDecodeErrorZPtr { + struct LDKRoutingFees *result; + struct LDKDecodeError *err; +} LDKCResult_RoutingFeesDecodeErrorZPtr; + +typedef struct LDKCResult_RoutingFeesDecodeErrorZ { + union LDKCResult_RoutingFeesDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_RoutingFeesDecodeErrorZ; + +typedef struct LDKFourBytes { + uint8_t data[4]; +} LDKFourBytes; + +typedef struct LDKSixteenBytes { + uint8_t data[16]; +} LDKSixteenBytes; + +typedef struct LDKTenBytes { + uint8_t data[10]; +} LDKTenBytes; + +/** + * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to + * look up the corresponding function in rust-lightning's docs. + */ +typedef struct LDKThirtyTwoBytes { + uint8_t data[32]; +} LDKThirtyTwoBytes; + +/** + * An address which can be used to connect to a remote peer + */ +typedef enum LDKNetAddress_Tag { + /** + * An IPv4 address/port on which the peer is listening. + */ + LDKNetAddress_IPv4, + /** + * An IPv6 address/port on which the peer is listening. + */ + LDKNetAddress_IPv6, + /** + * An old-style Tor onion address/port on which the peer is listening. + */ + LDKNetAddress_OnionV2, + /** + * A new-style Tor onion address/port on which the peer is listening. + * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version, + * wrap as base32 and append \".onion\". + */ + LDKNetAddress_OnionV3, + /** + * Must be last for serialization purposes + */ + LDKNetAddress_Sentinel, +} LDKNetAddress_Tag; + +typedef struct LDKNetAddress_LDKIPv4_Body { + struct LDKFourBytes addr; + uint16_t port; +} LDKNetAddress_LDKIPv4_Body; + +typedef struct LDKNetAddress_LDKIPv6_Body { + struct LDKSixteenBytes addr; + uint16_t port; +} LDKNetAddress_LDKIPv6_Body; + +typedef struct LDKNetAddress_LDKOnionV2_Body { + struct LDKTenBytes addr; + uint16_t port; +} LDKNetAddress_LDKOnionV2_Body; + +typedef struct LDKNetAddress_LDKOnionV3_Body { + struct LDKThirtyTwoBytes ed25519_pubkey; + uint16_t checksum; + uint8_t version; + uint16_t port; +} LDKNetAddress_LDKOnionV3_Body; + +typedef struct MUST_USE_STRUCT LDKNetAddress { + LDKNetAddress_Tag tag; + union { + LDKNetAddress_LDKIPv4_Body i_pv4; + LDKNetAddress_LDKIPv6_Body i_pv6; + LDKNetAddress_LDKOnionV2_Body onion_v2; + LDKNetAddress_LDKOnionV3_Body onion_v3; + }; +} LDKNetAddress; + +typedef struct LDKCVec_NetAddressZ { + struct LDKNetAddress *data; + uintptr_t datalen; +} LDKCVec_NetAddressZ; + + + +/** + * Information received in the latest node_announcement from this node. + */ +typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeNodeAnnouncementInfo *inner; + bool is_owned; +} LDKNodeAnnouncementInfo; + +typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr { + struct LDKNodeAnnouncementInfo *result; + struct LDKDecodeError *err; +} LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr; + +typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ { + union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_NodeAnnouncementInfoDecodeErrorZ; + +typedef struct LDKCVec_u64Z { + uint64_t *data; + uintptr_t datalen; +} LDKCVec_u64Z; + + + +/** + * Details about a node in the network, known from the network announcement. + */ +typedef struct MUST_USE_STRUCT LDKNodeInfo { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeNodeInfo *inner; + bool is_owned; +} LDKNodeInfo; + +typedef union LDKCResult_NodeInfoDecodeErrorZPtr { + struct LDKNodeInfo *result; + struct LDKDecodeError *err; +} LDKCResult_NodeInfoDecodeErrorZPtr; + +typedef struct LDKCResult_NodeInfoDecodeErrorZ { + union LDKCResult_NodeInfoDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_NodeInfoDecodeErrorZ; + + + +/** + * Represents the network as nodes and channels between them + */ +typedef struct MUST_USE_STRUCT LDKNetworkGraph { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeNetworkGraph *inner; + bool is_owned; +} LDKNetworkGraph; + +typedef union LDKCResult_NetworkGraphDecodeErrorZPtr { + struct LDKNetworkGraph *result; + struct LDKDecodeError *err; +} LDKCResult_NetworkGraphDecodeErrorZPtr; + +typedef struct LDKCResult_NetworkGraphDecodeErrorZ { + union LDKCResult_NetworkGraphDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_NetworkGraphDecodeErrorZ; + +typedef struct LDKC2Tuple_usizeTransactionZ { + uintptr_t a; + struct LDKTransaction b; +} LDKC2Tuple_usizeTransactionZ; + +typedef struct LDKCVec_C2Tuple_usizeTransactionZZ { + struct LDKC2Tuple_usizeTransactionZ *data; + uintptr_t datalen; +} LDKCVec_C2Tuple_usizeTransactionZZ; + +typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr { + /** + * Note that this value is always NULL, as there are no contents in the OK variant + */ + void *result; + enum LDKChannelMonitorUpdateErr *err; +} LDKCResult_NoneChannelMonitorUpdateErrZPtr; + +typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ { + union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents; + bool result_ok; +} LDKCResult_NoneChannelMonitorUpdateErrZ; + + + +/** + * An event to be processed by the ChannelManager. + */ +typedef struct MUST_USE_STRUCT LDKMonitorEvent { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeMonitorEvent *inner; + bool is_owned; +} LDKMonitorEvent; + +typedef struct LDKCVec_MonitorEventZ { + struct LDKMonitorEvent *data; + uintptr_t datalen; +} LDKCVec_MonitorEventZ; + + + +/** + * A reference to a transaction output. + * + * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32 + * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way. + */ +typedef struct MUST_USE_STRUCT LDKOutPoint { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeOutPoint *inner; + bool is_owned; +} LDKOutPoint; + +/** + * When on-chain outputs are created by rust-lightning (which our counterparty is not able to + * claim at any point in the future) an event is generated which you must track and be able to + * spend on-chain. The information needed to do this is provided in this enum, including the + * outpoint describing which txid and output index is available, the full output which exists at + * that txid/index, and any keys or other information required to sign. + */ +typedef enum LDKSpendableOutputDescriptor_Tag { + /** + * An output to a script which was provided via KeysInterface directly, either from + * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to + * spend it. No secret keys are provided as rust-lightning was never given any key. + * These may include outputs from a transaction punishing our counterparty or claiming an HTLC + * on-chain using the payment preimage or after it has timed out. + */ + LDKSpendableOutputDescriptor_StaticOutput, + /** + * An output to a P2WSH script which can be spent with a single signature after a CSV delay. + * + * The witness in the spending input should be: + * (MINIMALIF standard rule) + * + * Note that the nSequence field in the spending input must be set to to_self_delay + * (which means the transaction is not broadcastable until at least to_self_delay + * blocks after the outpoint confirms). + * + * These are generally the result of a \"revocable\" output to us, spendable only by us unless + * it is an output from an old state which we broadcast (which should never happen). + * + * To derive the delayed_payment key which is used to sign for this input, you must pass the + * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in + * ChannelKeys::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to + * chan_utils::derive_private_key. The public key can be generated without the secret key + * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in + * ChannelKeys::pubkeys(). + * + * To derive the revocation_pubkey provided here (which is used in the witness + * script generation), you must pass the counterparty revocation_basepoint (which appears in the + * call to ChannelKeys::ready_channel) and the provided per_commitment point + * to chan_utils::derive_public_revocation_key. + * + * The witness script which is hashed and included in the output script_pubkey may be + * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey + * (derived as above), and the to_self_delay contained here to + * chan_utils::get_revokeable_redeemscript. + */ + LDKSpendableOutputDescriptor_DynamicOutputP2WSH, + /** + * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which + * corresponds to the public key in ChannelKeys::pubkeys().payment_point). + * The witness in the spending input, is, thus, simply: + * + * + * These are generally the result of our counterparty having broadcast the current state, + * allowing us to claim the non-HTLC-encumbered outputs immediately. + */ + LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment, + /** + * Must be last for serialization purposes + */ + LDKSpendableOutputDescriptor_Sentinel, +} LDKSpendableOutputDescriptor_Tag; + +typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body { + struct LDKOutPoint outpoint; + struct LDKTxOut output; +} LDKSpendableOutputDescriptor_LDKStaticOutput_Body; -typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body { - struct LDKPublicKey node_id; - struct LDKQueryChannelRange msg; -} LDKMessageSendEvent_LDKSendChannelRangeQuery_Body; +typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body { + struct LDKOutPoint outpoint; + struct LDKPublicKey per_commitment_point; + uint16_t to_self_delay; + struct LDKTxOut output; + struct LDKPublicKey revocation_pubkey; + struct LDKThirtyTwoBytes channel_keys_id; + uint64_t channel_value_satoshis; +} LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body; -typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body { - struct LDKPublicKey node_id; - struct LDKQueryShortChannelIds msg; -} LDKMessageSendEvent_LDKSendShortIdsQuery_Body; +typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body { + struct LDKOutPoint outpoint; + struct LDKTxOut output; + struct LDKThirtyTwoBytes channel_keys_id; + uint64_t channel_value_satoshis; +} LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body; -typedef struct MUST_USE_STRUCT LDKMessageSendEvent { - LDKMessageSendEvent_Tag tag; +typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor { + LDKSpendableOutputDescriptor_Tag tag; union { - LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel; - LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel; - LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created; - LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed; - LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked; - LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures; - LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs; - LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack; - LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed; - LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown; - LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish; - LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement; - LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement; - LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update; - LDKMessageSendEvent_LDKHandleError_Body handle_error; - LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update; - LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query; - LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query; + LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output; + LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body dynamic_output_p2wsh; + LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body static_output_counterparty_payment; }; -} LDKMessageSendEvent; +} LDKSpendableOutputDescriptor; -typedef struct LDKCVec_MessageSendEventZ { - struct LDKMessageSendEvent *data; +typedef struct LDKCVec_SpendableOutputDescriptorZ { + struct LDKSpendableOutputDescriptor *data; uintptr_t datalen; -} LDKCVec_MessageSendEventZ; +} LDKCVec_SpendableOutputDescriptorZ; /** * An Event which you should probably take some action in response to. @@ -1014,47 +1803,15 @@ typedef struct LDKCVec_EventZ { uintptr_t datalen; } LDKCVec_EventZ; -typedef struct LDKC2Tuple_usizeTransactionZ { - uintptr_t a; - struct LDKTransaction b; -} LDKC2Tuple_usizeTransactionZ; - -typedef struct LDKCVec_C2Tuple_usizeTransactionZZ { - struct LDKC2Tuple_usizeTransactionZ *data; - uintptr_t datalen; -} LDKCVec_C2Tuple_usizeTransactionZZ; - -typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr { - /** - * Note that this value is always NULL, as there are no contents in the OK variant - */ - void *result; - enum LDKChannelMonitorUpdateErr *err; -} LDKCResult_NoneChannelMonitorUpdateErrZPtr; +typedef union LDKCResult_OutPointDecodeErrorZPtr { + struct LDKOutPoint *result; + struct LDKDecodeError *err; +} LDKCResult_OutPointDecodeErrorZPtr; -typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ { - union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents; +typedef struct LDKCResult_OutPointDecodeErrorZ { + union LDKCResult_OutPointDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_NoneChannelMonitorUpdateErrZ; - - - -/** - * An event to be processed by the ChannelManager. - */ -typedef struct MUST_USE_STRUCT LDKMonitorEvent { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeMonitorEvent *inner; - bool is_owned; -} LDKMonitorEvent; - -typedef struct LDKCVec_MonitorEventZ { - struct LDKMonitorEvent *data; - uintptr_t datalen; -} LDKCVec_MonitorEventZ; +} LDKCResult_OutPointDecodeErrorZ; @@ -1071,29 +1828,43 @@ typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate { bool is_owned; } LDKChannelMonitorUpdate; +typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr { + struct LDKChannelMonitorUpdate *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ { + union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelMonitorUpdateDecodeErrorZ; + /** - * An error in decoding a message or struct. + * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on + * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the + * preimage claim backward will lead to loss of funds. + * + * [`chain::Watch`]: ../trait.Watch.html */ -typedef struct MUST_USE_STRUCT LDKDecodeError { +typedef struct MUST_USE_STRUCT LDKHTLCUpdate { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeDecodeError *inner; + LDKnativeHTLCUpdate *inner; bool is_owned; -} LDKDecodeError; +} LDKHTLCUpdate; -typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr { - struct LDKChannelMonitorUpdate *result; +typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr { + struct LDKHTLCUpdate *result; struct LDKDecodeError *err; -} LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr; +} LDKCResult_HTLCUpdateDecodeErrorZPtr; -typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ { - union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents; +typedef struct LDKCResult_HTLCUpdateDecodeErrorZ { + union LDKCResult_HTLCUpdateDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_ChannelMonitorUpdateDecodeErrorZ; +} LDKCResult_HTLCUpdateDecodeErrorZ; @@ -1156,29 +1927,6 @@ typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { uintptr_t datalen; } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ; - - -/** - * One counterparty's public keys which do not change over the life of a channel. - */ -typedef struct MUST_USE_STRUCT LDKChannelPublicKeys { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeChannelPublicKeys *inner; - bool is_owned; -} LDKChannelPublicKeys; - -typedef struct LDKSignature { - uint8_t compact_form[64]; -} LDKSignature; - -typedef struct LDKCVec_SignatureZ { - struct LDKSignature *data; - uintptr_t datalen; -} LDKCVec_SignatureZ; - typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ { struct LDKSignature a; struct LDKCVec_SignatureZ b; @@ -1197,41 +1945,6 @@ typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { bool result_ok; } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ; - - -/** - * This class tracks the per-transaction information needed to build a commitment transaction and to - * actually build it and sign. It is used for holder transactions that we sign only when needed - * and for transactions we sign for the counterparty. - * - * This class can be used inside a signer implementation to generate a signature given the relevant - * secret key. - */ -typedef struct MUST_USE_STRUCT LDKCommitmentTransaction { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeCommitmentTransaction *inner; - bool is_owned; -} LDKCommitmentTransaction; - - - -/** - * Information needed to build and sign a holder's commitment transaction. - * - * The transaction is only signed once we are ready to broadcast. - */ -typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeHolderCommitmentTransaction *inner; - bool is_owned; -} LDKHolderCommitmentTransaction; - typedef union LDKCResult_SignatureNoneZPtr { struct LDKSignature *result; /** @@ -1241,55 +1954,23 @@ typedef union LDKCResult_SignatureNoneZPtr { } LDKCResult_SignatureNoneZPtr; typedef struct LDKCResult_SignatureNoneZ { - union LDKCResult_SignatureNoneZPtr contents; - bool result_ok; -} LDKCResult_SignatureNoneZ; - - - -/** - * Information about an HTLC as it appears in a commitment transaction - */ -typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeHTLCOutputInCommitment *inner; - bool is_owned; -} LDKHTLCOutputInCommitment; - - - -/** - * The unsigned part of a channel_announcement - */ -typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeUnsignedChannelAnnouncement *inner; - bool is_owned; -} LDKUnsignedChannelAnnouncement; + union LDKCResult_SignatureNoneZPtr contents; + bool result_ok; +} LDKCResult_SignatureNoneZ; /** - * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction). - * The fields are organized by holder/counterparty. - * - * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters - * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions. + * The unsigned part of a channel_announcement */ -typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters { +typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeChannelTransactionParameters *inner; + LDKnativeUnsignedChannelAnnouncement *inner; bool is_owned; -} LDKChannelTransactionParameters; +} LDKUnsignedChannelAnnouncement; /** * Set of lightning keys needed to operate a channel as described in BOLT 3. @@ -1490,53 +2171,6 @@ typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { bool result_ok; } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ; -typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr { - struct LDKSpendableOutputDescriptor *result; - struct LDKDecodeError *err; -} LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr; - -typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ { - union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_SpendableOutputDescriptorDecodeErrorZ; - -typedef union LDKCResult_ChanKeySignerDecodeErrorZPtr { - struct LDKChannelKeys *result; - struct LDKDecodeError *err; -} LDKCResult_ChanKeySignerDecodeErrorZPtr; - -typedef struct LDKCResult_ChanKeySignerDecodeErrorZ { - union LDKCResult_ChanKeySignerDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_ChanKeySignerDecodeErrorZ; - - - -/** - * A simple implementation of ChannelKeys that just keeps the private keys in memory. - * - * This implementation performs no policy checks and is insufficient by itself as - * a secure external signer. - */ -typedef struct MUST_USE_STRUCT LDKInMemoryChannelKeys { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeInMemoryChannelKeys *inner; - bool is_owned; -} LDKInMemoryChannelKeys; - -typedef union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr { - struct LDKInMemoryChannelKeys *result; - struct LDKDecodeError *err; -} LDKCResult_InMemoryChannelKeysDecodeErrorZPtr; - -typedef struct LDKCResult_InMemoryChannelKeysDecodeErrorZ { - union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_InMemoryChannelKeysDecodeErrorZ; - typedef union LDKCResult_TxOutAccessErrorZPtr { struct LDKTxOut *result; enum LDKAccessError *err; @@ -1682,83 +2316,6 @@ typedef struct LDKCResult_NonePaymentSendFailureZ { bool result_ok; } LDKCResult_NonePaymentSendFailureZ; -typedef struct LDKFourBytes { - uint8_t data[4]; -} LDKFourBytes; - -typedef struct LDKSixteenBytes { - uint8_t data[16]; -} LDKSixteenBytes; - -typedef struct LDKTenBytes { - uint8_t data[10]; -} LDKTenBytes; - -/** - * An address which can be used to connect to a remote peer - */ -typedef enum LDKNetAddress_Tag { - /** - * An IPv4 address/port on which the peer is listening. - */ - LDKNetAddress_IPv4, - /** - * An IPv6 address/port on which the peer is listening. - */ - LDKNetAddress_IPv6, - /** - * An old-style Tor onion address/port on which the peer is listening. - */ - LDKNetAddress_OnionV2, - /** - * A new-style Tor onion address/port on which the peer is listening. - * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version, - * wrap as base32 and append \".onion\". - */ - LDKNetAddress_OnionV3, - /** - * Must be last for serialization purposes - */ - LDKNetAddress_Sentinel, -} LDKNetAddress_Tag; - -typedef struct LDKNetAddress_LDKIPv4_Body { - struct LDKFourBytes addr; - uint16_t port; -} LDKNetAddress_LDKIPv4_Body; - -typedef struct LDKNetAddress_LDKIPv6_Body { - struct LDKSixteenBytes addr; - uint16_t port; -} LDKNetAddress_LDKIPv6_Body; - -typedef struct LDKNetAddress_LDKOnionV2_Body { - struct LDKTenBytes addr; - uint16_t port; -} LDKNetAddress_LDKOnionV2_Body; - -typedef struct LDKNetAddress_LDKOnionV3_Body { - struct LDKThirtyTwoBytes ed25519_pubkey; - uint16_t checksum; - uint8_t version; - uint16_t port; -} LDKNetAddress_LDKOnionV3_Body; - -typedef struct MUST_USE_STRUCT LDKNetAddress { - LDKNetAddress_Tag tag; - union { - LDKNetAddress_LDKIPv4_Body i_pv4; - LDKNetAddress_LDKIPv6_Body i_pv6; - LDKNetAddress_LDKOnionV2_Body onion_v2; - LDKNetAddress_LDKOnionV3_Body onion_v3; - }; -} LDKNetAddress; - -typedef struct LDKCVec_NetAddressZ { - struct LDKNetAddress *data; - uintptr_t datalen; -} LDKCVec_NetAddressZ; - typedef struct LDKCVec_ChannelMonitorZ { struct LDKChannelMonitor *data; uintptr_t datalen; @@ -1831,9 +2388,15 @@ typedef struct LDKBroadcasterInterface { void (*free)(void *this_arg); } LDKBroadcasterInterface; -typedef struct LDKSecretKey { - uint8_t bytes[32]; -} LDKSecretKey; +typedef union LDKCResult_ChannelKeysDecodeErrorZPtr { + struct LDKChannelKeys *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelKeysDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelKeysDecodeErrorZ { + union LDKCResult_ChannelKeysDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelKeysDecodeErrorZ; typedef struct LDKu8slice { const uint8_t *data; @@ -1889,7 +2452,7 @@ typedef struct LDKKeysInterface { * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. */ - struct LDKCResult_ChanKeySignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader); + struct LDKCResult_ChannelKeysDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader); void (*free)(void *this_arg); } LDKKeysInterface; @@ -1973,24 +2536,139 @@ typedef struct MUST_USE_STRUCT LDKChannelManager { * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeChannelManager *inner; + LDKnativeChannelManager *inner; + bool is_owned; +} LDKChannelManager; + +typedef struct LDKC2Tuple_BlockHashChannelManagerZ { + struct LDKThirtyTwoBytes a; + struct LDKChannelManager b; +} LDKC2Tuple_BlockHashChannelManagerZ; + +typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { + struct LDKC2Tuple_BlockHashChannelManagerZ *result; + struct LDKDecodeError *err; +} LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr; + +typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ; + +typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr { + struct LDKSpendableOutputDescriptor *result; + struct LDKDecodeError *err; +} LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr; + +typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ { + union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_SpendableOutputDescriptorDecodeErrorZ; + + + +/** + * A simple implementation of ChannelKeys that just keeps the private keys in memory. + * + * This implementation performs no policy checks and is insufficient by itself as + * a secure external signer. + */ +typedef struct MUST_USE_STRUCT LDKInMemoryChannelKeys { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeInMemoryChannelKeys *inner; + bool is_owned; +} LDKInMemoryChannelKeys; + +typedef union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr { + struct LDKInMemoryChannelKeys *result; + struct LDKDecodeError *err; +} LDKCResult_InMemoryChannelKeysDecodeErrorZPtr; + +typedef struct LDKCResult_InMemoryChannelKeysDecodeErrorZ { + union LDKCResult_InMemoryChannelKeysDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_InMemoryChannelKeysDecodeErrorZ; + + + +/** + * A hop in a route + */ +typedef struct MUST_USE_STRUCT LDKRouteHop { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeRouteHop *inner; + bool is_owned; +} LDKRouteHop; + +typedef struct LDKCVec_RouteHopZ { + struct LDKRouteHop *data; + uintptr_t datalen; +} LDKCVec_RouteHopZ; + +typedef struct LDKCVec_CVec_RouteHopZZ { + struct LDKCVec_RouteHopZ *data; + uintptr_t datalen; +} LDKCVec_CVec_RouteHopZZ; + + + +/** + * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP, + * it can take multiple paths. Each path is composed of one or more hops through the network. + */ +typedef struct MUST_USE_STRUCT LDKRoute { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeRoute *inner; + bool is_owned; +} LDKRoute; + +typedef union LDKCResult_RouteDecodeErrorZPtr { + struct LDKRoute *result; + struct LDKDecodeError *err; +} LDKCResult_RouteDecodeErrorZPtr; + +typedef struct LDKCResult_RouteDecodeErrorZ { + union LDKCResult_RouteDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_RouteDecodeErrorZ; + + + +/** + * A channel descriptor which provides a last-hop route to get_route + */ +typedef struct MUST_USE_STRUCT LDKRouteHint { + /** + * Nearly everywhere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeRouteHint *inner; bool is_owned; -} LDKChannelManager; +} LDKRouteHint; -typedef struct LDKC2Tuple_BlockHashChannelManagerZ { - struct LDKThirtyTwoBytes a; - struct LDKChannelManager b; -} LDKC2Tuple_BlockHashChannelManagerZ; +typedef struct LDKCVec_RouteHintZ { + struct LDKRouteHint *data; + uintptr_t datalen; +} LDKCVec_RouteHintZ; -typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { - struct LDKC2Tuple_BlockHashChannelManagerZ *result; - struct LDKDecodeError *err; -} LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr; +typedef union LDKCResult_RouteLightningErrorZPtr { + struct LDKRoute *result; + struct LDKLightningError *err; +} LDKCResult_RouteLightningErrorZPtr; -typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents; +typedef struct LDKCResult_RouteLightningErrorZ { + union LDKCResult_RouteLightningErrorZPtr contents; bool result_ok; -} LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ; +} LDKCResult_RouteLightningErrorZ; typedef union LDKCResult_NetAddressu8ZPtr { struct LDKNetAddress *result; @@ -2012,11 +2690,6 @@ typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ { bool result_ok; } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ; -typedef struct LDKCVec_u64Z { - uint64_t *data; - uintptr_t datalen; -} LDKCVec_u64Z; - /** @@ -2093,638 +2766,466 @@ typedef struct LDKCVec_UpdateFailMalformedHTLCZ { uintptr_t datalen; } LDKCVec_UpdateFailMalformedHTLCZ; - - -/** - * An Err type for failure to process messages. - */ -typedef struct MUST_USE_STRUCT LDKLightningError { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeLightningError *inner; - bool is_owned; -} LDKLightningError; - -typedef union LDKCResult_boolLightningErrorZPtr { - bool *result; - struct LDKLightningError *err; -} LDKCResult_boolLightningErrorZPtr; - -typedef struct LDKCResult_boolLightningErrorZ { - union LDKCResult_boolLightningErrorZPtr contents; - bool result_ok; -} LDKCResult_boolLightningErrorZ; - -typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - struct LDKChannelAnnouncement a; - struct LDKChannelUpdate b; - struct LDKChannelUpdate c; -} LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ; - -typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data; - uintptr_t datalen; -} LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ; - -typedef struct LDKCVec_NodeAnnouncementZ { - struct LDKNodeAnnouncement *data; - uintptr_t datalen; -} LDKCVec_NodeAnnouncementZ; - -typedef union LDKCResult_NoneLightningErrorZPtr { - /** - * Note that this value is always NULL, as there are no contents in the OK variant - */ - void *result; - struct LDKLightningError *err; -} LDKCResult_NoneLightningErrorZPtr; - -typedef struct LDKCResult_NoneLightningErrorZ { - union LDKCResult_NoneLightningErrorZPtr contents; - bool result_ok; -} LDKCResult_NoneLightningErrorZ; - -typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr { - struct LDKChannelReestablish *result; - struct LDKDecodeError *err; -} LDKCResult_ChannelReestablishDecodeErrorZPtr; - -typedef struct LDKCResult_ChannelReestablishDecodeErrorZ { - union LDKCResult_ChannelReestablishDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_ChannelReestablishDecodeErrorZ; - - - -/** - * An init message to be sent or received from a peer - */ -typedef struct MUST_USE_STRUCT LDKInit { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeInit *inner; - bool is_owned; -} LDKInit; - -typedef union LDKCResult_InitDecodeErrorZPtr { - struct LDKInit *result; - struct LDKDecodeError *err; -} LDKCResult_InitDecodeErrorZPtr; - -typedef struct LDKCResult_InitDecodeErrorZ { - union LDKCResult_InitDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_InitDecodeErrorZ; - - - -/** - * A ping message to be sent or received from a peer - */ -typedef struct MUST_USE_STRUCT LDKPing { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativePing *inner; - bool is_owned; -} LDKPing; - -typedef union LDKCResult_PingDecodeErrorZPtr { - struct LDKPing *result; - struct LDKDecodeError *err; -} LDKCResult_PingDecodeErrorZPtr; - -typedef struct LDKCResult_PingDecodeErrorZ { - union LDKCResult_PingDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_PingDecodeErrorZ; - - - -/** - * A pong message to be sent or received from a peer - */ -typedef struct MUST_USE_STRUCT LDKPong { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativePong *inner; - bool is_owned; -} LDKPong; - -typedef union LDKCResult_PongDecodeErrorZPtr { - struct LDKPong *result; - struct LDKDecodeError *err; -} LDKCResult_PongDecodeErrorZPtr; - -typedef struct LDKCResult_PongDecodeErrorZ { - union LDKCResult_PongDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_PongDecodeErrorZ; - -typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr { - struct LDKUnsignedChannelAnnouncement *result; - struct LDKDecodeError *err; -} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr; - -typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ { - union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ; - - - -/** - * The unsigned part of a channel_update - */ -typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeUnsignedChannelUpdate *inner; - bool is_owned; -} LDKUnsignedChannelUpdate; - -typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr { - struct LDKUnsignedChannelUpdate *result; - struct LDKDecodeError *err; -} LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr; - -typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ { - union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_UnsignedChannelUpdateDecodeErrorZ; - -typedef union LDKCResult_ErrorMessageDecodeErrorZPtr { - struct LDKErrorMessage *result; - struct LDKDecodeError *err; -} LDKCResult_ErrorMessageDecodeErrorZPtr; - -typedef struct LDKCResult_ErrorMessageDecodeErrorZ { - union LDKCResult_ErrorMessageDecodeErrorZPtr contents; - bool result_ok; -} LDKCResult_ErrorMessageDecodeErrorZ; - - - -/** - * The unsigned part of a node_announcement - */ -typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeUnsignedNodeAnnouncement *inner; - bool is_owned; -} LDKUnsignedNodeAnnouncement; - -typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr { - struct LDKUnsignedNodeAnnouncement *result; +typedef union LDKCResult_AcceptChannelDecodeErrorZPtr { + struct LDKAcceptChannel *result; struct LDKDecodeError *err; -} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr; +} LDKCResult_AcceptChannelDecodeErrorZPtr; -typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ { - union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents; +typedef struct LDKCResult_AcceptChannelDecodeErrorZ { + union LDKCResult_AcceptChannelDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ; +} LDKCResult_AcceptChannelDecodeErrorZ; -typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr { - struct LDKQueryShortChannelIds *result; +typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr { + struct LDKAnnouncementSignatures *result; struct LDKDecodeError *err; -} LDKCResult_QueryShortChannelIdsDecodeErrorZPtr; +} LDKCResult_AnnouncementSignaturesDecodeErrorZPtr; -typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ { - union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents; +typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ { + union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_QueryShortChannelIdsDecodeErrorZ; - - - -/** - * A reply_short_channel_ids_end message is sent as a reply to a - * query_short_channel_ids message. The query recipient makes a best - * effort to respond based on their local network view which may not be - * a perfect view of the network. - */ -typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeReplyShortChannelIdsEnd *inner; - bool is_owned; -} LDKReplyShortChannelIdsEnd; - -typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr { - struct LDKReplyShortChannelIdsEnd *result; +} LDKCResult_AnnouncementSignaturesDecodeErrorZ; + +typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr { + struct LDKChannelReestablish *result; struct LDKDecodeError *err; -} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr; +} LDKCResult_ChannelReestablishDecodeErrorZPtr; -typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ { - union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents; +typedef struct LDKCResult_ChannelReestablishDecodeErrorZ { + union LDKCResult_ChannelReestablishDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ; +} LDKCResult_ChannelReestablishDecodeErrorZ; -typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr { - struct LDKQueryChannelRange *result; +typedef union LDKCResult_ClosingSignedDecodeErrorZPtr { + struct LDKClosingSigned *result; struct LDKDecodeError *err; -} LDKCResult_QueryChannelRangeDecodeErrorZPtr; +} LDKCResult_ClosingSignedDecodeErrorZPtr; -typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ { - union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents; +typedef struct LDKCResult_ClosingSignedDecodeErrorZ { + union LDKCResult_ClosingSignedDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_QueryChannelRangeDecodeErrorZ; +} LDKCResult_ClosingSignedDecodeErrorZ; /** - * A reply_channel_range message is a reply to a query_channel_range - * message. Multiple reply_channel_range messages can be sent in reply - * to a single query_channel_range message. The query recipient makes a - * best effort to respond based on their local network view which may - * not be a perfect view of the network. The short_channel_ids in the - * reply are encoded. We only support encoding_type=0 uncompressed - * serialization and do not support encoding_type=1 zlib serialization. + * A commitment_signed message to be sent or received from a peer */ -typedef struct MUST_USE_STRUCT LDKReplyChannelRange { +typedef struct MUST_USE_STRUCT LDKCommitmentSigned { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeReplyChannelRange *inner; + LDKnativeCommitmentSigned *inner; bool is_owned; -} LDKReplyChannelRange; +} LDKCommitmentSigned; -typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr { - struct LDKReplyChannelRange *result; +typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr { + struct LDKCommitmentSigned *result; struct LDKDecodeError *err; -} LDKCResult_ReplyChannelRangeDecodeErrorZPtr; +} LDKCResult_CommitmentSignedDecodeErrorZPtr; -typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ { - union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents; +typedef struct LDKCResult_CommitmentSignedDecodeErrorZ { + union LDKCResult_CommitmentSignedDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_ReplyChannelRangeDecodeErrorZ; - +} LDKCResult_CommitmentSignedDecodeErrorZ; +typedef union LDKCResult_FundingCreatedDecodeErrorZPtr { + struct LDKFundingCreated *result; + struct LDKDecodeError *err; +} LDKCResult_FundingCreatedDecodeErrorZPtr; -/** - * A gossip_timestamp_filter message is used by a node to request - * gossip relay for messages in the requested time range when the - * gossip_queries feature has been negotiated. - */ -typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeGossipTimestampFilter *inner; - bool is_owned; -} LDKGossipTimestampFilter; +typedef struct LDKCResult_FundingCreatedDecodeErrorZ { + union LDKCResult_FundingCreatedDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_FundingCreatedDecodeErrorZ; -typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr { - struct LDKGossipTimestampFilter *result; +typedef union LDKCResult_FundingSignedDecodeErrorZPtr { + struct LDKFundingSigned *result; struct LDKDecodeError *err; -} LDKCResult_GossipTimestampFilterDecodeErrorZPtr; +} LDKCResult_FundingSignedDecodeErrorZPtr; -typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ { - union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents; +typedef struct LDKCResult_FundingSignedDecodeErrorZ { + union LDKCResult_FundingSignedDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_GossipTimestampFilterDecodeErrorZ; +} LDKCResult_FundingSignedDecodeErrorZ; -typedef struct LDKCVec_PublicKeyZ { - struct LDKPublicKey *data; - uintptr_t datalen; -} LDKCVec_PublicKeyZ; +typedef union LDKCResult_FundingLockedDecodeErrorZPtr { + struct LDKFundingLocked *result; + struct LDKDecodeError *err; +} LDKCResult_FundingLockedDecodeErrorZPtr; + +typedef struct LDKCResult_FundingLockedDecodeErrorZ { + union LDKCResult_FundingLockedDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_FundingLockedDecodeErrorZ; /** - * Error for PeerManager errors. If you get one of these, you must disconnect the socket and - * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the - * descriptor. + * An init message to be sent or received from a peer */ -typedef struct MUST_USE_STRUCT LDKPeerHandleError { +typedef struct MUST_USE_STRUCT LDKInit { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativePeerHandleError *inner; + LDKnativeInit *inner; bool is_owned; -} LDKPeerHandleError; +} LDKInit; -typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr { - struct LDKCVec_u8Z *result; - struct LDKPeerHandleError *err; -} LDKCResult_CVec_u8ZPeerHandleErrorZPtr; +typedef union LDKCResult_InitDecodeErrorZPtr { + struct LDKInit *result; + struct LDKDecodeError *err; +} LDKCResult_InitDecodeErrorZPtr; -typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ { - union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents; +typedef struct LDKCResult_InitDecodeErrorZ { + union LDKCResult_InitDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_CVec_u8ZPeerHandleErrorZ; +} LDKCResult_InitDecodeErrorZ; -typedef union LDKCResult_NonePeerHandleErrorZPtr { - /** - * Note that this value is always NULL, as there are no contents in the OK variant - */ - void *result; - struct LDKPeerHandleError *err; -} LDKCResult_NonePeerHandleErrorZPtr; +typedef union LDKCResult_OpenChannelDecodeErrorZPtr { + struct LDKOpenChannel *result; + struct LDKDecodeError *err; +} LDKCResult_OpenChannelDecodeErrorZPtr; -typedef struct LDKCResult_NonePeerHandleErrorZ { - union LDKCResult_NonePeerHandleErrorZPtr contents; +typedef struct LDKCResult_OpenChannelDecodeErrorZ { + union LDKCResult_OpenChannelDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_NonePeerHandleErrorZ; +} LDKCResult_OpenChannelDecodeErrorZ; -typedef union LDKCResult_boolPeerHandleErrorZPtr { - bool *result; - struct LDKPeerHandleError *err; -} LDKCResult_boolPeerHandleErrorZPtr; +typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr { + struct LDKRevokeAndACK *result; + struct LDKDecodeError *err; +} LDKCResult_RevokeAndACKDecodeErrorZPtr; -typedef struct LDKCResult_boolPeerHandleErrorZ { - union LDKCResult_boolPeerHandleErrorZPtr contents; +typedef struct LDKCResult_RevokeAndACKDecodeErrorZ { + union LDKCResult_RevokeAndACKDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_boolPeerHandleErrorZ; +} LDKCResult_RevokeAndACKDecodeErrorZ; -typedef union LDKCResult_SecretKeySecpErrorZPtr { - struct LDKSecretKey *result; - enum LDKSecp256k1Error *err; -} LDKCResult_SecretKeySecpErrorZPtr; +typedef union LDKCResult_ShutdownDecodeErrorZPtr { + struct LDKShutdown *result; + struct LDKDecodeError *err; +} LDKCResult_ShutdownDecodeErrorZPtr; -typedef struct LDKCResult_SecretKeySecpErrorZ { - union LDKCResult_SecretKeySecpErrorZPtr contents; +typedef struct LDKCResult_ShutdownDecodeErrorZ { + union LDKCResult_ShutdownDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_SecretKeySecpErrorZ; +} LDKCResult_ShutdownDecodeErrorZ; -typedef union LDKCResult_PublicKeySecpErrorZPtr { - struct LDKPublicKey *result; - enum LDKSecp256k1Error *err; -} LDKCResult_PublicKeySecpErrorZPtr; +typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr { + struct LDKUpdateFailHTLC *result; + struct LDKDecodeError *err; +} LDKCResult_UpdateFailHTLCDecodeErrorZPtr; + +typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ { + union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_UpdateFailHTLCDecodeErrorZ; + +typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr { + struct LDKUpdateFailMalformedHTLC *result; + struct LDKDecodeError *err; +} LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr; -typedef struct LDKCResult_PublicKeySecpErrorZ { - union LDKCResult_PublicKeySecpErrorZPtr contents; +typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ { + union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_PublicKeySecpErrorZ; +} LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ; /** - * The set of public keys which are used in the creation of one commitment transaction. - * These are derived from the channel base keys and per-commitment data. - * - * A broadcaster key is provided from potential broadcaster of the computed transaction. - * A countersignatory key is coming from a protocol participant unable to broadcast the - * transaction. - * - * These keys are assumed to be good, either because the code derived them from - * channel basepoints via the new function, or they were obtained via - * CommitmentTransaction.trust().keys() because we trusted the source of the - * pre-calculated keys. + * An update_fee message to be sent or received from a peer */ -typedef struct MUST_USE_STRUCT LDKTxCreationKeys { +typedef struct MUST_USE_STRUCT LDKUpdateFee { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeTxCreationKeys *inner; + LDKnativeUpdateFee *inner; bool is_owned; -} LDKTxCreationKeys; +} LDKUpdateFee; -typedef union LDKCResult_TxCreationKeysSecpErrorZPtr { - struct LDKTxCreationKeys *result; - enum LDKSecp256k1Error *err; -} LDKCResult_TxCreationKeysSecpErrorZPtr; +typedef union LDKCResult_UpdateFeeDecodeErrorZPtr { + struct LDKUpdateFee *result; + struct LDKDecodeError *err; +} LDKCResult_UpdateFeeDecodeErrorZPtr; + +typedef struct LDKCResult_UpdateFeeDecodeErrorZ { + union LDKCResult_UpdateFeeDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_UpdateFeeDecodeErrorZ; + +typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr { + struct LDKUpdateFulfillHTLC *result; + struct LDKDecodeError *err; +} LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr; -typedef struct LDKCResult_TxCreationKeysSecpErrorZ { - union LDKCResult_TxCreationKeysSecpErrorZPtr contents; +typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ { + union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_TxCreationKeysSecpErrorZ; +} LDKCResult_UpdateFulfillHTLCDecodeErrorZ; + +typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr { + struct LDKUpdateAddHTLC *result; + struct LDKDecodeError *err; +} LDKCResult_UpdateAddHTLCDecodeErrorZPtr; + +typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ { + union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_UpdateAddHTLCDecodeErrorZ; /** - * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin - * transaction and the transaction creation keys) are trusted. - * - * See trust() and verify() functions on CommitmentTransaction. - * - * This structure implements Deref. + * A ping message to be sent or received from a peer */ -typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction { +typedef struct MUST_USE_STRUCT LDKPing { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeTrustedCommitmentTransaction *inner; + LDKnativePing *inner; bool is_owned; -} LDKTrustedCommitmentTransaction; - -typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr { - struct LDKTrustedCommitmentTransaction *result; - /** - * Note that this value is always NULL, as there are no contents in the Err variant - */ - void *err; -} LDKCResult_TrustedCommitmentTransactionNoneZPtr; - -typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ { - union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents; - bool result_ok; -} LDKCResult_TrustedCommitmentTransactionNoneZ; +} LDKPing; -typedef union LDKCResult_CVec_SignatureZNoneZPtr { - struct LDKCVec_SignatureZ *result; - /** - * Note that this value is always NULL, as there are no contents in the Err variant - */ - void *err; -} LDKCResult_CVec_SignatureZNoneZPtr; +typedef union LDKCResult_PingDecodeErrorZPtr { + struct LDKPing *result; + struct LDKDecodeError *err; +} LDKCResult_PingDecodeErrorZPtr; -typedef struct LDKCResult_CVec_SignatureZNoneZ { - union LDKCResult_CVec_SignatureZNoneZPtr contents; +typedef struct LDKCResult_PingDecodeErrorZ { + union LDKCResult_PingDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_CVec_SignatureZNoneZ; +} LDKCResult_PingDecodeErrorZ; /** - * A hop in a route + * A pong message to be sent or received from a peer */ -typedef struct MUST_USE_STRUCT LDKRouteHop { +typedef struct MUST_USE_STRUCT LDKPong { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeRouteHop *inner; + LDKnativePong *inner; bool is_owned; -} LDKRouteHop; +} LDKPong; -typedef struct LDKCVec_RouteHopZ { - struct LDKRouteHop *data; - uintptr_t datalen; -} LDKCVec_RouteHopZ; +typedef union LDKCResult_PongDecodeErrorZPtr { + struct LDKPong *result; + struct LDKDecodeError *err; +} LDKCResult_PongDecodeErrorZPtr; -typedef struct LDKCVec_CVec_RouteHopZZ { - struct LDKCVec_RouteHopZ *data; - uintptr_t datalen; -} LDKCVec_CVec_RouteHopZZ; +typedef struct LDKCResult_PongDecodeErrorZ { + union LDKCResult_PongDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_PongDecodeErrorZ; + +typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr { + struct LDKUnsignedChannelAnnouncement *result; + struct LDKDecodeError *err; +} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr; + +typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ { + union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ; + +typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr { + struct LDKChannelAnnouncement *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelAnnouncementDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ { + union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelAnnouncementDecodeErrorZ; /** - * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP, - * it can take multiple paths. Each path is composed of one or more hops through the network. + * The unsigned part of a channel_update */ -typedef struct MUST_USE_STRUCT LDKRoute { +typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeRoute *inner; + LDKnativeUnsignedChannelUpdate *inner; bool is_owned; -} LDKRoute; +} LDKUnsignedChannelUpdate; -typedef union LDKCResult_RouteDecodeErrorZPtr { - struct LDKRoute *result; +typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr { + struct LDKUnsignedChannelUpdate *result; + struct LDKDecodeError *err; +} LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr; + +typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ { + union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_UnsignedChannelUpdateDecodeErrorZ; + +typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr { + struct LDKChannelUpdate *result; + struct LDKDecodeError *err; +} LDKCResult_ChannelUpdateDecodeErrorZPtr; + +typedef struct LDKCResult_ChannelUpdateDecodeErrorZ { + union LDKCResult_ChannelUpdateDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_ChannelUpdateDecodeErrorZ; + +typedef union LDKCResult_ErrorMessageDecodeErrorZPtr { + struct LDKErrorMessage *result; struct LDKDecodeError *err; -} LDKCResult_RouteDecodeErrorZPtr; +} LDKCResult_ErrorMessageDecodeErrorZPtr; -typedef struct LDKCResult_RouteDecodeErrorZ { - union LDKCResult_RouteDecodeErrorZPtr contents; +typedef struct LDKCResult_ErrorMessageDecodeErrorZ { + union LDKCResult_ErrorMessageDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_RouteDecodeErrorZ; +} LDKCResult_ErrorMessageDecodeErrorZ; /** - * A channel descriptor which provides a last-hop route to get_route + * The unsigned part of a node_announcement */ -typedef struct MUST_USE_STRUCT LDKRouteHint { +typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeRouteHint *inner; + LDKnativeUnsignedNodeAnnouncement *inner; bool is_owned; -} LDKRouteHint; - -typedef struct LDKCVec_RouteHintZ { - struct LDKRouteHint *data; - uintptr_t datalen; -} LDKCVec_RouteHintZ; +} LDKUnsignedNodeAnnouncement; -typedef union LDKCResult_RouteLightningErrorZPtr { - struct LDKRoute *result; - struct LDKLightningError *err; -} LDKCResult_RouteLightningErrorZPtr; +typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr { + struct LDKUnsignedNodeAnnouncement *result; + struct LDKDecodeError *err; +} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr; -typedef struct LDKCResult_RouteLightningErrorZ { - union LDKCResult_RouteLightningErrorZPtr contents; +typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ { + union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_RouteLightningErrorZ; - +} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ; +typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr { + struct LDKNodeAnnouncement *result; + struct LDKDecodeError *err; +} LDKCResult_NodeAnnouncementDecodeErrorZPtr; -/** - * Fees for routing via a given channel or a node - */ -typedef struct MUST_USE_STRUCT LDKRoutingFees { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeRoutingFees *inner; - bool is_owned; -} LDKRoutingFees; +typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ { + union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_NodeAnnouncementDecodeErrorZ; -typedef union LDKCResult_RoutingFeesDecodeErrorZPtr { - struct LDKRoutingFees *result; +typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr { + struct LDKQueryShortChannelIds *result; struct LDKDecodeError *err; -} LDKCResult_RoutingFeesDecodeErrorZPtr; +} LDKCResult_QueryShortChannelIdsDecodeErrorZPtr; -typedef struct LDKCResult_RoutingFeesDecodeErrorZ { - union LDKCResult_RoutingFeesDecodeErrorZPtr contents; +typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ { + union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_RoutingFeesDecodeErrorZ; +} LDKCResult_QueryShortChannelIdsDecodeErrorZ; /** - * Information received in the latest node_announcement from this node. + * A reply_short_channel_ids_end message is sent as a reply to a + * query_short_channel_ids message. The query recipient makes a best + * effort to respond based on their local network view which may not be + * a perfect view of the network. */ -typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo { +typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeNodeAnnouncementInfo *inner; + LDKnativeReplyShortChannelIdsEnd *inner; bool is_owned; -} LDKNodeAnnouncementInfo; +} LDKReplyShortChannelIdsEnd; -typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr { - struct LDKNodeAnnouncementInfo *result; +typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr { + struct LDKReplyShortChannelIdsEnd *result; struct LDKDecodeError *err; -} LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr; +} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr; -typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ { - union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents; +typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ { + union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_NodeAnnouncementInfoDecodeErrorZ; +} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ; + +typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr { + struct LDKQueryChannelRange *result; + struct LDKDecodeError *err; +} LDKCResult_QueryChannelRangeDecodeErrorZPtr; + +typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ { + union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents; + bool result_ok; +} LDKCResult_QueryChannelRangeDecodeErrorZ; /** - * Details about a node in the network, known from the network announcement. + * A reply_channel_range message is a reply to a query_channel_range + * message. Multiple reply_channel_range messages can be sent in reply + * to a single query_channel_range message. The query recipient makes a + * best effort to respond based on their local network view which may + * not be a perfect view of the network. The short_channel_ids in the + * reply are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. */ -typedef struct MUST_USE_STRUCT LDKNodeInfo { +typedef struct MUST_USE_STRUCT LDKReplyChannelRange { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeNodeInfo *inner; + LDKnativeReplyChannelRange *inner; bool is_owned; -} LDKNodeInfo; +} LDKReplyChannelRange; -typedef union LDKCResult_NodeInfoDecodeErrorZPtr { - struct LDKNodeInfo *result; +typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr { + struct LDKReplyChannelRange *result; struct LDKDecodeError *err; -} LDKCResult_NodeInfoDecodeErrorZPtr; +} LDKCResult_ReplyChannelRangeDecodeErrorZPtr; -typedef struct LDKCResult_NodeInfoDecodeErrorZ { - union LDKCResult_NodeInfoDecodeErrorZPtr contents; +typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ { + union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_NodeInfoDecodeErrorZ; +} LDKCResult_ReplyChannelRangeDecodeErrorZ; /** - * Represents the network as nodes and channels between them + * A gossip_timestamp_filter message is used by a node to request + * gossip relay for messages in the requested time range when the + * gossip_queries feature has been negotiated. */ -typedef struct MUST_USE_STRUCT LDKNetworkGraph { +typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeNetworkGraph *inner; + LDKnativeGossipTimestampFilter *inner; bool is_owned; -} LDKNetworkGraph; +} LDKGossipTimestampFilter; -typedef union LDKCResult_NetworkGraphDecodeErrorZPtr { - struct LDKNetworkGraph *result; +typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr { + struct LDKGossipTimestampFilter *result; struct LDKDecodeError *err; -} LDKCResult_NetworkGraphDecodeErrorZPtr; +} LDKCResult_GossipTimestampFilterDecodeErrorZPtr; -typedef struct LDKCResult_NetworkGraphDecodeErrorZ { - union LDKCResult_NetworkGraphDecodeErrorZPtr contents; +typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ { + union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_NetworkGraphDecodeErrorZ; +} LDKCResult_GossipTimestampFilterDecodeErrorZ; /** * A trait indicating an object may generate message send events @@ -2794,21 +3295,6 @@ typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits { -/** - * Options which apply on a per-channel basis and may change at runtime or based on negotiation - * with our counterparty. - */ -typedef struct MUST_USE_STRUCT LDKChannelConfig { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeChannelConfig *inner; - bool is_owned; -} LDKChannelConfig; - - - /** * Top-level config which holds ChannelHandshakeLimits and ChannelConfig. * @@ -2966,24 +3452,6 @@ typedef struct MUST_USE_STRUCT LDKChainMonitor { -/** - * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on - * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the - * preimage claim backward will lead to loss of funds. - * - * [`chain::Watch`]: ../trait.Watch.html - */ -typedef struct MUST_USE_STRUCT LDKHTLCUpdate { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeHTLCUpdate *inner; - bool is_owned; -} LDKHTLCUpdate; - - - /** * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key * and derives keys from that. @@ -3002,52 +3470,10 @@ typedef struct MUST_USE_STRUCT LDKKeysManager { bool is_owned; } LDKKeysManager; - - -/** - * Features used within an `init` message. - */ -typedef struct MUST_USE_STRUCT LDKInitFeatures { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeInitFeatures *inner; - bool is_owned; -} LDKInitFeatures; - typedef struct LDKThreeBytes { uint8_t data[3]; } LDKThreeBytes; - - -/** - * A commitment_signed message to be sent or received from a peer - */ -typedef struct MUST_USE_STRUCT LDKCommitmentSigned { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeCommitmentSigned *inner; - bool is_owned; -} LDKCommitmentSigned; - - - -/** - * An update_fee message to be sent or received from a peer - */ -typedef struct MUST_USE_STRUCT LDKUpdateFee { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeUpdateFee *inner; - bool is_owned; -} LDKUpdateFee; - /** * A trait to describe an object which can receive channel messages. * @@ -3148,68 +3574,40 @@ typedef struct LDKChannelMessageHandler { * is: * 1) Deserialize all stored ChannelMonitors. * 2) Deserialize the ChannelManager by filling in this struct and calling <(Sha256dHash, - * ChannelManager)>::read(reader, args). - * This may result in closing some Channels if the ChannelMonitor is newer than the stored - * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted. - * 3) Register all relevant ChannelMonitor outpoints with your chain watch mechanism using - * ChannelMonitor::get_outputs_to_watch() and ChannelMonitor::get_funding_txo(). - * 4) Reconnect blocks on your ChannelMonitors. - * 5) Move the ChannelMonitors into your local chain::Watch. - * 6) Disconnect/connect blocks on the ChannelManager. - */ -typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeChannelManagerReadArgs *inner; - bool is_owned; -} LDKChannelManagerReadArgs; - - - -/** - * Proof that the sender knows the per-commitment secret of the previous commitment transaction. - * This is used to convince the recipient that the channel is at a certain commitment - * number even if they lost that data due to a local failure. Of course, the peer may lie - * and even later commitments may have been revoked. - */ -typedef struct MUST_USE_STRUCT LDKDataLossProtect { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeDataLossProtect *inner; - bool is_owned; -} LDKDataLossProtect; - - - -/** - * Features used within a `node_announcement` message. + * ChannelManager)>::read(reader, args). + * This may result in closing some Channels if the ChannelMonitor is newer than the stored + * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted. + * 3) Register all relevant ChannelMonitor outpoints with your chain watch mechanism using + * ChannelMonitor::get_outputs_to_watch() and ChannelMonitor::get_funding_txo(). + * 4) Reconnect blocks on your ChannelMonitors. + * 5) Move the ChannelMonitors into your local chain::Watch. + * 6) Disconnect/connect blocks on the ChannelManager. */ -typedef struct MUST_USE_STRUCT LDKNodeFeatures { +typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeNodeFeatures *inner; + LDKnativeChannelManagerReadArgs *inner; bool is_owned; -} LDKNodeFeatures; +} LDKChannelManagerReadArgs; /** - * Features used within a `channel_announcement` message. + * Proof that the sender knows the per-commitment secret of the previous commitment transaction. + * This is used to convince the recipient that the channel is at a certain commitment + * number even if they lost that data due to a local failure. Of course, the peer may lie + * and even later commitments may have been revoked. */ -typedef struct MUST_USE_STRUCT LDKChannelFeatures { +typedef struct MUST_USE_STRUCT LDKDataLossProtect { /** * Nearly everywhere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeChannelFeatures *inner; + LDKnativeDataLossProtect *inner; bool is_owned; -} LDKChannelFeatures; +} LDKDataLossProtect; /** * A trait to describe an object which can receive routing messages. @@ -3370,20 +3768,6 @@ typedef struct MUST_USE_STRUCT LDKPeerManager { -/** - * Late-bound per-channel counterparty data used to build transactions. - */ -typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeCounterpartyChannelTransactionParameters *inner; - bool is_owned; -} LDKCounterpartyChannelTransactionParameters; - - - /** * Static channel fields used to build transactions given per-commitment fields, organized by * broadcaster/countersignatory. @@ -3402,20 +3786,6 @@ typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters { -/** - * A pre-built Bitcoin commitment transaction and its txid. - */ -typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeBuiltCommitmentTransaction *inner; - bool is_owned; -} LDKBuiltCommitmentTransaction; - - - /** * A simple newtype for RwLockReadGuard<'a, NetworkGraph>. * This exists only to make accessing a RwLock possible from @@ -3448,36 +3818,6 @@ typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler { bool is_owned; } LDKNetGraphMsgHandler; - - -/** - * Details about one direction of a channel. Received - * within a channel update. - */ -typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeDirectionalChannelInfo *inner; - bool is_owned; -} LDKDirectionalChannelInfo; - - - -/** - * Details about a channel (both directions). - * Received within a channel announcement. - */ -typedef struct MUST_USE_STRUCT LDKChannelInfo { - /** - * Nearly everywhere, inner must be non-null, however in places where - * the Rust equivalent takes an Option, it may be set to null to indicate None. - */ - LDKnativeChannelInfo *inner; - bool is_owned; -} LDKChannelInfo; - extern const uintptr_t MAX_BUF_SIZE; extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT; @@ -3490,11 +3830,233 @@ void TxOut_free(struct LDKTxOut _res); struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig); -void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); +struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o); + +struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e); + +void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res); + +struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); + +struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); + +void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); + +struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o); + +struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res); + +struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o); + +struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res); + +struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o); + +struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e); + +void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); + +struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); + +struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res); + +struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o); + +struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res); + +struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o); + +struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res); + +struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); + +void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); + +struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o); + +struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res); + +struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o); + +struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res); + +struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o); + +struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res); + +struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); + +struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); + +void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); + +struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); + +struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); + +void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); + +struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig); + +void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); + +void CVec_u8Z_free(struct LDKCVec_u8Z _res); + +struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o); + +struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); + +void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res); + +struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig); + +struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void); + +struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e); + +void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res); + +struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig); + +struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o); + +struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e); + +void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res); + +struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); + +struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); + +struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); + +struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o); + +struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); + +struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o); + +struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); + +struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o); + +struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res); + +struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); + +struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); + +void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); + +struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); + +struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); + +struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); + +void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); + +void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); + +void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res); + +struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); + +struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); + +void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); + +struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); -void CVec_EventZ_free(struct LDKCVec_EventZ _res); +struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o); + +struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res); + +struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o); + +struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); + +struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); + +struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); + +struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); + +void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); + +struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); + +struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); + +struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); + +void CVec_u64Z_free(struct LDKCVec_u64Z _res); + +struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); + +struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); + +struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); + +struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); @@ -3508,9 +4070,19 @@ struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateE void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); -struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig); +struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig); + +void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); + +void CVec_EventZ_free(struct LDKCVec_EventZ _res); + +struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o); + +struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); -void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); +struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); @@ -3520,6 +4092,14 @@ void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMoni struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o); + +struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res); + +struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig); + struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void); struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e); @@ -3528,6 +4108,8 @@ void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErr struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig); +struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig); + struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); @@ -3558,6 +4140,46 @@ struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_B void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res); +void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); + +struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); + +struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); + +void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); + +struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); + +struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); + +struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); + +void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); + +struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); + +void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); + +struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); + +struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); + +void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); + +struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); + +void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); + +struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); + +void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); + +struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); + +struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); + struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); @@ -3566,8 +4188,6 @@ void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_Spenda struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); -void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); - struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig); struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); @@ -3590,13 +4210,13 @@ void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res); struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig); -struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_ok(struct LDKChannelKeys o); +struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_ok(struct LDKChannelKeys o); -struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_err(struct LDKDecodeError e); +struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_ChanKeySignerDecodeErrorZ_free(struct LDKCResult_ChanKeySignerDecodeErrorZ _res); +void CResult_ChannelKeysDecodeErrorZ_free(struct LDKCResult_ChannelKeysDecodeErrorZ _res); -struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_clone(const struct LDKCResult_ChanKeySignerDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelKeysDecodeErrorZ *NONNULL_PTR orig); struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o); @@ -3606,45 +4226,27 @@ void CResult_InMemoryChannelKeysDecodeErrorZ_free(struct LDKCResult_InMemoryChan struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_clone(const struct LDKCResult_InMemoryChannelKeysDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); - -struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); - -void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); - -struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); - -struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); - -struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); - -void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); - -struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); - -void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); - -struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); +void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); -struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); +void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res); -void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); +struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); -struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); +struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); -void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); +void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); -void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); +struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig); -struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); +void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); -void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); +struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); -struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); +struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); -struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); -void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); +struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o); @@ -3662,8 +4264,6 @@ void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_Ne struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig); -void CVec_u64Z_free(struct LDKCVec_u64Z _res); - void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res); void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res); @@ -3672,247 +4272,253 @@ void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res); void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res); -struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); +struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o); -struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); +struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); +void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res); -struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); +struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig); -struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); +struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o); -struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); +struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e); -void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); +void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res); -void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); +struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig); -void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res); +struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o); -struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); +struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); +void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res); -void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); +struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); +struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o); -struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o); +struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res); -void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res); +struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o); -struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o); +struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res); -void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res); +struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o); -struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o); +struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res); -void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res); +struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o); -struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o); +struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res); -void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res); +struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o); -struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o); +struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res); -void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res); +struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o); -struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o); +struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res); -void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res); +struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o); -struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); +struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res); -void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); +struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o); -struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); +struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res); -void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); +struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o); -struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); +struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res); -void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); +struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o); -struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); +struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res); -void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); +struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o); -struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); +struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res); -void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); +struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o); -struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); +struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res); -void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); +struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o); -struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); +struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); +void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res); -void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); +struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o); -void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); +struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e); -void CVec_u8Z_free(struct LDKCVec_u8Z _res); +void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res); -struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o); +struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); +struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o); -void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res); +struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig); +void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res); -struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void); +struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e); +struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o); -void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res); +struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig); +void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res); -struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o); +struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e); +struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o); -void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res); +struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); +void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res); + +struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); + +struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o); -struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_ok(struct LDKSecretKey o); +struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_err(enum LDKSecp256k1Error e); +void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res); -void CResult_SecretKeySecpErrorZ_free(struct LDKCResult_SecretKeySecpErrorZ _res); +struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_ok(struct LDKPublicKey o); +struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o); -struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_err(enum LDKSecp256k1Error e); +struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_PublicKeySecpErrorZ_free(struct LDKCResult_PublicKeySecpErrorZ _res); +void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res); -struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_ok(struct LDKTxCreationKeys o); +struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_err(enum LDKSecp256k1Error e); +struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o); -void CResult_TxCreationKeysSecpErrorZ_free(struct LDKCResult_TxCreationKeysSecpErrorZ _res); +struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); +void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res); -struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); +struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig); -void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); +struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); -struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); +struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); +void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); -void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); +struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig); +struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); -void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); +struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); -void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res); +void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); -struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); +struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); +struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o); -void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); +struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); -struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig); +void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res); -void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); +struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); +struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); -struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); +struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); +void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); -struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); +struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); +struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); -struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); +struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); +void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); -struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); +struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); -struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); +struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); +void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); -struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); +struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); -struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); +struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); +void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); -struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig); -struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); +struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); -struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); +struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); + +void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); -void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); +struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); void Event_free(struct LDKEvent this_ptr); @@ -3952,8 +4558,6 @@ void Logger_free(struct LDKLogger this_ptr); void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr); -struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); - /** * Confirmations we will wait for before considering the channel locked in. * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the @@ -4028,12 +4632,12 @@ void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshake MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg); +struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); + MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr); -struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); - /** * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so * only applies to inbound channels. @@ -4222,12 +4826,12 @@ void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLi MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint64_t min_dust_limit_satoshis_arg, uint64_t max_dust_limit_satoshis_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg); +struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); + MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); void ChannelConfig_free(struct LDKChannelConfig this_ptr); -struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); - /** * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi. * This may be allowed to change at runtime in a later update, however doing so must result in @@ -4308,16 +4912,16 @@ void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *N MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg); +struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); + MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void); struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj); -struct LDKChannelConfig ChannelConfig_read(struct LDKu8slice ser); +struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser); void UserConfig_free(struct LDKUserConfig this_ptr); -struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); - /** * Channel config that we propose to our counterparty. */ @@ -4350,6 +4954,8 @@ void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg); +struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); + MUST_USE_RES struct LDKUserConfig UserConfig_default(void); enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig); @@ -4428,8 +5034,6 @@ struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMon void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr); -struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); - /** * The sequence number of this update. Updates *must* be replayed in-order according to this * sequence number (and updates may panic if they are not). The update_id values are strictly @@ -4464,6 +5068,8 @@ uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate */ void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); +struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); + struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); @@ -4484,7 +5090,7 @@ struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR or struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); -struct LDKHTLCUpdate HTLCUpdate_read(struct LDKu8slice ser); +struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser); void ChannelMonitor_free(struct LDKChannelMonitor this_ptr); @@ -4570,8 +5176,6 @@ struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHash void OutPoint_free(struct LDKOutPoint this_ptr); -struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); - /** * The referenced transaction's txid. */ @@ -4594,6 +5198,8 @@ void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val); MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg); +struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); + /** * Convert an `OutPoint` to a lightning channel id. */ @@ -4601,7 +5207,7 @@ MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOut struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); -struct LDKOutPoint OutPoint_read(struct LDKu8slice ser); +struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser); void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr); @@ -4625,8 +5231,6 @@ void KeysInterface_free(struct LDKKeysInterface this_ptr); void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr); -struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig); - /** * Private key of anchor tx */ @@ -4687,6 +5291,8 @@ const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemory */ void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig); + /** * Create a new InMemoryChannelKeys */ @@ -4780,8 +5386,6 @@ void ChannelManager_free(struct LDKChannelManager this_ptr); void ChannelDetails_free(struct LDKChannelDetails this_ptr); -struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); - /** * The channel's ID (prior to funding transaction generation, this is a random 32 bytes, * thereafter this is the txid of the funding transaction xor the funding transaction output). @@ -4888,6 +5492,8 @@ bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this */ void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); +struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); + void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig); @@ -5235,8 +5841,6 @@ struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); void ErrorMessage_free(struct LDKErrorMessage this_ptr); -struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); - /** * The channel ID involved in the error */ @@ -5265,9 +5869,9 @@ void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg); -void Ping_free(struct LDKPing this_ptr); +struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); -struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); +void Ping_free(struct LDKPing this_ptr); /** * The desired response length @@ -5293,9 +5897,9 @@ void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg); -void Pong_free(struct LDKPong this_ptr); +struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); -struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); +void Pong_free(struct LDKPong this_ptr); /** * The pong packet size. @@ -5311,9 +5915,9 @@ void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val); MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg); -void OpenChannel_free(struct LDKOpenChannel this_ptr); +struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); -struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); +void OpenChannel_free(struct LDKOpenChannel this_ptr); /** * The genesis hash of the blockchain where the channel is to be opened @@ -5495,9 +6099,9 @@ uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR t */ void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val); -void AcceptChannel_free(struct LDKAcceptChannel this_ptr); +struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); -struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); +void AcceptChannel_free(struct LDKAcceptChannel this_ptr); /** * A temporary channel ID, until the funding outpoint is announced @@ -5639,9 +6243,9 @@ struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LD */ void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); -void FundingCreated_free(struct LDKFundingCreated this_ptr); +struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); -struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); +void FundingCreated_free(struct LDKFundingCreated this_ptr); /** * A temporary channel ID, until the funding is established @@ -5685,9 +6289,9 @@ void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg); -void FundingSigned_free(struct LDKFundingSigned this_ptr); +struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); -struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); +void FundingSigned_free(struct LDKFundingSigned this_ptr); /** * The channel ID @@ -5711,9 +6315,9 @@ void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg); -void FundingLocked_free(struct LDKFundingLocked this_ptr); +struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); -struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); +void FundingLocked_free(struct LDKFundingLocked this_ptr); /** * The channel ID @@ -5737,9 +6341,9 @@ void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNUL MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg); -void Shutdown_free(struct LDKShutdown this_ptr); +struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); -struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); +void Shutdown_free(struct LDKShutdown this_ptr); /** * The channel ID @@ -5765,9 +6369,9 @@ void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); -void ClosingSigned_free(struct LDKClosingSigned this_ptr); +struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); -struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); +void ClosingSigned_free(struct LDKClosingSigned this_ptr); /** * The channel ID @@ -5801,9 +6405,9 @@ void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg); -void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr); +struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); -struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); +void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr); /** * The channel ID @@ -5855,9 +6459,9 @@ uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PT */ void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val); -void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr); +struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); -struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); +void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr); /** * The channel ID @@ -5891,9 +6495,9 @@ void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); -void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr); +struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); -struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); +void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr); /** * The channel ID @@ -5915,9 +6519,9 @@ uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR */ void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val); -void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr); +struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); -struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); +void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr); /** * The channel ID @@ -5949,9 +6553,9 @@ uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalf */ void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val); -void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr); +struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); -struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); +void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr); /** * The channel ID @@ -5980,9 +6584,9 @@ void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PT MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg); -void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr); +struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); -struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); +void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr); /** * The channel ID @@ -6016,9 +6620,9 @@ void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_ MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); -void UpdateFee_free(struct LDKUpdateFee this_ptr); +struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); -struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); +void UpdateFee_free(struct LDKUpdateFee this_ptr); /** * The channel ID @@ -6042,9 +6646,9 @@ void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uin MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); -void DataLossProtect_free(struct LDKDataLossProtect this_ptr); +struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); -struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); +void DataLossProtect_free(struct LDKDataLossProtect this_ptr); /** * Proof that the sender knows the per-commitment secret of a specific commitment transaction @@ -6070,9 +6674,9 @@ void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProte MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg); -void ChannelReestablish_free(struct LDKChannelReestablish this_ptr); +struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); -struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); +void ChannelReestablish_free(struct LDKChannelReestablish this_ptr); /** * The channel ID @@ -6104,9 +6708,9 @@ uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKCh */ void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); -void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr); +struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); -struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); +void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr); /** * The channel ID @@ -6150,6 +6754,8 @@ void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatur MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg); +struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); + void NetAddress_free(struct LDKNetAddress this_ptr); struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); @@ -6160,8 +6766,6 @@ struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slic void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr); -struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); - /** * The advertised features */ @@ -6221,9 +6825,9 @@ void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONN */ void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); -void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr); +struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); -struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); +void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr); /** * The signature by the node key @@ -6247,9 +6851,9 @@ void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg); -void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr); +struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); -struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); +void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr); /** * The advertised channel features @@ -6321,9 +6925,9 @@ struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct L */ void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); -void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr); +struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); -struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); +void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr); /** * Authentication of the announcement by the first public node @@ -6377,9 +6981,9 @@ void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg); -void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr); +struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); -struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); +void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr); /** * The genesis hash of the blockchain where the channel is to be opened @@ -6461,9 +7065,9 @@ uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKU */ void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); -void ChannelUpdate_free(struct LDKChannelUpdate this_ptr); +struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); -struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); +void ChannelUpdate_free(struct LDKChannelUpdate this_ptr); /** * A signature of the channel update @@ -6487,9 +7091,9 @@ void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, s MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg); -void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr); +struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); -struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); +void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr); /** * The genesis hash of the blockchain being queried @@ -6523,9 +7127,9 @@ void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); -void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr); +struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); -struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); +void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr); /** * The genesis hash of the blockchain being queried @@ -6574,9 +7178,9 @@ void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNUL MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg); -void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr); +struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); -struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); +void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr); /** * The genesis hash of the blockchain being queried @@ -6595,9 +7199,9 @@ void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds * MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg); -void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr); +struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); -struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); +void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr); /** * The genesis hash of the blockchain that was queried @@ -6623,9 +7227,9 @@ void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIds MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); -void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr); +struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); -struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); +void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr); /** * The genesis hash of the blockchain for channel and node information @@ -6659,14 +7263,14 @@ void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter * MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); +struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); + void ErrorAction_free(struct LDKErrorAction this_ptr); struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); void LightningError_free(struct LDKLightningError this_ptr); -struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig); - /** * A human-readable message describing the error */ @@ -6689,9 +7293,9 @@ void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, s MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg); -void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr); +struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig); -struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); +void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr); /** * update_add_htlc messages which should be sent @@ -6735,6 +7339,8 @@ void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_ MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg); +struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); + void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr); struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig); @@ -6751,11 +7357,11 @@ void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr); struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); -struct LDKAcceptChannel AcceptChannel_read(struct LDKu8slice ser); +struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser); struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj); -struct LDKAnnouncementSignatures AnnouncementSignatures_read(struct LDKu8slice ser); +struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser); struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj); @@ -6763,23 +7369,23 @@ struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj); -struct LDKClosingSigned ClosingSigned_read(struct LDKu8slice ser); +struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser); struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); -struct LDKCommitmentSigned CommitmentSigned_read(struct LDKu8slice ser); +struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser); struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj); -struct LDKFundingCreated FundingCreated_read(struct LDKu8slice ser); +struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser); struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj); -struct LDKFundingSigned FundingSigned_read(struct LDKu8slice ser); +struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser); struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj); -struct LDKFundingLocked FundingLocked_read(struct LDKu8slice ser); +struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser); struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj); @@ -6787,35 +7393,35 @@ struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser); struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj); -struct LDKOpenChannel OpenChannel_read(struct LDKu8slice ser); +struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser); struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj); -struct LDKRevokeAndACK RevokeAndACK_read(struct LDKu8slice ser); +struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser); struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj); -struct LDKShutdown Shutdown_read(struct LDKu8slice ser); +struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser); struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj); -struct LDKUpdateFailHTLC UpdateFailHTLC_read(struct LDKu8slice ser); +struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser); struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj); -struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_read(struct LDKu8slice ser); +struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser); struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj); -struct LDKUpdateFee UpdateFee_read(struct LDKu8slice ser); +struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser); struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj); -struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_read(struct LDKu8slice ser); +struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser); struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj); -struct LDKUpdateAddHTLC UpdateAddHTLC_read(struct LDKu8slice ser); +struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser); struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj); @@ -6831,7 +7437,7 @@ struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnounc struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj); -struct LDKChannelAnnouncement ChannelAnnouncement_read(struct LDKu8slice ser); +struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser); struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj); @@ -6839,7 +7445,7 @@ struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(s struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj); -struct LDKChannelUpdate ChannelUpdate_read(struct LDKu8slice ser); +struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser); struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj); @@ -6851,7 +7457,7 @@ struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_ struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj); -struct LDKNodeAnnouncement NodeAnnouncement_read(struct LDKu8slice ser); +struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser); struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser); @@ -6910,8 +7516,6 @@ void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr); void PeerHandleError_free(struct LDKPeerHandleError this_ptr); -struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); - /** * Used to indicate that we probably can't make any future connections to this peer, implying * we should go ahead and force-close any channels we have with it. @@ -6926,6 +7530,8 @@ void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNU MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); +struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); + void PeerManager_free(struct LDKPeerManager this_ptr); /** @@ -7048,7 +7654,7 @@ struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); +struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); /** * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key) @@ -7058,7 +7664,7 @@ struct LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); +struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); /** * Derives a per-commitment-transaction revocation key from its constituent parts. @@ -7071,7 +7677,7 @@ struct LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_ * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); +struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); /** * Derives a per-commitment-transaction revocation public key from its constituent parts. This is @@ -7086,12 +7692,10 @@ struct LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_ * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); +struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr); -struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig); - /** * The broadcaster's per-commitment public key which was used to derive the other keys. */ @@ -7148,14 +7752,14 @@ void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg); +struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig); + struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj); -struct LDKTxCreationKeys TxCreationKeys_read(struct LDKu8slice ser); +struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser); void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr); -struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); - /** * The public key which is used to sign all commitment transactions, as it appears in the * on-chain channel lock-in 2-of-2 multisig output. @@ -7226,21 +7830,23 @@ void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_P MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg); +struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); + struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj); -struct LDKChannelPublicKeys ChannelPublicKeys_read(struct LDKu8slice ser); +struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser); /** * Create per-state keys from channel base points and the per-commitment point. * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ -MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); +MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); /** * Generate per-state keys from channel static keys. * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ -MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); +MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); /** * A script either spendable by the revocation @@ -7251,8 +7857,6 @@ struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_ke void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr); -struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); - /** * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction). * Note that this is not the same as whether it is ountbound *from us*. To determine that you @@ -7301,9 +7905,11 @@ const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutp */ void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); + struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); -struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(struct LDKu8slice ser); +struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser); /** * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc @@ -7324,8 +7930,6 @@ struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uin void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr); -struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); - /** * Holder public keys */ @@ -7382,9 +7986,9 @@ void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransact MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg); -void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr); +struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); -struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); +void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr); /** * Counter-party public keys @@ -7408,6 +8012,8 @@ void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg); +struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); + /** * Whether the late bound parameters are populated. */ @@ -7431,11 +8037,11 @@ MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionPa struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj); -struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser); +struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser); struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj); -struct LDKChannelTransactionParameters ChannelTransactionParameters_read(struct LDKu8slice ser); +struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser); void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr); @@ -7470,8 +8076,6 @@ MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_out void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr); -struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); - /** * Our counterparty's signature for the transaction */ @@ -7487,9 +8091,11 @@ void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitment */ void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); +struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); + struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj); -struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(struct LDKu8slice ser); +struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser); /** * Create a new holder transaction with the given counterparty signatures. @@ -7499,8 +8105,6 @@ MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_n void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr); -struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); - /** * The commitment transaction */ @@ -7529,9 +8133,11 @@ void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *N MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg); +struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); + struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj); -struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_read(struct LDKu8slice ser); +struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser); /** * Get the SIGHASH_ALL sighash value of the transaction. @@ -7552,7 +8158,7 @@ struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKComm struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj); -struct LDKCommitmentTransaction CommitmentTransaction_read(struct LDKu8slice ser); +struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser); /** * The backwards-counting commitment number @@ -7624,15 +8230,67 @@ MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction */ uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster); +struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); + +struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); + +struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); + void InitFeatures_free(struct LDKInitFeatures this_ptr); void NodeFeatures_free(struct LDKNodeFeatures this_ptr); void ChannelFeatures_free(struct LDKChannelFeatures this_ptr); -void RouteHop_free(struct LDKRouteHop this_ptr); +/** + * Create a blank Features with no features set + */ +MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); -struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); +/** + * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. + * + * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS + */ +MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void); + +/** + * Create a blank Features with no features set + */ +MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); + +/** + * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. + * + * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS + */ +MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void); + +/** + * Create a blank Features with no features set + */ +MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); + +/** + * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. + * + * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS + */ +MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void); + +struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj); + +struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj); + +struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj); + +struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser); + +struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser); + +struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser); + +void RouteHop_free(struct LDKRouteHop this_ptr); /** * The node_id of the node at this hop. @@ -7702,9 +8360,9 @@ void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, ui MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); -void Route_free(struct LDKRoute this_ptr); +struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); -struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); +void Route_free(struct LDKRoute this_ptr); /** * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the @@ -7718,14 +8376,14 @@ void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_ MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg); +struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); + struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); void RouteHint_free(struct LDKRouteHint this_ptr); -struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); - /** * The node_id of the non-target end of the route */ @@ -7778,6 +8436,8 @@ void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg); +struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); + /** * Gets a route from us to the given target node. * @@ -7838,8 +8498,6 @@ struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvi void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr); -struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig); - /** * When the last update to the channel direction was issued. * Value is opaque, as set in the announcement. @@ -7908,9 +8566,11 @@ struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const str */ void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); +struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig); + struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj); -struct LDKDirectionalChannelInfo DirectionalChannelInfo_read(struct LDKu8slice ser); +struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser); void ChannelInfo_free(struct LDKChannelInfo this_ptr); @@ -7982,12 +8642,10 @@ void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR thi struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); -struct LDKChannelInfo ChannelInfo_read(struct LDKu8slice ser); +struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser); void RoutingFees_free(struct LDKRoutingFees this_ptr); -struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); - /** * Flat routing fee in satoshis */ @@ -8012,14 +8670,14 @@ void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); +struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); + struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr); -struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); - /** * Protocol features the node announced support for */ @@ -8089,14 +8747,14 @@ void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInf MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg); +struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); + struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); void NodeInfo_free(struct LDKNodeInfo this_ptr); -struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); - /** * All valid channels a node has announced */ @@ -8132,6 +8790,8 @@ void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, st MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); +struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); + struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); diff --git a/lightning-c-bindings/include/lightningpp.hpp b/lightning-c-bindings/include/lightningpp.hpp index 2d6473086a1..685517b9f60 100644 --- a/lightning-c-bindings/include/lightningpp.hpp +++ b/lightning-c-bindings/include/lightningpp.hpp @@ -1,65 +1,5 @@ #include namespace LDK { -class Event { -private: - LDKEvent self; -public: - Event(const Event&) = delete; - Event(Event&& o) : self(o.self) { memset(&o, 0, sizeof(Event)); } - Event(LDKEvent&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKEvent)); } - operator LDKEvent() && { LDKEvent res = self; memset(&self, 0, sizeof(LDKEvent)); return res; } - ~Event() { Event_free(self); } - Event& operator=(Event&& o) { Event_free(self); self = o.self; memset(&o, 0, sizeof(Event)); return *this; } - LDKEvent* operator &() { return &self; } - LDKEvent* operator ->() { return &self; } - const LDKEvent* operator &() const { return &self; } - const LDKEvent* operator ->() const { return &self; } -}; -class MessageSendEvent { -private: - LDKMessageSendEvent self; -public: - MessageSendEvent(const MessageSendEvent&) = delete; - MessageSendEvent(MessageSendEvent&& o) : self(o.self) { memset(&o, 0, sizeof(MessageSendEvent)); } - MessageSendEvent(LDKMessageSendEvent&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMessageSendEvent)); } - operator LDKMessageSendEvent() && { LDKMessageSendEvent res = self; memset(&self, 0, sizeof(LDKMessageSendEvent)); return res; } - ~MessageSendEvent() { MessageSendEvent_free(self); } - MessageSendEvent& operator=(MessageSendEvent&& o) { MessageSendEvent_free(self); self = o.self; memset(&o, 0, sizeof(MessageSendEvent)); return *this; } - LDKMessageSendEvent* operator &() { return &self; } - LDKMessageSendEvent* operator ->() { return &self; } - const LDKMessageSendEvent* operator &() const { return &self; } - const LDKMessageSendEvent* operator ->() const { return &self; } -}; -class MessageSendEventsProvider { -private: - LDKMessageSendEventsProvider self; -public: - MessageSendEventsProvider(const MessageSendEventsProvider&) = delete; - MessageSendEventsProvider(MessageSendEventsProvider&& o) : self(o.self) { memset(&o, 0, sizeof(MessageSendEventsProvider)); } - MessageSendEventsProvider(LDKMessageSendEventsProvider&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMessageSendEventsProvider)); } - operator LDKMessageSendEventsProvider() && { LDKMessageSendEventsProvider res = self; memset(&self, 0, sizeof(LDKMessageSendEventsProvider)); return res; } - ~MessageSendEventsProvider() { MessageSendEventsProvider_free(self); } - MessageSendEventsProvider& operator=(MessageSendEventsProvider&& o) { MessageSendEventsProvider_free(self); self = o.self; memset(&o, 0, sizeof(MessageSendEventsProvider)); return *this; } - LDKMessageSendEventsProvider* operator &() { return &self; } - LDKMessageSendEventsProvider* operator ->() { return &self; } - const LDKMessageSendEventsProvider* operator &() const { return &self; } - const LDKMessageSendEventsProvider* operator ->() const { return &self; } -}; -class EventsProvider { -private: - LDKEventsProvider self; -public: - EventsProvider(const EventsProvider&) = delete; - EventsProvider(EventsProvider&& o) : self(o.self) { memset(&o, 0, sizeof(EventsProvider)); } - EventsProvider(LDKEventsProvider&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKEventsProvider)); } - operator LDKEventsProvider() && { LDKEventsProvider res = self; memset(&self, 0, sizeof(LDKEventsProvider)); return res; } - ~EventsProvider() { EventsProvider_free(self); } - EventsProvider& operator=(EventsProvider&& o) { EventsProvider_free(self); self = o.self; memset(&o, 0, sizeof(EventsProvider)); return *this; } - LDKEventsProvider* operator &() { return &self; } - LDKEventsProvider* operator ->() { return &self; } - const LDKEventsProvider* operator &() const { return &self; } - const LDKEventsProvider* operator ->() const { return &self; } -}; class APIError { private: LDKAPIError self; @@ -75,1486 +15,1546 @@ class APIError { const LDKAPIError* operator &() const { return &self; } const LDKAPIError* operator ->() const { return &self; } }; -class Level { +class TxCreationKeys { private: - LDKLevel self; + LDKTxCreationKeys self; public: - Level(const Level&) = delete; - Level(Level&& o) : self(o.self) { memset(&o, 0, sizeof(Level)); } - Level(LDKLevel&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLevel)); } - operator LDKLevel() && { LDKLevel res = self; memset(&self, 0, sizeof(LDKLevel)); return res; } - Level& operator=(Level&& o) { self = o.self; memset(&o, 0, sizeof(Level)); return *this; } - LDKLevel* operator &() { return &self; } - LDKLevel* operator ->() { return &self; } - const LDKLevel* operator &() const { return &self; } - const LDKLevel* operator ->() const { return &self; } + TxCreationKeys(const TxCreationKeys&) = delete; + TxCreationKeys(TxCreationKeys&& o) : self(o.self) { memset(&o, 0, sizeof(TxCreationKeys)); } + TxCreationKeys(LDKTxCreationKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKTxCreationKeys)); } + operator LDKTxCreationKeys() && { LDKTxCreationKeys res = self; memset(&self, 0, sizeof(LDKTxCreationKeys)); return res; } + ~TxCreationKeys() { TxCreationKeys_free(self); } + TxCreationKeys& operator=(TxCreationKeys&& o) { TxCreationKeys_free(self); self = o.self; memset(&o, 0, sizeof(TxCreationKeys)); return *this; } + LDKTxCreationKeys* operator &() { return &self; } + LDKTxCreationKeys* operator ->() { return &self; } + const LDKTxCreationKeys* operator &() const { return &self; } + const LDKTxCreationKeys* operator ->() const { return &self; } }; -class Logger { +class ChannelPublicKeys { private: - LDKLogger self; + LDKChannelPublicKeys self; public: - Logger(const Logger&) = delete; - Logger(Logger&& o) : self(o.self) { memset(&o, 0, sizeof(Logger)); } - Logger(LDKLogger&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLogger)); } - operator LDKLogger() && { LDKLogger res = self; memset(&self, 0, sizeof(LDKLogger)); return res; } - ~Logger() { Logger_free(self); } - Logger& operator=(Logger&& o) { Logger_free(self); self = o.self; memset(&o, 0, sizeof(Logger)); return *this; } - LDKLogger* operator &() { return &self; } - LDKLogger* operator ->() { return &self; } - const LDKLogger* operator &() const { return &self; } - const LDKLogger* operator ->() const { return &self; } + ChannelPublicKeys(const ChannelPublicKeys&) = delete; + ChannelPublicKeys(ChannelPublicKeys&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelPublicKeys)); } + ChannelPublicKeys(LDKChannelPublicKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelPublicKeys)); } + operator LDKChannelPublicKeys() && { LDKChannelPublicKeys res = self; memset(&self, 0, sizeof(LDKChannelPublicKeys)); return res; } + ~ChannelPublicKeys() { ChannelPublicKeys_free(self); } + ChannelPublicKeys& operator=(ChannelPublicKeys&& o) { ChannelPublicKeys_free(self); self = o.self; memset(&o, 0, sizeof(ChannelPublicKeys)); return *this; } + LDKChannelPublicKeys* operator &() { return &self; } + LDKChannelPublicKeys* operator ->() { return &self; } + const LDKChannelPublicKeys* operator &() const { return &self; } + const LDKChannelPublicKeys* operator ->() const { return &self; } }; -class ChannelHandshakeConfig { +class HTLCOutputInCommitment { private: - LDKChannelHandshakeConfig self; + LDKHTLCOutputInCommitment self; public: - ChannelHandshakeConfig(const ChannelHandshakeConfig&) = delete; - ChannelHandshakeConfig(ChannelHandshakeConfig&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelHandshakeConfig)); } - ChannelHandshakeConfig(LDKChannelHandshakeConfig&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelHandshakeConfig)); } - operator LDKChannelHandshakeConfig() && { LDKChannelHandshakeConfig res = self; memset(&self, 0, sizeof(LDKChannelHandshakeConfig)); return res; } - ~ChannelHandshakeConfig() { ChannelHandshakeConfig_free(self); } - ChannelHandshakeConfig& operator=(ChannelHandshakeConfig&& o) { ChannelHandshakeConfig_free(self); self = o.self; memset(&o, 0, sizeof(ChannelHandshakeConfig)); return *this; } - LDKChannelHandshakeConfig* operator &() { return &self; } - LDKChannelHandshakeConfig* operator ->() { return &self; } - const LDKChannelHandshakeConfig* operator &() const { return &self; } - const LDKChannelHandshakeConfig* operator ->() const { return &self; } + HTLCOutputInCommitment(const HTLCOutputInCommitment&) = delete; + HTLCOutputInCommitment(HTLCOutputInCommitment&& o) : self(o.self) { memset(&o, 0, sizeof(HTLCOutputInCommitment)); } + HTLCOutputInCommitment(LDKHTLCOutputInCommitment&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHTLCOutputInCommitment)); } + operator LDKHTLCOutputInCommitment() && { LDKHTLCOutputInCommitment res = self; memset(&self, 0, sizeof(LDKHTLCOutputInCommitment)); return res; } + ~HTLCOutputInCommitment() { HTLCOutputInCommitment_free(self); } + HTLCOutputInCommitment& operator=(HTLCOutputInCommitment&& o) { HTLCOutputInCommitment_free(self); self = o.self; memset(&o, 0, sizeof(HTLCOutputInCommitment)); return *this; } + LDKHTLCOutputInCommitment* operator &() { return &self; } + LDKHTLCOutputInCommitment* operator ->() { return &self; } + const LDKHTLCOutputInCommitment* operator &() const { return &self; } + const LDKHTLCOutputInCommitment* operator ->() const { return &self; } }; -class ChannelHandshakeLimits { +class ChannelTransactionParameters { private: - LDKChannelHandshakeLimits self; + LDKChannelTransactionParameters self; public: - ChannelHandshakeLimits(const ChannelHandshakeLimits&) = delete; - ChannelHandshakeLimits(ChannelHandshakeLimits&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelHandshakeLimits)); } - ChannelHandshakeLimits(LDKChannelHandshakeLimits&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelHandshakeLimits)); } - operator LDKChannelHandshakeLimits() && { LDKChannelHandshakeLimits res = self; memset(&self, 0, sizeof(LDKChannelHandshakeLimits)); return res; } - ~ChannelHandshakeLimits() { ChannelHandshakeLimits_free(self); } - ChannelHandshakeLimits& operator=(ChannelHandshakeLimits&& o) { ChannelHandshakeLimits_free(self); self = o.self; memset(&o, 0, sizeof(ChannelHandshakeLimits)); return *this; } - LDKChannelHandshakeLimits* operator &() { return &self; } - LDKChannelHandshakeLimits* operator ->() { return &self; } - const LDKChannelHandshakeLimits* operator &() const { return &self; } - const LDKChannelHandshakeLimits* operator ->() const { return &self; } + ChannelTransactionParameters(const ChannelTransactionParameters&) = delete; + ChannelTransactionParameters(ChannelTransactionParameters&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelTransactionParameters)); } + ChannelTransactionParameters(LDKChannelTransactionParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelTransactionParameters)); } + operator LDKChannelTransactionParameters() && { LDKChannelTransactionParameters res = self; memset(&self, 0, sizeof(LDKChannelTransactionParameters)); return res; } + ~ChannelTransactionParameters() { ChannelTransactionParameters_free(self); } + ChannelTransactionParameters& operator=(ChannelTransactionParameters&& o) { ChannelTransactionParameters_free(self); self = o.self; memset(&o, 0, sizeof(ChannelTransactionParameters)); return *this; } + LDKChannelTransactionParameters* operator &() { return &self; } + LDKChannelTransactionParameters* operator ->() { return &self; } + const LDKChannelTransactionParameters* operator &() const { return &self; } + const LDKChannelTransactionParameters* operator ->() const { return &self; } }; -class ChannelConfig { +class CounterpartyChannelTransactionParameters { private: - LDKChannelConfig self; + LDKCounterpartyChannelTransactionParameters self; public: - ChannelConfig(const ChannelConfig&) = delete; - ChannelConfig(ChannelConfig&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelConfig)); } - ChannelConfig(LDKChannelConfig&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelConfig)); } - operator LDKChannelConfig() && { LDKChannelConfig res = self; memset(&self, 0, sizeof(LDKChannelConfig)); return res; } - ~ChannelConfig() { ChannelConfig_free(self); } - ChannelConfig& operator=(ChannelConfig&& o) { ChannelConfig_free(self); self = o.self; memset(&o, 0, sizeof(ChannelConfig)); return *this; } - LDKChannelConfig* operator &() { return &self; } - LDKChannelConfig* operator ->() { return &self; } - const LDKChannelConfig* operator &() const { return &self; } - const LDKChannelConfig* operator ->() const { return &self; } + CounterpartyChannelTransactionParameters(const CounterpartyChannelTransactionParameters&) = delete; + CounterpartyChannelTransactionParameters(CounterpartyChannelTransactionParameters&& o) : self(o.self) { memset(&o, 0, sizeof(CounterpartyChannelTransactionParameters)); } + CounterpartyChannelTransactionParameters(LDKCounterpartyChannelTransactionParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCounterpartyChannelTransactionParameters)); } + operator LDKCounterpartyChannelTransactionParameters() && { LDKCounterpartyChannelTransactionParameters res = self; memset(&self, 0, sizeof(LDKCounterpartyChannelTransactionParameters)); return res; } + ~CounterpartyChannelTransactionParameters() { CounterpartyChannelTransactionParameters_free(self); } + CounterpartyChannelTransactionParameters& operator=(CounterpartyChannelTransactionParameters&& o) { CounterpartyChannelTransactionParameters_free(self); self = o.self; memset(&o, 0, sizeof(CounterpartyChannelTransactionParameters)); return *this; } + LDKCounterpartyChannelTransactionParameters* operator &() { return &self; } + LDKCounterpartyChannelTransactionParameters* operator ->() { return &self; } + const LDKCounterpartyChannelTransactionParameters* operator &() const { return &self; } + const LDKCounterpartyChannelTransactionParameters* operator ->() const { return &self; } }; -class UserConfig { +class DirectedChannelTransactionParameters { private: - LDKUserConfig self; + LDKDirectedChannelTransactionParameters self; public: - UserConfig(const UserConfig&) = delete; - UserConfig(UserConfig&& o) : self(o.self) { memset(&o, 0, sizeof(UserConfig)); } - UserConfig(LDKUserConfig&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUserConfig)); } - operator LDKUserConfig() && { LDKUserConfig res = self; memset(&self, 0, sizeof(LDKUserConfig)); return res; } - ~UserConfig() { UserConfig_free(self); } - UserConfig& operator=(UserConfig&& o) { UserConfig_free(self); self = o.self; memset(&o, 0, sizeof(UserConfig)); return *this; } - LDKUserConfig* operator &() { return &self; } - LDKUserConfig* operator ->() { return &self; } - const LDKUserConfig* operator &() const { return &self; } - const LDKUserConfig* operator ->() const { return &self; } + DirectedChannelTransactionParameters(const DirectedChannelTransactionParameters&) = delete; + DirectedChannelTransactionParameters(DirectedChannelTransactionParameters&& o) : self(o.self) { memset(&o, 0, sizeof(DirectedChannelTransactionParameters)); } + DirectedChannelTransactionParameters(LDKDirectedChannelTransactionParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDirectedChannelTransactionParameters)); } + operator LDKDirectedChannelTransactionParameters() && { LDKDirectedChannelTransactionParameters res = self; memset(&self, 0, sizeof(LDKDirectedChannelTransactionParameters)); return res; } + ~DirectedChannelTransactionParameters() { DirectedChannelTransactionParameters_free(self); } + DirectedChannelTransactionParameters& operator=(DirectedChannelTransactionParameters&& o) { DirectedChannelTransactionParameters_free(self); self = o.self; memset(&o, 0, sizeof(DirectedChannelTransactionParameters)); return *this; } + LDKDirectedChannelTransactionParameters* operator &() { return &self; } + LDKDirectedChannelTransactionParameters* operator ->() { return &self; } + const LDKDirectedChannelTransactionParameters* operator &() const { return &self; } + const LDKDirectedChannelTransactionParameters* operator ->() const { return &self; } }; -class BroadcasterInterface { +class HolderCommitmentTransaction { private: - LDKBroadcasterInterface self; + LDKHolderCommitmentTransaction self; public: - BroadcasterInterface(const BroadcasterInterface&) = delete; - BroadcasterInterface(BroadcasterInterface&& o) : self(o.self) { memset(&o, 0, sizeof(BroadcasterInterface)); } - BroadcasterInterface(LDKBroadcasterInterface&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKBroadcasterInterface)); } - operator LDKBroadcasterInterface() && { LDKBroadcasterInterface res = self; memset(&self, 0, sizeof(LDKBroadcasterInterface)); return res; } - ~BroadcasterInterface() { BroadcasterInterface_free(self); } - BroadcasterInterface& operator=(BroadcasterInterface&& o) { BroadcasterInterface_free(self); self = o.self; memset(&o, 0, sizeof(BroadcasterInterface)); return *this; } - LDKBroadcasterInterface* operator &() { return &self; } - LDKBroadcasterInterface* operator ->() { return &self; } - const LDKBroadcasterInterface* operator &() const { return &self; } - const LDKBroadcasterInterface* operator ->() const { return &self; } + HolderCommitmentTransaction(const HolderCommitmentTransaction&) = delete; + HolderCommitmentTransaction(HolderCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(HolderCommitmentTransaction)); } + HolderCommitmentTransaction(LDKHolderCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHolderCommitmentTransaction)); } + operator LDKHolderCommitmentTransaction() && { LDKHolderCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKHolderCommitmentTransaction)); return res; } + ~HolderCommitmentTransaction() { HolderCommitmentTransaction_free(self); } + HolderCommitmentTransaction& operator=(HolderCommitmentTransaction&& o) { HolderCommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(HolderCommitmentTransaction)); return *this; } + LDKHolderCommitmentTransaction* operator &() { return &self; } + LDKHolderCommitmentTransaction* operator ->() { return &self; } + const LDKHolderCommitmentTransaction* operator &() const { return &self; } + const LDKHolderCommitmentTransaction* operator ->() const { return &self; } }; -class ConfirmationTarget { +class BuiltCommitmentTransaction { private: - LDKConfirmationTarget self; + LDKBuiltCommitmentTransaction self; public: - ConfirmationTarget(const ConfirmationTarget&) = delete; - ConfirmationTarget(ConfirmationTarget&& o) : self(o.self) { memset(&o, 0, sizeof(ConfirmationTarget)); } - ConfirmationTarget(LDKConfirmationTarget&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKConfirmationTarget)); } - operator LDKConfirmationTarget() && { LDKConfirmationTarget res = self; memset(&self, 0, sizeof(LDKConfirmationTarget)); return res; } - ConfirmationTarget& operator=(ConfirmationTarget&& o) { self = o.self; memset(&o, 0, sizeof(ConfirmationTarget)); return *this; } - LDKConfirmationTarget* operator &() { return &self; } - LDKConfirmationTarget* operator ->() { return &self; } - const LDKConfirmationTarget* operator &() const { return &self; } - const LDKConfirmationTarget* operator ->() const { return &self; } + BuiltCommitmentTransaction(const BuiltCommitmentTransaction&) = delete; + BuiltCommitmentTransaction(BuiltCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(BuiltCommitmentTransaction)); } + BuiltCommitmentTransaction(LDKBuiltCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKBuiltCommitmentTransaction)); } + operator LDKBuiltCommitmentTransaction() && { LDKBuiltCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKBuiltCommitmentTransaction)); return res; } + ~BuiltCommitmentTransaction() { BuiltCommitmentTransaction_free(self); } + BuiltCommitmentTransaction& operator=(BuiltCommitmentTransaction&& o) { BuiltCommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(BuiltCommitmentTransaction)); return *this; } + LDKBuiltCommitmentTransaction* operator &() { return &self; } + LDKBuiltCommitmentTransaction* operator ->() { return &self; } + const LDKBuiltCommitmentTransaction* operator &() const { return &self; } + const LDKBuiltCommitmentTransaction* operator ->() const { return &self; } }; -class FeeEstimator { +class CommitmentTransaction { private: - LDKFeeEstimator self; + LDKCommitmentTransaction self; public: - FeeEstimator(const FeeEstimator&) = delete; - FeeEstimator(FeeEstimator&& o) : self(o.self) { memset(&o, 0, sizeof(FeeEstimator)); } - FeeEstimator(LDKFeeEstimator&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFeeEstimator)); } - operator LDKFeeEstimator() && { LDKFeeEstimator res = self; memset(&self, 0, sizeof(LDKFeeEstimator)); return res; } - ~FeeEstimator() { FeeEstimator_free(self); } - FeeEstimator& operator=(FeeEstimator&& o) { FeeEstimator_free(self); self = o.self; memset(&o, 0, sizeof(FeeEstimator)); return *this; } - LDKFeeEstimator* operator &() { return &self; } - LDKFeeEstimator* operator ->() { return &self; } - const LDKFeeEstimator* operator &() const { return &self; } - const LDKFeeEstimator* operator ->() const { return &self; } + CommitmentTransaction(const CommitmentTransaction&) = delete; + CommitmentTransaction(CommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(CommitmentTransaction)); } + CommitmentTransaction(LDKCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCommitmentTransaction)); } + operator LDKCommitmentTransaction() && { LDKCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKCommitmentTransaction)); return res; } + ~CommitmentTransaction() { CommitmentTransaction_free(self); } + CommitmentTransaction& operator=(CommitmentTransaction&& o) { CommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(CommitmentTransaction)); return *this; } + LDKCommitmentTransaction* operator &() { return &self; } + LDKCommitmentTransaction* operator ->() { return &self; } + const LDKCommitmentTransaction* operator &() const { return &self; } + const LDKCommitmentTransaction* operator ->() const { return &self; } }; -class ChainMonitor { +class TrustedCommitmentTransaction { private: - LDKChainMonitor self; + LDKTrustedCommitmentTransaction self; public: - ChainMonitor(const ChainMonitor&) = delete; - ChainMonitor(ChainMonitor&& o) : self(o.self) { memset(&o, 0, sizeof(ChainMonitor)); } - ChainMonitor(LDKChainMonitor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChainMonitor)); } - operator LDKChainMonitor() && { LDKChainMonitor res = self; memset(&self, 0, sizeof(LDKChainMonitor)); return res; } - ~ChainMonitor() { ChainMonitor_free(self); } - ChainMonitor& operator=(ChainMonitor&& o) { ChainMonitor_free(self); self = o.self; memset(&o, 0, sizeof(ChainMonitor)); return *this; } - LDKChainMonitor* operator &() { return &self; } - LDKChainMonitor* operator ->() { return &self; } - const LDKChainMonitor* operator &() const { return &self; } - const LDKChainMonitor* operator ->() const { return &self; } + TrustedCommitmentTransaction(const TrustedCommitmentTransaction&) = delete; + TrustedCommitmentTransaction(TrustedCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(TrustedCommitmentTransaction)); } + TrustedCommitmentTransaction(LDKTrustedCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKTrustedCommitmentTransaction)); } + operator LDKTrustedCommitmentTransaction() && { LDKTrustedCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKTrustedCommitmentTransaction)); return res; } + ~TrustedCommitmentTransaction() { TrustedCommitmentTransaction_free(self); } + TrustedCommitmentTransaction& operator=(TrustedCommitmentTransaction&& o) { TrustedCommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(TrustedCommitmentTransaction)); return *this; } + LDKTrustedCommitmentTransaction* operator &() { return &self; } + LDKTrustedCommitmentTransaction* operator ->() { return &self; } + const LDKTrustedCommitmentTransaction* operator &() const { return &self; } + const LDKTrustedCommitmentTransaction* operator ->() const { return &self; } }; -class ChannelMonitorUpdate { +class MessageHandler { private: - LDKChannelMonitorUpdate self; + LDKMessageHandler self; public: - ChannelMonitorUpdate(const ChannelMonitorUpdate&) = delete; - ChannelMonitorUpdate(ChannelMonitorUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMonitorUpdate)); } - ChannelMonitorUpdate(LDKChannelMonitorUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMonitorUpdate)); } - operator LDKChannelMonitorUpdate() && { LDKChannelMonitorUpdate res = self; memset(&self, 0, sizeof(LDKChannelMonitorUpdate)); return res; } - ~ChannelMonitorUpdate() { ChannelMonitorUpdate_free(self); } - ChannelMonitorUpdate& operator=(ChannelMonitorUpdate&& o) { ChannelMonitorUpdate_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMonitorUpdate)); return *this; } - LDKChannelMonitorUpdate* operator &() { return &self; } - LDKChannelMonitorUpdate* operator ->() { return &self; } - const LDKChannelMonitorUpdate* operator &() const { return &self; } - const LDKChannelMonitorUpdate* operator ->() const { return &self; } + MessageHandler(const MessageHandler&) = delete; + MessageHandler(MessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(MessageHandler)); } + MessageHandler(LDKMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMessageHandler)); } + operator LDKMessageHandler() && { LDKMessageHandler res = self; memset(&self, 0, sizeof(LDKMessageHandler)); return res; } + ~MessageHandler() { MessageHandler_free(self); } + MessageHandler& operator=(MessageHandler&& o) { MessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(MessageHandler)); return *this; } + LDKMessageHandler* operator &() { return &self; } + LDKMessageHandler* operator ->() { return &self; } + const LDKMessageHandler* operator &() const { return &self; } + const LDKMessageHandler* operator ->() const { return &self; } }; -class ChannelMonitorUpdateErr { +class SocketDescriptor { private: - LDKChannelMonitorUpdateErr self; + LDKSocketDescriptor self; public: - ChannelMonitorUpdateErr(const ChannelMonitorUpdateErr&) = delete; - ChannelMonitorUpdateErr(ChannelMonitorUpdateErr&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMonitorUpdateErr)); } - ChannelMonitorUpdateErr(LDKChannelMonitorUpdateErr&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMonitorUpdateErr)); } - operator LDKChannelMonitorUpdateErr() && { LDKChannelMonitorUpdateErr res = self; memset(&self, 0, sizeof(LDKChannelMonitorUpdateErr)); return res; } - ChannelMonitorUpdateErr& operator=(ChannelMonitorUpdateErr&& o) { self = o.self; memset(&o, 0, sizeof(ChannelMonitorUpdateErr)); return *this; } - LDKChannelMonitorUpdateErr* operator &() { return &self; } - LDKChannelMonitorUpdateErr* operator ->() { return &self; } - const LDKChannelMonitorUpdateErr* operator &() const { return &self; } - const LDKChannelMonitorUpdateErr* operator ->() const { return &self; } + SocketDescriptor(const SocketDescriptor&) = delete; + SocketDescriptor(SocketDescriptor&& o) : self(o.self) { memset(&o, 0, sizeof(SocketDescriptor)); } + SocketDescriptor(LDKSocketDescriptor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKSocketDescriptor)); } + operator LDKSocketDescriptor() && { LDKSocketDescriptor res = self; memset(&self, 0, sizeof(LDKSocketDescriptor)); return res; } + ~SocketDescriptor() { SocketDescriptor_free(self); } + SocketDescriptor& operator=(SocketDescriptor&& o) { SocketDescriptor_free(self); self = o.self; memset(&o, 0, sizeof(SocketDescriptor)); return *this; } + LDKSocketDescriptor* operator &() { return &self; } + LDKSocketDescriptor* operator ->() { return &self; } + const LDKSocketDescriptor* operator &() const { return &self; } + const LDKSocketDescriptor* operator ->() const { return &self; } }; -class MonitorUpdateError { +class PeerHandleError { private: - LDKMonitorUpdateError self; + LDKPeerHandleError self; public: - MonitorUpdateError(const MonitorUpdateError&) = delete; - MonitorUpdateError(MonitorUpdateError&& o) : self(o.self) { memset(&o, 0, sizeof(MonitorUpdateError)); } - MonitorUpdateError(LDKMonitorUpdateError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMonitorUpdateError)); } - operator LDKMonitorUpdateError() && { LDKMonitorUpdateError res = self; memset(&self, 0, sizeof(LDKMonitorUpdateError)); return res; } - ~MonitorUpdateError() { MonitorUpdateError_free(self); } - MonitorUpdateError& operator=(MonitorUpdateError&& o) { MonitorUpdateError_free(self); self = o.self; memset(&o, 0, sizeof(MonitorUpdateError)); return *this; } - LDKMonitorUpdateError* operator &() { return &self; } - LDKMonitorUpdateError* operator ->() { return &self; } - const LDKMonitorUpdateError* operator &() const { return &self; } - const LDKMonitorUpdateError* operator ->() const { return &self; } + PeerHandleError(const PeerHandleError&) = delete; + PeerHandleError(PeerHandleError&& o) : self(o.self) { memset(&o, 0, sizeof(PeerHandleError)); } + PeerHandleError(LDKPeerHandleError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPeerHandleError)); } + operator LDKPeerHandleError() && { LDKPeerHandleError res = self; memset(&self, 0, sizeof(LDKPeerHandleError)); return res; } + ~PeerHandleError() { PeerHandleError_free(self); } + PeerHandleError& operator=(PeerHandleError&& o) { PeerHandleError_free(self); self = o.self; memset(&o, 0, sizeof(PeerHandleError)); return *this; } + LDKPeerHandleError* operator &() { return &self; } + LDKPeerHandleError* operator ->() { return &self; } + const LDKPeerHandleError* operator &() const { return &self; } + const LDKPeerHandleError* operator ->() const { return &self; } }; -class MonitorEvent { +class PeerManager { private: - LDKMonitorEvent self; + LDKPeerManager self; public: - MonitorEvent(const MonitorEvent&) = delete; - MonitorEvent(MonitorEvent&& o) : self(o.self) { memset(&o, 0, sizeof(MonitorEvent)); } - MonitorEvent(LDKMonitorEvent&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMonitorEvent)); } - operator LDKMonitorEvent() && { LDKMonitorEvent res = self; memset(&self, 0, sizeof(LDKMonitorEvent)); return res; } - ~MonitorEvent() { MonitorEvent_free(self); } - MonitorEvent& operator=(MonitorEvent&& o) { MonitorEvent_free(self); self = o.self; memset(&o, 0, sizeof(MonitorEvent)); return *this; } - LDKMonitorEvent* operator &() { return &self; } - LDKMonitorEvent* operator ->() { return &self; } - const LDKMonitorEvent* operator &() const { return &self; } - const LDKMonitorEvent* operator ->() const { return &self; } + PeerManager(const PeerManager&) = delete; + PeerManager(PeerManager&& o) : self(o.self) { memset(&o, 0, sizeof(PeerManager)); } + PeerManager(LDKPeerManager&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPeerManager)); } + operator LDKPeerManager() && { LDKPeerManager res = self; memset(&self, 0, sizeof(LDKPeerManager)); return res; } + ~PeerManager() { PeerManager_free(self); } + PeerManager& operator=(PeerManager&& o) { PeerManager_free(self); self = o.self; memset(&o, 0, sizeof(PeerManager)); return *this; } + LDKPeerManager* operator &() { return &self; } + LDKPeerManager* operator ->() { return &self; } + const LDKPeerManager* operator &() const { return &self; } + const LDKPeerManager* operator ->() const { return &self; } }; -class HTLCUpdate { +class InitFeatures { private: - LDKHTLCUpdate self; + LDKInitFeatures self; public: - HTLCUpdate(const HTLCUpdate&) = delete; - HTLCUpdate(HTLCUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(HTLCUpdate)); } - HTLCUpdate(LDKHTLCUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHTLCUpdate)); } - operator LDKHTLCUpdate() && { LDKHTLCUpdate res = self; memset(&self, 0, sizeof(LDKHTLCUpdate)); return res; } - ~HTLCUpdate() { HTLCUpdate_free(self); } - HTLCUpdate& operator=(HTLCUpdate&& o) { HTLCUpdate_free(self); self = o.self; memset(&o, 0, sizeof(HTLCUpdate)); return *this; } - LDKHTLCUpdate* operator &() { return &self; } - LDKHTLCUpdate* operator ->() { return &self; } - const LDKHTLCUpdate* operator &() const { return &self; } - const LDKHTLCUpdate* operator ->() const { return &self; } + InitFeatures(const InitFeatures&) = delete; + InitFeatures(InitFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(InitFeatures)); } + InitFeatures(LDKInitFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKInitFeatures)); } + operator LDKInitFeatures() && { LDKInitFeatures res = self; memset(&self, 0, sizeof(LDKInitFeatures)); return res; } + ~InitFeatures() { InitFeatures_free(self); } + InitFeatures& operator=(InitFeatures&& o) { InitFeatures_free(self); self = o.self; memset(&o, 0, sizeof(InitFeatures)); return *this; } + LDKInitFeatures* operator &() { return &self; } + LDKInitFeatures* operator ->() { return &self; } + const LDKInitFeatures* operator &() const { return &self; } + const LDKInitFeatures* operator ->() const { return &self; } }; -class ChannelMonitor { +class NodeFeatures { private: - LDKChannelMonitor self; + LDKNodeFeatures self; public: - ChannelMonitor(const ChannelMonitor&) = delete; - ChannelMonitor(ChannelMonitor&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMonitor)); } - ChannelMonitor(LDKChannelMonitor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMonitor)); } - operator LDKChannelMonitor() && { LDKChannelMonitor res = self; memset(&self, 0, sizeof(LDKChannelMonitor)); return res; } - ~ChannelMonitor() { ChannelMonitor_free(self); } - ChannelMonitor& operator=(ChannelMonitor&& o) { ChannelMonitor_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMonitor)); return *this; } - LDKChannelMonitor* operator &() { return &self; } - LDKChannelMonitor* operator ->() { return &self; } - const LDKChannelMonitor* operator &() const { return &self; } - const LDKChannelMonitor* operator ->() const { return &self; } + NodeFeatures(const NodeFeatures&) = delete; + NodeFeatures(NodeFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(NodeFeatures)); } + NodeFeatures(LDKNodeFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeFeatures)); } + operator LDKNodeFeatures() && { LDKNodeFeatures res = self; memset(&self, 0, sizeof(LDKNodeFeatures)); return res; } + ~NodeFeatures() { NodeFeatures_free(self); } + NodeFeatures& operator=(NodeFeatures&& o) { NodeFeatures_free(self); self = o.self; memset(&o, 0, sizeof(NodeFeatures)); return *this; } + LDKNodeFeatures* operator &() { return &self; } + LDKNodeFeatures* operator ->() { return &self; } + const LDKNodeFeatures* operator &() const { return &self; } + const LDKNodeFeatures* operator ->() const { return &self; } }; -class Persist { +class ChannelFeatures { private: - LDKPersist self; + LDKChannelFeatures self; public: - Persist(const Persist&) = delete; - Persist(Persist&& o) : self(o.self) { memset(&o, 0, sizeof(Persist)); } - Persist(LDKPersist&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPersist)); } - operator LDKPersist() && { LDKPersist res = self; memset(&self, 0, sizeof(LDKPersist)); return res; } - ~Persist() { Persist_free(self); } - Persist& operator=(Persist&& o) { Persist_free(self); self = o.self; memset(&o, 0, sizeof(Persist)); return *this; } - LDKPersist* operator &() { return &self; } - LDKPersist* operator ->() { return &self; } - const LDKPersist* operator &() const { return &self; } - const LDKPersist* operator ->() const { return &self; } + ChannelFeatures(const ChannelFeatures&) = delete; + ChannelFeatures(ChannelFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelFeatures)); } + ChannelFeatures(LDKChannelFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelFeatures)); } + operator LDKChannelFeatures() && { LDKChannelFeatures res = self; memset(&self, 0, sizeof(LDKChannelFeatures)); return res; } + ~ChannelFeatures() { ChannelFeatures_free(self); } + ChannelFeatures& operator=(ChannelFeatures&& o) { ChannelFeatures_free(self); self = o.self; memset(&o, 0, sizeof(ChannelFeatures)); return *this; } + LDKChannelFeatures* operator &() { return &self; } + LDKChannelFeatures* operator ->() { return &self; } + const LDKChannelFeatures* operator &() const { return &self; } + const LDKChannelFeatures* operator ->() const { return &self; } }; -class OutPoint { +class ChannelHandshakeConfig { private: - LDKOutPoint self; + LDKChannelHandshakeConfig self; public: - OutPoint(const OutPoint&) = delete; - OutPoint(OutPoint&& o) : self(o.self) { memset(&o, 0, sizeof(OutPoint)); } - OutPoint(LDKOutPoint&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKOutPoint)); } - operator LDKOutPoint() && { LDKOutPoint res = self; memset(&self, 0, sizeof(LDKOutPoint)); return res; } - ~OutPoint() { OutPoint_free(self); } - OutPoint& operator=(OutPoint&& o) { OutPoint_free(self); self = o.self; memset(&o, 0, sizeof(OutPoint)); return *this; } - LDKOutPoint* operator &() { return &self; } - LDKOutPoint* operator ->() { return &self; } - const LDKOutPoint* operator &() const { return &self; } - const LDKOutPoint* operator ->() const { return &self; } + ChannelHandshakeConfig(const ChannelHandshakeConfig&) = delete; + ChannelHandshakeConfig(ChannelHandshakeConfig&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelHandshakeConfig)); } + ChannelHandshakeConfig(LDKChannelHandshakeConfig&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelHandshakeConfig)); } + operator LDKChannelHandshakeConfig() && { LDKChannelHandshakeConfig res = self; memset(&self, 0, sizeof(LDKChannelHandshakeConfig)); return res; } + ~ChannelHandshakeConfig() { ChannelHandshakeConfig_free(self); } + ChannelHandshakeConfig& operator=(ChannelHandshakeConfig&& o) { ChannelHandshakeConfig_free(self); self = o.self; memset(&o, 0, sizeof(ChannelHandshakeConfig)); return *this; } + LDKChannelHandshakeConfig* operator &() { return &self; } + LDKChannelHandshakeConfig* operator ->() { return &self; } + const LDKChannelHandshakeConfig* operator &() const { return &self; } + const LDKChannelHandshakeConfig* operator ->() const { return &self; } }; -class SpendableOutputDescriptor { +class ChannelHandshakeLimits { private: - LDKSpendableOutputDescriptor self; + LDKChannelHandshakeLimits self; public: - SpendableOutputDescriptor(const SpendableOutputDescriptor&) = delete; - SpendableOutputDescriptor(SpendableOutputDescriptor&& o) : self(o.self) { memset(&o, 0, sizeof(SpendableOutputDescriptor)); } - SpendableOutputDescriptor(LDKSpendableOutputDescriptor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKSpendableOutputDescriptor)); } - operator LDKSpendableOutputDescriptor() && { LDKSpendableOutputDescriptor res = self; memset(&self, 0, sizeof(LDKSpendableOutputDescriptor)); return res; } - ~SpendableOutputDescriptor() { SpendableOutputDescriptor_free(self); } - SpendableOutputDescriptor& operator=(SpendableOutputDescriptor&& o) { SpendableOutputDescriptor_free(self); self = o.self; memset(&o, 0, sizeof(SpendableOutputDescriptor)); return *this; } - LDKSpendableOutputDescriptor* operator &() { return &self; } - LDKSpendableOutputDescriptor* operator ->() { return &self; } - const LDKSpendableOutputDescriptor* operator &() const { return &self; } - const LDKSpendableOutputDescriptor* operator ->() const { return &self; } + ChannelHandshakeLimits(const ChannelHandshakeLimits&) = delete; + ChannelHandshakeLimits(ChannelHandshakeLimits&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelHandshakeLimits)); } + ChannelHandshakeLimits(LDKChannelHandshakeLimits&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelHandshakeLimits)); } + operator LDKChannelHandshakeLimits() && { LDKChannelHandshakeLimits res = self; memset(&self, 0, sizeof(LDKChannelHandshakeLimits)); return res; } + ~ChannelHandshakeLimits() { ChannelHandshakeLimits_free(self); } + ChannelHandshakeLimits& operator=(ChannelHandshakeLimits&& o) { ChannelHandshakeLimits_free(self); self = o.self; memset(&o, 0, sizeof(ChannelHandshakeLimits)); return *this; } + LDKChannelHandshakeLimits* operator &() { return &self; } + LDKChannelHandshakeLimits* operator ->() { return &self; } + const LDKChannelHandshakeLimits* operator &() const { return &self; } + const LDKChannelHandshakeLimits* operator ->() const { return &self; } }; -class ChannelKeys { +class ChannelConfig { private: - LDKChannelKeys self; + LDKChannelConfig self; public: - ChannelKeys(const ChannelKeys&) = delete; - ChannelKeys(ChannelKeys&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelKeys)); } - ChannelKeys(LDKChannelKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelKeys)); } - operator LDKChannelKeys() && { LDKChannelKeys res = self; memset(&self, 0, sizeof(LDKChannelKeys)); return res; } - ~ChannelKeys() { ChannelKeys_free(self); } - ChannelKeys& operator=(ChannelKeys&& o) { ChannelKeys_free(self); self = o.self; memset(&o, 0, sizeof(ChannelKeys)); return *this; } - LDKChannelKeys* operator &() { return &self; } - LDKChannelKeys* operator ->() { return &self; } - const LDKChannelKeys* operator &() const { return &self; } - const LDKChannelKeys* operator ->() const { return &self; } + ChannelConfig(const ChannelConfig&) = delete; + ChannelConfig(ChannelConfig&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelConfig)); } + ChannelConfig(LDKChannelConfig&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelConfig)); } + operator LDKChannelConfig() && { LDKChannelConfig res = self; memset(&self, 0, sizeof(LDKChannelConfig)); return res; } + ~ChannelConfig() { ChannelConfig_free(self); } + ChannelConfig& operator=(ChannelConfig&& o) { ChannelConfig_free(self); self = o.self; memset(&o, 0, sizeof(ChannelConfig)); return *this; } + LDKChannelConfig* operator &() { return &self; } + LDKChannelConfig* operator ->() { return &self; } + const LDKChannelConfig* operator &() const { return &self; } + const LDKChannelConfig* operator ->() const { return &self; } +}; +class UserConfig { +private: + LDKUserConfig self; +public: + UserConfig(const UserConfig&) = delete; + UserConfig(UserConfig&& o) : self(o.self) { memset(&o, 0, sizeof(UserConfig)); } + UserConfig(LDKUserConfig&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUserConfig)); } + operator LDKUserConfig() && { LDKUserConfig res = self; memset(&self, 0, sizeof(LDKUserConfig)); return res; } + ~UserConfig() { UserConfig_free(self); } + UserConfig& operator=(UserConfig&& o) { UserConfig_free(self); self = o.self; memset(&o, 0, sizeof(UserConfig)); return *this; } + LDKUserConfig* operator &() { return &self; } + LDKUserConfig* operator ->() { return &self; } + const LDKUserConfig* operator &() const { return &self; } + const LDKUserConfig* operator ->() const { return &self; } +}; +class NetworkGraph { +private: + LDKNetworkGraph self; +public: + NetworkGraph(const NetworkGraph&) = delete; + NetworkGraph(NetworkGraph&& o) : self(o.self) { memset(&o, 0, sizeof(NetworkGraph)); } + NetworkGraph(LDKNetworkGraph&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNetworkGraph)); } + operator LDKNetworkGraph() && { LDKNetworkGraph res = self; memset(&self, 0, sizeof(LDKNetworkGraph)); return res; } + ~NetworkGraph() { NetworkGraph_free(self); } + NetworkGraph& operator=(NetworkGraph&& o) { NetworkGraph_free(self); self = o.self; memset(&o, 0, sizeof(NetworkGraph)); return *this; } + LDKNetworkGraph* operator &() { return &self; } + LDKNetworkGraph* operator ->() { return &self; } + const LDKNetworkGraph* operator &() const { return &self; } + const LDKNetworkGraph* operator ->() const { return &self; } }; -class KeysInterface { +class LockedNetworkGraph { private: - LDKKeysInterface self; + LDKLockedNetworkGraph self; public: - KeysInterface(const KeysInterface&) = delete; - KeysInterface(KeysInterface&& o) : self(o.self) { memset(&o, 0, sizeof(KeysInterface)); } - KeysInterface(LDKKeysInterface&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKKeysInterface)); } - operator LDKKeysInterface() && { LDKKeysInterface res = self; memset(&self, 0, sizeof(LDKKeysInterface)); return res; } - ~KeysInterface() { KeysInterface_free(self); } - KeysInterface& operator=(KeysInterface&& o) { KeysInterface_free(self); self = o.self; memset(&o, 0, sizeof(KeysInterface)); return *this; } - LDKKeysInterface* operator &() { return &self; } - LDKKeysInterface* operator ->() { return &self; } - const LDKKeysInterface* operator &() const { return &self; } - const LDKKeysInterface* operator ->() const { return &self; } + LockedNetworkGraph(const LockedNetworkGraph&) = delete; + LockedNetworkGraph(LockedNetworkGraph&& o) : self(o.self) { memset(&o, 0, sizeof(LockedNetworkGraph)); } + LockedNetworkGraph(LDKLockedNetworkGraph&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLockedNetworkGraph)); } + operator LDKLockedNetworkGraph() && { LDKLockedNetworkGraph res = self; memset(&self, 0, sizeof(LDKLockedNetworkGraph)); return res; } + ~LockedNetworkGraph() { LockedNetworkGraph_free(self); } + LockedNetworkGraph& operator=(LockedNetworkGraph&& o) { LockedNetworkGraph_free(self); self = o.self; memset(&o, 0, sizeof(LockedNetworkGraph)); return *this; } + LDKLockedNetworkGraph* operator &() { return &self; } + LDKLockedNetworkGraph* operator ->() { return &self; } + const LDKLockedNetworkGraph* operator &() const { return &self; } + const LDKLockedNetworkGraph* operator ->() const { return &self; } }; -class InMemoryChannelKeys { +class NetGraphMsgHandler { private: - LDKInMemoryChannelKeys self; + LDKNetGraphMsgHandler self; public: - InMemoryChannelKeys(const InMemoryChannelKeys&) = delete; - InMemoryChannelKeys(InMemoryChannelKeys&& o) : self(o.self) { memset(&o, 0, sizeof(InMemoryChannelKeys)); } - InMemoryChannelKeys(LDKInMemoryChannelKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKInMemoryChannelKeys)); } - operator LDKInMemoryChannelKeys() && { LDKInMemoryChannelKeys res = self; memset(&self, 0, sizeof(LDKInMemoryChannelKeys)); return res; } - ~InMemoryChannelKeys() { InMemoryChannelKeys_free(self); } - InMemoryChannelKeys& operator=(InMemoryChannelKeys&& o) { InMemoryChannelKeys_free(self); self = o.self; memset(&o, 0, sizeof(InMemoryChannelKeys)); return *this; } - LDKInMemoryChannelKeys* operator &() { return &self; } - LDKInMemoryChannelKeys* operator ->() { return &self; } - const LDKInMemoryChannelKeys* operator &() const { return &self; } - const LDKInMemoryChannelKeys* operator ->() const { return &self; } + NetGraphMsgHandler(const NetGraphMsgHandler&) = delete; + NetGraphMsgHandler(NetGraphMsgHandler&& o) : self(o.self) { memset(&o, 0, sizeof(NetGraphMsgHandler)); } + NetGraphMsgHandler(LDKNetGraphMsgHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNetGraphMsgHandler)); } + operator LDKNetGraphMsgHandler() && { LDKNetGraphMsgHandler res = self; memset(&self, 0, sizeof(LDKNetGraphMsgHandler)); return res; } + ~NetGraphMsgHandler() { NetGraphMsgHandler_free(self); } + NetGraphMsgHandler& operator=(NetGraphMsgHandler&& o) { NetGraphMsgHandler_free(self); self = o.self; memset(&o, 0, sizeof(NetGraphMsgHandler)); return *this; } + LDKNetGraphMsgHandler* operator &() { return &self; } + LDKNetGraphMsgHandler* operator ->() { return &self; } + const LDKNetGraphMsgHandler* operator &() const { return &self; } + const LDKNetGraphMsgHandler* operator ->() const { return &self; } }; -class KeysManager { +class DirectionalChannelInfo { private: - LDKKeysManager self; + LDKDirectionalChannelInfo self; public: - KeysManager(const KeysManager&) = delete; - KeysManager(KeysManager&& o) : self(o.self) { memset(&o, 0, sizeof(KeysManager)); } - KeysManager(LDKKeysManager&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKKeysManager)); } - operator LDKKeysManager() && { LDKKeysManager res = self; memset(&self, 0, sizeof(LDKKeysManager)); return res; } - ~KeysManager() { KeysManager_free(self); } - KeysManager& operator=(KeysManager&& o) { KeysManager_free(self); self = o.self; memset(&o, 0, sizeof(KeysManager)); return *this; } - LDKKeysManager* operator &() { return &self; } - LDKKeysManager* operator ->() { return &self; } - const LDKKeysManager* operator &() const { return &self; } - const LDKKeysManager* operator ->() const { return &self; } + DirectionalChannelInfo(const DirectionalChannelInfo&) = delete; + DirectionalChannelInfo(DirectionalChannelInfo&& o) : self(o.self) { memset(&o, 0, sizeof(DirectionalChannelInfo)); } + DirectionalChannelInfo(LDKDirectionalChannelInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDirectionalChannelInfo)); } + operator LDKDirectionalChannelInfo() && { LDKDirectionalChannelInfo res = self; memset(&self, 0, sizeof(LDKDirectionalChannelInfo)); return res; } + ~DirectionalChannelInfo() { DirectionalChannelInfo_free(self); } + DirectionalChannelInfo& operator=(DirectionalChannelInfo&& o) { DirectionalChannelInfo_free(self); self = o.self; memset(&o, 0, sizeof(DirectionalChannelInfo)); return *this; } + LDKDirectionalChannelInfo* operator &() { return &self; } + LDKDirectionalChannelInfo* operator ->() { return &self; } + const LDKDirectionalChannelInfo* operator &() const { return &self; } + const LDKDirectionalChannelInfo* operator ->() const { return &self; } }; -class AccessError { +class ChannelInfo { private: - LDKAccessError self; + LDKChannelInfo self; public: - AccessError(const AccessError&) = delete; - AccessError(AccessError&& o) : self(o.self) { memset(&o, 0, sizeof(AccessError)); } - AccessError(LDKAccessError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAccessError)); } - operator LDKAccessError() && { LDKAccessError res = self; memset(&self, 0, sizeof(LDKAccessError)); return res; } - AccessError& operator=(AccessError&& o) { self = o.self; memset(&o, 0, sizeof(AccessError)); return *this; } - LDKAccessError* operator &() { return &self; } - LDKAccessError* operator ->() { return &self; } - const LDKAccessError* operator &() const { return &self; } - const LDKAccessError* operator ->() const { return &self; } + ChannelInfo(const ChannelInfo&) = delete; + ChannelInfo(ChannelInfo&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelInfo)); } + ChannelInfo(LDKChannelInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelInfo)); } + operator LDKChannelInfo() && { LDKChannelInfo res = self; memset(&self, 0, sizeof(LDKChannelInfo)); return res; } + ~ChannelInfo() { ChannelInfo_free(self); } + ChannelInfo& operator=(ChannelInfo&& o) { ChannelInfo_free(self); self = o.self; memset(&o, 0, sizeof(ChannelInfo)); return *this; } + LDKChannelInfo* operator &() { return &self; } + LDKChannelInfo* operator ->() { return &self; } + const LDKChannelInfo* operator &() const { return &self; } + const LDKChannelInfo* operator ->() const { return &self; } }; -class Access { +class RoutingFees { private: - LDKAccess self; + LDKRoutingFees self; public: - Access(const Access&) = delete; - Access(Access&& o) : self(o.self) { memset(&o, 0, sizeof(Access)); } - Access(LDKAccess&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAccess)); } - operator LDKAccess() && { LDKAccess res = self; memset(&self, 0, sizeof(LDKAccess)); return res; } - ~Access() { Access_free(self); } - Access& operator=(Access&& o) { Access_free(self); self = o.self; memset(&o, 0, sizeof(Access)); return *this; } - LDKAccess* operator &() { return &self; } - LDKAccess* operator ->() { return &self; } - const LDKAccess* operator &() const { return &self; } - const LDKAccess* operator ->() const { return &self; } + RoutingFees(const RoutingFees&) = delete; + RoutingFees(RoutingFees&& o) : self(o.self) { memset(&o, 0, sizeof(RoutingFees)); } + RoutingFees(LDKRoutingFees&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRoutingFees)); } + operator LDKRoutingFees() && { LDKRoutingFees res = self; memset(&self, 0, sizeof(LDKRoutingFees)); return res; } + ~RoutingFees() { RoutingFees_free(self); } + RoutingFees& operator=(RoutingFees&& o) { RoutingFees_free(self); self = o.self; memset(&o, 0, sizeof(RoutingFees)); return *this; } + LDKRoutingFees* operator &() { return &self; } + LDKRoutingFees* operator ->() { return &self; } + const LDKRoutingFees* operator &() const { return &self; } + const LDKRoutingFees* operator ->() const { return &self; } }; -class Watch { +class NodeAnnouncementInfo { private: - LDKWatch self; + LDKNodeAnnouncementInfo self; public: - Watch(const Watch&) = delete; - Watch(Watch&& o) : self(o.self) { memset(&o, 0, sizeof(Watch)); } - Watch(LDKWatch&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKWatch)); } - operator LDKWatch() && { LDKWatch res = self; memset(&self, 0, sizeof(LDKWatch)); return res; } - ~Watch() { Watch_free(self); } - Watch& operator=(Watch&& o) { Watch_free(self); self = o.self; memset(&o, 0, sizeof(Watch)); return *this; } - LDKWatch* operator &() { return &self; } - LDKWatch* operator ->() { return &self; } - const LDKWatch* operator &() const { return &self; } - const LDKWatch* operator ->() const { return &self; } + NodeAnnouncementInfo(const NodeAnnouncementInfo&) = delete; + NodeAnnouncementInfo(NodeAnnouncementInfo&& o) : self(o.self) { memset(&o, 0, sizeof(NodeAnnouncementInfo)); } + NodeAnnouncementInfo(LDKNodeAnnouncementInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeAnnouncementInfo)); } + operator LDKNodeAnnouncementInfo() && { LDKNodeAnnouncementInfo res = self; memset(&self, 0, sizeof(LDKNodeAnnouncementInfo)); return res; } + ~NodeAnnouncementInfo() { NodeAnnouncementInfo_free(self); } + NodeAnnouncementInfo& operator=(NodeAnnouncementInfo&& o) { NodeAnnouncementInfo_free(self); self = o.self; memset(&o, 0, sizeof(NodeAnnouncementInfo)); return *this; } + LDKNodeAnnouncementInfo* operator &() { return &self; } + LDKNodeAnnouncementInfo* operator ->() { return &self; } + const LDKNodeAnnouncementInfo* operator &() const { return &self; } + const LDKNodeAnnouncementInfo* operator ->() const { return &self; } }; -class Filter { +class NodeInfo { private: - LDKFilter self; + LDKNodeInfo self; public: - Filter(const Filter&) = delete; - Filter(Filter&& o) : self(o.self) { memset(&o, 0, sizeof(Filter)); } - Filter(LDKFilter&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFilter)); } - operator LDKFilter() && { LDKFilter res = self; memset(&self, 0, sizeof(LDKFilter)); return res; } - ~Filter() { Filter_free(self); } - Filter& operator=(Filter&& o) { Filter_free(self); self = o.self; memset(&o, 0, sizeof(Filter)); return *this; } - LDKFilter* operator &() { return &self; } - LDKFilter* operator ->() { return &self; } - const LDKFilter* operator &() const { return &self; } - const LDKFilter* operator ->() const { return &self; } + NodeInfo(const NodeInfo&) = delete; + NodeInfo(NodeInfo&& o) : self(o.self) { memset(&o, 0, sizeof(NodeInfo)); } + NodeInfo(LDKNodeInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeInfo)); } + operator LDKNodeInfo() && { LDKNodeInfo res = self; memset(&self, 0, sizeof(LDKNodeInfo)); return res; } + ~NodeInfo() { NodeInfo_free(self); } + NodeInfo& operator=(NodeInfo&& o) { NodeInfo_free(self); self = o.self; memset(&o, 0, sizeof(NodeInfo)); return *this; } + LDKNodeInfo* operator &() { return &self; } + LDKNodeInfo* operator ->() { return &self; } + const LDKNodeInfo* operator &() const { return &self; } + const LDKNodeInfo* operator ->() const { return &self; } }; -class ChannelManager { +class Level { private: - LDKChannelManager self; + LDKLevel self; public: - ChannelManager(const ChannelManager&) = delete; - ChannelManager(ChannelManager&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelManager)); } - ChannelManager(LDKChannelManager&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelManager)); } - operator LDKChannelManager() && { LDKChannelManager res = self; memset(&self, 0, sizeof(LDKChannelManager)); return res; } - ~ChannelManager() { ChannelManager_free(self); } - ChannelManager& operator=(ChannelManager&& o) { ChannelManager_free(self); self = o.self; memset(&o, 0, sizeof(ChannelManager)); return *this; } - LDKChannelManager* operator &() { return &self; } - LDKChannelManager* operator ->() { return &self; } - const LDKChannelManager* operator &() const { return &self; } - const LDKChannelManager* operator ->() const { return &self; } + Level(const Level&) = delete; + Level(Level&& o) : self(o.self) { memset(&o, 0, sizeof(Level)); } + Level(LDKLevel&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLevel)); } + operator LDKLevel() && { LDKLevel res = self; memset(&self, 0, sizeof(LDKLevel)); return res; } + Level& operator=(Level&& o) { self = o.self; memset(&o, 0, sizeof(Level)); return *this; } + LDKLevel* operator &() { return &self; } + LDKLevel* operator ->() { return &self; } + const LDKLevel* operator &() const { return &self; } + const LDKLevel* operator ->() const { return &self; } }; -class ChannelDetails { +class Logger { private: - LDKChannelDetails self; + LDKLogger self; public: - ChannelDetails(const ChannelDetails&) = delete; - ChannelDetails(ChannelDetails&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelDetails)); } - ChannelDetails(LDKChannelDetails&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelDetails)); } - operator LDKChannelDetails() && { LDKChannelDetails res = self; memset(&self, 0, sizeof(LDKChannelDetails)); return res; } - ~ChannelDetails() { ChannelDetails_free(self); } - ChannelDetails& operator=(ChannelDetails&& o) { ChannelDetails_free(self); self = o.self; memset(&o, 0, sizeof(ChannelDetails)); return *this; } - LDKChannelDetails* operator &() { return &self; } - LDKChannelDetails* operator ->() { return &self; } - const LDKChannelDetails* operator &() const { return &self; } - const LDKChannelDetails* operator ->() const { return &self; } + Logger(const Logger&) = delete; + Logger(Logger&& o) : self(o.self) { memset(&o, 0, sizeof(Logger)); } + Logger(LDKLogger&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLogger)); } + operator LDKLogger() && { LDKLogger res = self; memset(&self, 0, sizeof(LDKLogger)); return res; } + ~Logger() { Logger_free(self); } + Logger& operator=(Logger&& o) { Logger_free(self); self = o.self; memset(&o, 0, sizeof(Logger)); return *this; } + LDKLogger* operator &() { return &self; } + LDKLogger* operator ->() { return &self; } + const LDKLogger* operator &() const { return &self; } + const LDKLogger* operator ->() const { return &self; } }; -class PaymentSendFailure { +class ChainMonitor { private: - LDKPaymentSendFailure self; + LDKChainMonitor self; public: - PaymentSendFailure(const PaymentSendFailure&) = delete; - PaymentSendFailure(PaymentSendFailure&& o) : self(o.self) { memset(&o, 0, sizeof(PaymentSendFailure)); } - PaymentSendFailure(LDKPaymentSendFailure&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPaymentSendFailure)); } - operator LDKPaymentSendFailure() && { LDKPaymentSendFailure res = self; memset(&self, 0, sizeof(LDKPaymentSendFailure)); return res; } - ~PaymentSendFailure() { PaymentSendFailure_free(self); } - PaymentSendFailure& operator=(PaymentSendFailure&& o) { PaymentSendFailure_free(self); self = o.self; memset(&o, 0, sizeof(PaymentSendFailure)); return *this; } - LDKPaymentSendFailure* operator &() { return &self; } - LDKPaymentSendFailure* operator ->() { return &self; } - const LDKPaymentSendFailure* operator &() const { return &self; } - const LDKPaymentSendFailure* operator ->() const { return &self; } + ChainMonitor(const ChainMonitor&) = delete; + ChainMonitor(ChainMonitor&& o) : self(o.self) { memset(&o, 0, sizeof(ChainMonitor)); } + ChainMonitor(LDKChainMonitor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChainMonitor)); } + operator LDKChainMonitor() && { LDKChainMonitor res = self; memset(&self, 0, sizeof(LDKChainMonitor)); return res; } + ~ChainMonitor() { ChainMonitor_free(self); } + ChainMonitor& operator=(ChainMonitor&& o) { ChainMonitor_free(self); self = o.self; memset(&o, 0, sizeof(ChainMonitor)); return *this; } + LDKChainMonitor* operator &() { return &self; } + LDKChainMonitor* operator ->() { return &self; } + const LDKChainMonitor* operator &() const { return &self; } + const LDKChainMonitor* operator ->() const { return &self; } }; -class ChannelManagerReadArgs { -private: - LDKChannelManagerReadArgs self; -public: - ChannelManagerReadArgs(const ChannelManagerReadArgs&) = delete; - ChannelManagerReadArgs(ChannelManagerReadArgs&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelManagerReadArgs)); } - ChannelManagerReadArgs(LDKChannelManagerReadArgs&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelManagerReadArgs)); } - operator LDKChannelManagerReadArgs() && { LDKChannelManagerReadArgs res = self; memset(&self, 0, sizeof(LDKChannelManagerReadArgs)); return res; } - ~ChannelManagerReadArgs() { ChannelManagerReadArgs_free(self); } - ChannelManagerReadArgs& operator=(ChannelManagerReadArgs&& o) { ChannelManagerReadArgs_free(self); self = o.self; memset(&o, 0, sizeof(ChannelManagerReadArgs)); return *this; } - LDKChannelManagerReadArgs* operator &() { return &self; } - LDKChannelManagerReadArgs* operator ->() { return &self; } - const LDKChannelManagerReadArgs* operator &() const { return &self; } - const LDKChannelManagerReadArgs* operator ->() const { return &self; } +class OutPoint { +private: + LDKOutPoint self; +public: + OutPoint(const OutPoint&) = delete; + OutPoint(OutPoint&& o) : self(o.self) { memset(&o, 0, sizeof(OutPoint)); } + OutPoint(LDKOutPoint&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKOutPoint)); } + operator LDKOutPoint() && { LDKOutPoint res = self; memset(&self, 0, sizeof(LDKOutPoint)); return res; } + ~OutPoint() { OutPoint_free(self); } + OutPoint& operator=(OutPoint&& o) { OutPoint_free(self); self = o.self; memset(&o, 0, sizeof(OutPoint)); return *this; } + LDKOutPoint* operator &() { return &self; } + LDKOutPoint* operator ->() { return &self; } + const LDKOutPoint* operator &() const { return &self; } + const LDKOutPoint* operator ->() const { return &self; } }; -class DecodeError { +class ChannelMonitorUpdate { private: - LDKDecodeError self; + LDKChannelMonitorUpdate self; public: - DecodeError(const DecodeError&) = delete; - DecodeError(DecodeError&& o) : self(o.self) { memset(&o, 0, sizeof(DecodeError)); } - DecodeError(LDKDecodeError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDecodeError)); } - operator LDKDecodeError() && { LDKDecodeError res = self; memset(&self, 0, sizeof(LDKDecodeError)); return res; } - ~DecodeError() { DecodeError_free(self); } - DecodeError& operator=(DecodeError&& o) { DecodeError_free(self); self = o.self; memset(&o, 0, sizeof(DecodeError)); return *this; } - LDKDecodeError* operator &() { return &self; } - LDKDecodeError* operator ->() { return &self; } - const LDKDecodeError* operator &() const { return &self; } - const LDKDecodeError* operator ->() const { return &self; } + ChannelMonitorUpdate(const ChannelMonitorUpdate&) = delete; + ChannelMonitorUpdate(ChannelMonitorUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMonitorUpdate)); } + ChannelMonitorUpdate(LDKChannelMonitorUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMonitorUpdate)); } + operator LDKChannelMonitorUpdate() && { LDKChannelMonitorUpdate res = self; memset(&self, 0, sizeof(LDKChannelMonitorUpdate)); return res; } + ~ChannelMonitorUpdate() { ChannelMonitorUpdate_free(self); } + ChannelMonitorUpdate& operator=(ChannelMonitorUpdate&& o) { ChannelMonitorUpdate_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMonitorUpdate)); return *this; } + LDKChannelMonitorUpdate* operator &() { return &self; } + LDKChannelMonitorUpdate* operator ->() { return &self; } + const LDKChannelMonitorUpdate* operator &() const { return &self; } + const LDKChannelMonitorUpdate* operator ->() const { return &self; } }; -class Init { +class ChannelMonitorUpdateErr { private: - LDKInit self; + LDKChannelMonitorUpdateErr self; public: - Init(const Init&) = delete; - Init(Init&& o) : self(o.self) { memset(&o, 0, sizeof(Init)); } - Init(LDKInit&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKInit)); } - operator LDKInit() && { LDKInit res = self; memset(&self, 0, sizeof(LDKInit)); return res; } - ~Init() { Init_free(self); } - Init& operator=(Init&& o) { Init_free(self); self = o.self; memset(&o, 0, sizeof(Init)); return *this; } - LDKInit* operator &() { return &self; } - LDKInit* operator ->() { return &self; } - const LDKInit* operator &() const { return &self; } - const LDKInit* operator ->() const { return &self; } + ChannelMonitorUpdateErr(const ChannelMonitorUpdateErr&) = delete; + ChannelMonitorUpdateErr(ChannelMonitorUpdateErr&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMonitorUpdateErr)); } + ChannelMonitorUpdateErr(LDKChannelMonitorUpdateErr&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMonitorUpdateErr)); } + operator LDKChannelMonitorUpdateErr() && { LDKChannelMonitorUpdateErr res = self; memset(&self, 0, sizeof(LDKChannelMonitorUpdateErr)); return res; } + ChannelMonitorUpdateErr& operator=(ChannelMonitorUpdateErr&& o) { self = o.self; memset(&o, 0, sizeof(ChannelMonitorUpdateErr)); return *this; } + LDKChannelMonitorUpdateErr* operator &() { return &self; } + LDKChannelMonitorUpdateErr* operator ->() { return &self; } + const LDKChannelMonitorUpdateErr* operator &() const { return &self; } + const LDKChannelMonitorUpdateErr* operator ->() const { return &self; } }; -class ErrorMessage { +class MonitorUpdateError { private: - LDKErrorMessage self; + LDKMonitorUpdateError self; public: - ErrorMessage(const ErrorMessage&) = delete; - ErrorMessage(ErrorMessage&& o) : self(o.self) { memset(&o, 0, sizeof(ErrorMessage)); } - ErrorMessage(LDKErrorMessage&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKErrorMessage)); } - operator LDKErrorMessage() && { LDKErrorMessage res = self; memset(&self, 0, sizeof(LDKErrorMessage)); return res; } - ~ErrorMessage() { ErrorMessage_free(self); } - ErrorMessage& operator=(ErrorMessage&& o) { ErrorMessage_free(self); self = o.self; memset(&o, 0, sizeof(ErrorMessage)); return *this; } - LDKErrorMessage* operator &() { return &self; } - LDKErrorMessage* operator ->() { return &self; } - const LDKErrorMessage* operator &() const { return &self; } - const LDKErrorMessage* operator ->() const { return &self; } + MonitorUpdateError(const MonitorUpdateError&) = delete; + MonitorUpdateError(MonitorUpdateError&& o) : self(o.self) { memset(&o, 0, sizeof(MonitorUpdateError)); } + MonitorUpdateError(LDKMonitorUpdateError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMonitorUpdateError)); } + operator LDKMonitorUpdateError() && { LDKMonitorUpdateError res = self; memset(&self, 0, sizeof(LDKMonitorUpdateError)); return res; } + ~MonitorUpdateError() { MonitorUpdateError_free(self); } + MonitorUpdateError& operator=(MonitorUpdateError&& o) { MonitorUpdateError_free(self); self = o.self; memset(&o, 0, sizeof(MonitorUpdateError)); return *this; } + LDKMonitorUpdateError* operator &() { return &self; } + LDKMonitorUpdateError* operator ->() { return &self; } + const LDKMonitorUpdateError* operator &() const { return &self; } + const LDKMonitorUpdateError* operator ->() const { return &self; } }; -class Ping { +class MonitorEvent { private: - LDKPing self; + LDKMonitorEvent self; public: - Ping(const Ping&) = delete; - Ping(Ping&& o) : self(o.self) { memset(&o, 0, sizeof(Ping)); } - Ping(LDKPing&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPing)); } - operator LDKPing() && { LDKPing res = self; memset(&self, 0, sizeof(LDKPing)); return res; } - ~Ping() { Ping_free(self); } - Ping& operator=(Ping&& o) { Ping_free(self); self = o.self; memset(&o, 0, sizeof(Ping)); return *this; } - LDKPing* operator &() { return &self; } - LDKPing* operator ->() { return &self; } - const LDKPing* operator &() const { return &self; } - const LDKPing* operator ->() const { return &self; } + MonitorEvent(const MonitorEvent&) = delete; + MonitorEvent(MonitorEvent&& o) : self(o.self) { memset(&o, 0, sizeof(MonitorEvent)); } + MonitorEvent(LDKMonitorEvent&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMonitorEvent)); } + operator LDKMonitorEvent() && { LDKMonitorEvent res = self; memset(&self, 0, sizeof(LDKMonitorEvent)); return res; } + ~MonitorEvent() { MonitorEvent_free(self); } + MonitorEvent& operator=(MonitorEvent&& o) { MonitorEvent_free(self); self = o.self; memset(&o, 0, sizeof(MonitorEvent)); return *this; } + LDKMonitorEvent* operator &() { return &self; } + LDKMonitorEvent* operator ->() { return &self; } + const LDKMonitorEvent* operator &() const { return &self; } + const LDKMonitorEvent* operator ->() const { return &self; } }; -class Pong { +class HTLCUpdate { private: - LDKPong self; + LDKHTLCUpdate self; public: - Pong(const Pong&) = delete; - Pong(Pong&& o) : self(o.self) { memset(&o, 0, sizeof(Pong)); } - Pong(LDKPong&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPong)); } - operator LDKPong() && { LDKPong res = self; memset(&self, 0, sizeof(LDKPong)); return res; } - ~Pong() { Pong_free(self); } - Pong& operator=(Pong&& o) { Pong_free(self); self = o.self; memset(&o, 0, sizeof(Pong)); return *this; } - LDKPong* operator &() { return &self; } - LDKPong* operator ->() { return &self; } - const LDKPong* operator &() const { return &self; } - const LDKPong* operator ->() const { return &self; } + HTLCUpdate(const HTLCUpdate&) = delete; + HTLCUpdate(HTLCUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(HTLCUpdate)); } + HTLCUpdate(LDKHTLCUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHTLCUpdate)); } + operator LDKHTLCUpdate() && { LDKHTLCUpdate res = self; memset(&self, 0, sizeof(LDKHTLCUpdate)); return res; } + ~HTLCUpdate() { HTLCUpdate_free(self); } + HTLCUpdate& operator=(HTLCUpdate&& o) { HTLCUpdate_free(self); self = o.self; memset(&o, 0, sizeof(HTLCUpdate)); return *this; } + LDKHTLCUpdate* operator &() { return &self; } + LDKHTLCUpdate* operator ->() { return &self; } + const LDKHTLCUpdate* operator &() const { return &self; } + const LDKHTLCUpdate* operator ->() const { return &self; } }; -class OpenChannel { +class ChannelMonitor { private: - LDKOpenChannel self; + LDKChannelMonitor self; public: - OpenChannel(const OpenChannel&) = delete; - OpenChannel(OpenChannel&& o) : self(o.self) { memset(&o, 0, sizeof(OpenChannel)); } - OpenChannel(LDKOpenChannel&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKOpenChannel)); } - operator LDKOpenChannel() && { LDKOpenChannel res = self; memset(&self, 0, sizeof(LDKOpenChannel)); return res; } - ~OpenChannel() { OpenChannel_free(self); } - OpenChannel& operator=(OpenChannel&& o) { OpenChannel_free(self); self = o.self; memset(&o, 0, sizeof(OpenChannel)); return *this; } - LDKOpenChannel* operator &() { return &self; } - LDKOpenChannel* operator ->() { return &self; } - const LDKOpenChannel* operator &() const { return &self; } - const LDKOpenChannel* operator ->() const { return &self; } + ChannelMonitor(const ChannelMonitor&) = delete; + ChannelMonitor(ChannelMonitor&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMonitor)); } + ChannelMonitor(LDKChannelMonitor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMonitor)); } + operator LDKChannelMonitor() && { LDKChannelMonitor res = self; memset(&self, 0, sizeof(LDKChannelMonitor)); return res; } + ~ChannelMonitor() { ChannelMonitor_free(self); } + ChannelMonitor& operator=(ChannelMonitor&& o) { ChannelMonitor_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMonitor)); return *this; } + LDKChannelMonitor* operator &() { return &self; } + LDKChannelMonitor* operator ->() { return &self; } + const LDKChannelMonitor* operator &() const { return &self; } + const LDKChannelMonitor* operator ->() const { return &self; } }; -class AcceptChannel { +class Persist { private: - LDKAcceptChannel self; + LDKPersist self; public: - AcceptChannel(const AcceptChannel&) = delete; - AcceptChannel(AcceptChannel&& o) : self(o.self) { memset(&o, 0, sizeof(AcceptChannel)); } - AcceptChannel(LDKAcceptChannel&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAcceptChannel)); } - operator LDKAcceptChannel() && { LDKAcceptChannel res = self; memset(&self, 0, sizeof(LDKAcceptChannel)); return res; } - ~AcceptChannel() { AcceptChannel_free(self); } - AcceptChannel& operator=(AcceptChannel&& o) { AcceptChannel_free(self); self = o.self; memset(&o, 0, sizeof(AcceptChannel)); return *this; } - LDKAcceptChannel* operator &() { return &self; } - LDKAcceptChannel* operator ->() { return &self; } - const LDKAcceptChannel* operator &() const { return &self; } - const LDKAcceptChannel* operator ->() const { return &self; } + Persist(const Persist&) = delete; + Persist(Persist&& o) : self(o.self) { memset(&o, 0, sizeof(Persist)); } + Persist(LDKPersist&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPersist)); } + operator LDKPersist() && { LDKPersist res = self; memset(&self, 0, sizeof(LDKPersist)); return res; } + ~Persist() { Persist_free(self); } + Persist& operator=(Persist&& o) { Persist_free(self); self = o.self; memset(&o, 0, sizeof(Persist)); return *this; } + LDKPersist* operator &() { return &self; } + LDKPersist* operator ->() { return &self; } + const LDKPersist* operator &() const { return &self; } + const LDKPersist* operator ->() const { return &self; } }; -class FundingCreated { +class Event { private: - LDKFundingCreated self; + LDKEvent self; public: - FundingCreated(const FundingCreated&) = delete; - FundingCreated(FundingCreated&& o) : self(o.self) { memset(&o, 0, sizeof(FundingCreated)); } - FundingCreated(LDKFundingCreated&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFundingCreated)); } - operator LDKFundingCreated() && { LDKFundingCreated res = self; memset(&self, 0, sizeof(LDKFundingCreated)); return res; } - ~FundingCreated() { FundingCreated_free(self); } - FundingCreated& operator=(FundingCreated&& o) { FundingCreated_free(self); self = o.self; memset(&o, 0, sizeof(FundingCreated)); return *this; } - LDKFundingCreated* operator &() { return &self; } - LDKFundingCreated* operator ->() { return &self; } - const LDKFundingCreated* operator &() const { return &self; } - const LDKFundingCreated* operator ->() const { return &self; } + Event(const Event&) = delete; + Event(Event&& o) : self(o.self) { memset(&o, 0, sizeof(Event)); } + Event(LDKEvent&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKEvent)); } + operator LDKEvent() && { LDKEvent res = self; memset(&self, 0, sizeof(LDKEvent)); return res; } + ~Event() { Event_free(self); } + Event& operator=(Event&& o) { Event_free(self); self = o.self; memset(&o, 0, sizeof(Event)); return *this; } + LDKEvent* operator &() { return &self; } + LDKEvent* operator ->() { return &self; } + const LDKEvent* operator &() const { return &self; } + const LDKEvent* operator ->() const { return &self; } }; -class FundingSigned { +class MessageSendEvent { private: - LDKFundingSigned self; + LDKMessageSendEvent self; public: - FundingSigned(const FundingSigned&) = delete; - FundingSigned(FundingSigned&& o) : self(o.self) { memset(&o, 0, sizeof(FundingSigned)); } - FundingSigned(LDKFundingSigned&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFundingSigned)); } - operator LDKFundingSigned() && { LDKFundingSigned res = self; memset(&self, 0, sizeof(LDKFundingSigned)); return res; } - ~FundingSigned() { FundingSigned_free(self); } - FundingSigned& operator=(FundingSigned&& o) { FundingSigned_free(self); self = o.self; memset(&o, 0, sizeof(FundingSigned)); return *this; } - LDKFundingSigned* operator &() { return &self; } - LDKFundingSigned* operator ->() { return &self; } - const LDKFundingSigned* operator &() const { return &self; } - const LDKFundingSigned* operator ->() const { return &self; } + MessageSendEvent(const MessageSendEvent&) = delete; + MessageSendEvent(MessageSendEvent&& o) : self(o.self) { memset(&o, 0, sizeof(MessageSendEvent)); } + MessageSendEvent(LDKMessageSendEvent&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMessageSendEvent)); } + operator LDKMessageSendEvent() && { LDKMessageSendEvent res = self; memset(&self, 0, sizeof(LDKMessageSendEvent)); return res; } + ~MessageSendEvent() { MessageSendEvent_free(self); } + MessageSendEvent& operator=(MessageSendEvent&& o) { MessageSendEvent_free(self); self = o.self; memset(&o, 0, sizeof(MessageSendEvent)); return *this; } + LDKMessageSendEvent* operator &() { return &self; } + LDKMessageSendEvent* operator ->() { return &self; } + const LDKMessageSendEvent* operator &() const { return &self; } + const LDKMessageSendEvent* operator ->() const { return &self; } }; -class FundingLocked { +class MessageSendEventsProvider { private: - LDKFundingLocked self; + LDKMessageSendEventsProvider self; public: - FundingLocked(const FundingLocked&) = delete; - FundingLocked(FundingLocked&& o) : self(o.self) { memset(&o, 0, sizeof(FundingLocked)); } - FundingLocked(LDKFundingLocked&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFundingLocked)); } - operator LDKFundingLocked() && { LDKFundingLocked res = self; memset(&self, 0, sizeof(LDKFundingLocked)); return res; } - ~FundingLocked() { FundingLocked_free(self); } - FundingLocked& operator=(FundingLocked&& o) { FundingLocked_free(self); self = o.self; memset(&o, 0, sizeof(FundingLocked)); return *this; } - LDKFundingLocked* operator &() { return &self; } - LDKFundingLocked* operator ->() { return &self; } - const LDKFundingLocked* operator &() const { return &self; } - const LDKFundingLocked* operator ->() const { return &self; } + MessageSendEventsProvider(const MessageSendEventsProvider&) = delete; + MessageSendEventsProvider(MessageSendEventsProvider&& o) : self(o.self) { memset(&o, 0, sizeof(MessageSendEventsProvider)); } + MessageSendEventsProvider(LDKMessageSendEventsProvider&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMessageSendEventsProvider)); } + operator LDKMessageSendEventsProvider() && { LDKMessageSendEventsProvider res = self; memset(&self, 0, sizeof(LDKMessageSendEventsProvider)); return res; } + ~MessageSendEventsProvider() { MessageSendEventsProvider_free(self); } + MessageSendEventsProvider& operator=(MessageSendEventsProvider&& o) { MessageSendEventsProvider_free(self); self = o.self; memset(&o, 0, sizeof(MessageSendEventsProvider)); return *this; } + LDKMessageSendEventsProvider* operator &() { return &self; } + LDKMessageSendEventsProvider* operator ->() { return &self; } + const LDKMessageSendEventsProvider* operator &() const { return &self; } + const LDKMessageSendEventsProvider* operator ->() const { return &self; } }; -class Shutdown { +class EventsProvider { private: - LDKShutdown self; + LDKEventsProvider self; public: - Shutdown(const Shutdown&) = delete; - Shutdown(Shutdown&& o) : self(o.self) { memset(&o, 0, sizeof(Shutdown)); } - Shutdown(LDKShutdown&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKShutdown)); } - operator LDKShutdown() && { LDKShutdown res = self; memset(&self, 0, sizeof(LDKShutdown)); return res; } - ~Shutdown() { Shutdown_free(self); } - Shutdown& operator=(Shutdown&& o) { Shutdown_free(self); self = o.self; memset(&o, 0, sizeof(Shutdown)); return *this; } - LDKShutdown* operator &() { return &self; } - LDKShutdown* operator ->() { return &self; } - const LDKShutdown* operator &() const { return &self; } - const LDKShutdown* operator ->() const { return &self; } + EventsProvider(const EventsProvider&) = delete; + EventsProvider(EventsProvider&& o) : self(o.self) { memset(&o, 0, sizeof(EventsProvider)); } + EventsProvider(LDKEventsProvider&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKEventsProvider)); } + operator LDKEventsProvider() && { LDKEventsProvider res = self; memset(&self, 0, sizeof(LDKEventsProvider)); return res; } + ~EventsProvider() { EventsProvider_free(self); } + EventsProvider& operator=(EventsProvider&& o) { EventsProvider_free(self); self = o.self; memset(&o, 0, sizeof(EventsProvider)); return *this; } + LDKEventsProvider* operator &() { return &self; } + LDKEventsProvider* operator ->() { return &self; } + const LDKEventsProvider* operator &() const { return &self; } + const LDKEventsProvider* operator ->() const { return &self; } }; -class ClosingSigned { +class AccessError { private: - LDKClosingSigned self; + LDKAccessError self; public: - ClosingSigned(const ClosingSigned&) = delete; - ClosingSigned(ClosingSigned&& o) : self(o.self) { memset(&o, 0, sizeof(ClosingSigned)); } - ClosingSigned(LDKClosingSigned&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKClosingSigned)); } - operator LDKClosingSigned() && { LDKClosingSigned res = self; memset(&self, 0, sizeof(LDKClosingSigned)); return res; } - ~ClosingSigned() { ClosingSigned_free(self); } - ClosingSigned& operator=(ClosingSigned&& o) { ClosingSigned_free(self); self = o.self; memset(&o, 0, sizeof(ClosingSigned)); return *this; } - LDKClosingSigned* operator &() { return &self; } - LDKClosingSigned* operator ->() { return &self; } - const LDKClosingSigned* operator &() const { return &self; } - const LDKClosingSigned* operator ->() const { return &self; } + AccessError(const AccessError&) = delete; + AccessError(AccessError&& o) : self(o.self) { memset(&o, 0, sizeof(AccessError)); } + AccessError(LDKAccessError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAccessError)); } + operator LDKAccessError() && { LDKAccessError res = self; memset(&self, 0, sizeof(LDKAccessError)); return res; } + AccessError& operator=(AccessError&& o) { self = o.self; memset(&o, 0, sizeof(AccessError)); return *this; } + LDKAccessError* operator &() { return &self; } + LDKAccessError* operator ->() { return &self; } + const LDKAccessError* operator &() const { return &self; } + const LDKAccessError* operator ->() const { return &self; } }; -class UpdateAddHTLC { +class Access { private: - LDKUpdateAddHTLC self; + LDKAccess self; public: - UpdateAddHTLC(const UpdateAddHTLC&) = delete; - UpdateAddHTLC(UpdateAddHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateAddHTLC)); } - UpdateAddHTLC(LDKUpdateAddHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateAddHTLC)); } - operator LDKUpdateAddHTLC() && { LDKUpdateAddHTLC res = self; memset(&self, 0, sizeof(LDKUpdateAddHTLC)); return res; } - ~UpdateAddHTLC() { UpdateAddHTLC_free(self); } - UpdateAddHTLC& operator=(UpdateAddHTLC&& o) { UpdateAddHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateAddHTLC)); return *this; } - LDKUpdateAddHTLC* operator &() { return &self; } - LDKUpdateAddHTLC* operator ->() { return &self; } - const LDKUpdateAddHTLC* operator &() const { return &self; } - const LDKUpdateAddHTLC* operator ->() const { return &self; } + Access(const Access&) = delete; + Access(Access&& o) : self(o.self) { memset(&o, 0, sizeof(Access)); } + Access(LDKAccess&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAccess)); } + operator LDKAccess() && { LDKAccess res = self; memset(&self, 0, sizeof(LDKAccess)); return res; } + ~Access() { Access_free(self); } + Access& operator=(Access&& o) { Access_free(self); self = o.self; memset(&o, 0, sizeof(Access)); return *this; } + LDKAccess* operator &() { return &self; } + LDKAccess* operator ->() { return &self; } + const LDKAccess* operator &() const { return &self; } + const LDKAccess* operator ->() const { return &self; } }; -class UpdateFulfillHTLC { +class Watch { private: - LDKUpdateFulfillHTLC self; + LDKWatch self; public: - UpdateFulfillHTLC(const UpdateFulfillHTLC&) = delete; - UpdateFulfillHTLC(UpdateFulfillHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFulfillHTLC)); } - UpdateFulfillHTLC(LDKUpdateFulfillHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFulfillHTLC)); } - operator LDKUpdateFulfillHTLC() && { LDKUpdateFulfillHTLC res = self; memset(&self, 0, sizeof(LDKUpdateFulfillHTLC)); return res; } - ~UpdateFulfillHTLC() { UpdateFulfillHTLC_free(self); } - UpdateFulfillHTLC& operator=(UpdateFulfillHTLC&& o) { UpdateFulfillHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFulfillHTLC)); return *this; } - LDKUpdateFulfillHTLC* operator &() { return &self; } - LDKUpdateFulfillHTLC* operator ->() { return &self; } - const LDKUpdateFulfillHTLC* operator &() const { return &self; } - const LDKUpdateFulfillHTLC* operator ->() const { return &self; } + Watch(const Watch&) = delete; + Watch(Watch&& o) : self(o.self) { memset(&o, 0, sizeof(Watch)); } + Watch(LDKWatch&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKWatch)); } + operator LDKWatch() && { LDKWatch res = self; memset(&self, 0, sizeof(LDKWatch)); return res; } + ~Watch() { Watch_free(self); } + Watch& operator=(Watch&& o) { Watch_free(self); self = o.self; memset(&o, 0, sizeof(Watch)); return *this; } + LDKWatch* operator &() { return &self; } + LDKWatch* operator ->() { return &self; } + const LDKWatch* operator &() const { return &self; } + const LDKWatch* operator ->() const { return &self; } }; -class UpdateFailHTLC { +class Filter { private: - LDKUpdateFailHTLC self; + LDKFilter self; public: - UpdateFailHTLC(const UpdateFailHTLC&) = delete; - UpdateFailHTLC(UpdateFailHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFailHTLC)); } - UpdateFailHTLC(LDKUpdateFailHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFailHTLC)); } - operator LDKUpdateFailHTLC() && { LDKUpdateFailHTLC res = self; memset(&self, 0, sizeof(LDKUpdateFailHTLC)); return res; } - ~UpdateFailHTLC() { UpdateFailHTLC_free(self); } - UpdateFailHTLC& operator=(UpdateFailHTLC&& o) { UpdateFailHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFailHTLC)); return *this; } - LDKUpdateFailHTLC* operator &() { return &self; } - LDKUpdateFailHTLC* operator ->() { return &self; } - const LDKUpdateFailHTLC* operator &() const { return &self; } - const LDKUpdateFailHTLC* operator ->() const { return &self; } + Filter(const Filter&) = delete; + Filter(Filter&& o) : self(o.self) { memset(&o, 0, sizeof(Filter)); } + Filter(LDKFilter&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFilter)); } + operator LDKFilter() && { LDKFilter res = self; memset(&self, 0, sizeof(LDKFilter)); return res; } + ~Filter() { Filter_free(self); } + Filter& operator=(Filter&& o) { Filter_free(self); self = o.self; memset(&o, 0, sizeof(Filter)); return *this; } + LDKFilter* operator &() { return &self; } + LDKFilter* operator ->() { return &self; } + const LDKFilter* operator &() const { return &self; } + const LDKFilter* operator ->() const { return &self; } }; -class UpdateFailMalformedHTLC { +class BroadcasterInterface { private: - LDKUpdateFailMalformedHTLC self; + LDKBroadcasterInterface self; public: - UpdateFailMalformedHTLC(const UpdateFailMalformedHTLC&) = delete; - UpdateFailMalformedHTLC(UpdateFailMalformedHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFailMalformedHTLC)); } - UpdateFailMalformedHTLC(LDKUpdateFailMalformedHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFailMalformedHTLC)); } - operator LDKUpdateFailMalformedHTLC() && { LDKUpdateFailMalformedHTLC res = self; memset(&self, 0, sizeof(LDKUpdateFailMalformedHTLC)); return res; } - ~UpdateFailMalformedHTLC() { UpdateFailMalformedHTLC_free(self); } - UpdateFailMalformedHTLC& operator=(UpdateFailMalformedHTLC&& o) { UpdateFailMalformedHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFailMalformedHTLC)); return *this; } - LDKUpdateFailMalformedHTLC* operator &() { return &self; } - LDKUpdateFailMalformedHTLC* operator ->() { return &self; } - const LDKUpdateFailMalformedHTLC* operator &() const { return &self; } - const LDKUpdateFailMalformedHTLC* operator ->() const { return &self; } + BroadcasterInterface(const BroadcasterInterface&) = delete; + BroadcasterInterface(BroadcasterInterface&& o) : self(o.self) { memset(&o, 0, sizeof(BroadcasterInterface)); } + BroadcasterInterface(LDKBroadcasterInterface&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKBroadcasterInterface)); } + operator LDKBroadcasterInterface() && { LDKBroadcasterInterface res = self; memset(&self, 0, sizeof(LDKBroadcasterInterface)); return res; } + ~BroadcasterInterface() { BroadcasterInterface_free(self); } + BroadcasterInterface& operator=(BroadcasterInterface&& o) { BroadcasterInterface_free(self); self = o.self; memset(&o, 0, sizeof(BroadcasterInterface)); return *this; } + LDKBroadcasterInterface* operator &() { return &self; } + LDKBroadcasterInterface* operator ->() { return &self; } + const LDKBroadcasterInterface* operator &() const { return &self; } + const LDKBroadcasterInterface* operator ->() const { return &self; } }; -class CommitmentSigned { +class ConfirmationTarget { private: - LDKCommitmentSigned self; + LDKConfirmationTarget self; public: - CommitmentSigned(const CommitmentSigned&) = delete; - CommitmentSigned(CommitmentSigned&& o) : self(o.self) { memset(&o, 0, sizeof(CommitmentSigned)); } - CommitmentSigned(LDKCommitmentSigned&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCommitmentSigned)); } - operator LDKCommitmentSigned() && { LDKCommitmentSigned res = self; memset(&self, 0, sizeof(LDKCommitmentSigned)); return res; } - ~CommitmentSigned() { CommitmentSigned_free(self); } - CommitmentSigned& operator=(CommitmentSigned&& o) { CommitmentSigned_free(self); self = o.self; memset(&o, 0, sizeof(CommitmentSigned)); return *this; } - LDKCommitmentSigned* operator &() { return &self; } - LDKCommitmentSigned* operator ->() { return &self; } - const LDKCommitmentSigned* operator &() const { return &self; } - const LDKCommitmentSigned* operator ->() const { return &self; } + ConfirmationTarget(const ConfirmationTarget&) = delete; + ConfirmationTarget(ConfirmationTarget&& o) : self(o.self) { memset(&o, 0, sizeof(ConfirmationTarget)); } + ConfirmationTarget(LDKConfirmationTarget&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKConfirmationTarget)); } + operator LDKConfirmationTarget() && { LDKConfirmationTarget res = self; memset(&self, 0, sizeof(LDKConfirmationTarget)); return res; } + ConfirmationTarget& operator=(ConfirmationTarget&& o) { self = o.self; memset(&o, 0, sizeof(ConfirmationTarget)); return *this; } + LDKConfirmationTarget* operator &() { return &self; } + LDKConfirmationTarget* operator ->() { return &self; } + const LDKConfirmationTarget* operator &() const { return &self; } + const LDKConfirmationTarget* operator ->() const { return &self; } }; -class RevokeAndACK { +class FeeEstimator { private: - LDKRevokeAndACK self; + LDKFeeEstimator self; public: - RevokeAndACK(const RevokeAndACK&) = delete; - RevokeAndACK(RevokeAndACK&& o) : self(o.self) { memset(&o, 0, sizeof(RevokeAndACK)); } - RevokeAndACK(LDKRevokeAndACK&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRevokeAndACK)); } - operator LDKRevokeAndACK() && { LDKRevokeAndACK res = self; memset(&self, 0, sizeof(LDKRevokeAndACK)); return res; } - ~RevokeAndACK() { RevokeAndACK_free(self); } - RevokeAndACK& operator=(RevokeAndACK&& o) { RevokeAndACK_free(self); self = o.self; memset(&o, 0, sizeof(RevokeAndACK)); return *this; } - LDKRevokeAndACK* operator &() { return &self; } - LDKRevokeAndACK* operator ->() { return &self; } - const LDKRevokeAndACK* operator &() const { return &self; } - const LDKRevokeAndACK* operator ->() const { return &self; } + FeeEstimator(const FeeEstimator&) = delete; + FeeEstimator(FeeEstimator&& o) : self(o.self) { memset(&o, 0, sizeof(FeeEstimator)); } + FeeEstimator(LDKFeeEstimator&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFeeEstimator)); } + operator LDKFeeEstimator() && { LDKFeeEstimator res = self; memset(&self, 0, sizeof(LDKFeeEstimator)); return res; } + ~FeeEstimator() { FeeEstimator_free(self); } + FeeEstimator& operator=(FeeEstimator&& o) { FeeEstimator_free(self); self = o.self; memset(&o, 0, sizeof(FeeEstimator)); return *this; } + LDKFeeEstimator* operator &() { return &self; } + LDKFeeEstimator* operator ->() { return &self; } + const LDKFeeEstimator* operator &() const { return &self; } + const LDKFeeEstimator* operator ->() const { return &self; } }; -class UpdateFee { +class ChannelManager { private: - LDKUpdateFee self; + LDKChannelManager self; public: - UpdateFee(const UpdateFee&) = delete; - UpdateFee(UpdateFee&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFee)); } - UpdateFee(LDKUpdateFee&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFee)); } - operator LDKUpdateFee() && { LDKUpdateFee res = self; memset(&self, 0, sizeof(LDKUpdateFee)); return res; } - ~UpdateFee() { UpdateFee_free(self); } - UpdateFee& operator=(UpdateFee&& o) { UpdateFee_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFee)); return *this; } - LDKUpdateFee* operator &() { return &self; } - LDKUpdateFee* operator ->() { return &self; } - const LDKUpdateFee* operator &() const { return &self; } - const LDKUpdateFee* operator ->() const { return &self; } + ChannelManager(const ChannelManager&) = delete; + ChannelManager(ChannelManager&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelManager)); } + ChannelManager(LDKChannelManager&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelManager)); } + operator LDKChannelManager() && { LDKChannelManager res = self; memset(&self, 0, sizeof(LDKChannelManager)); return res; } + ~ChannelManager() { ChannelManager_free(self); } + ChannelManager& operator=(ChannelManager&& o) { ChannelManager_free(self); self = o.self; memset(&o, 0, sizeof(ChannelManager)); return *this; } + LDKChannelManager* operator &() { return &self; } + LDKChannelManager* operator ->() { return &self; } + const LDKChannelManager* operator &() const { return &self; } + const LDKChannelManager* operator ->() const { return &self; } }; -class DataLossProtect { +class ChannelDetails { private: - LDKDataLossProtect self; + LDKChannelDetails self; public: - DataLossProtect(const DataLossProtect&) = delete; - DataLossProtect(DataLossProtect&& o) : self(o.self) { memset(&o, 0, sizeof(DataLossProtect)); } - DataLossProtect(LDKDataLossProtect&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDataLossProtect)); } - operator LDKDataLossProtect() && { LDKDataLossProtect res = self; memset(&self, 0, sizeof(LDKDataLossProtect)); return res; } - ~DataLossProtect() { DataLossProtect_free(self); } - DataLossProtect& operator=(DataLossProtect&& o) { DataLossProtect_free(self); self = o.self; memset(&o, 0, sizeof(DataLossProtect)); return *this; } - LDKDataLossProtect* operator &() { return &self; } - LDKDataLossProtect* operator ->() { return &self; } - const LDKDataLossProtect* operator &() const { return &self; } - const LDKDataLossProtect* operator ->() const { return &self; } + ChannelDetails(const ChannelDetails&) = delete; + ChannelDetails(ChannelDetails&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelDetails)); } + ChannelDetails(LDKChannelDetails&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelDetails)); } + operator LDKChannelDetails() && { LDKChannelDetails res = self; memset(&self, 0, sizeof(LDKChannelDetails)); return res; } + ~ChannelDetails() { ChannelDetails_free(self); } + ChannelDetails& operator=(ChannelDetails&& o) { ChannelDetails_free(self); self = o.self; memset(&o, 0, sizeof(ChannelDetails)); return *this; } + LDKChannelDetails* operator &() { return &self; } + LDKChannelDetails* operator ->() { return &self; } + const LDKChannelDetails* operator &() const { return &self; } + const LDKChannelDetails* operator ->() const { return &self; } }; -class ChannelReestablish { +class PaymentSendFailure { private: - LDKChannelReestablish self; + LDKPaymentSendFailure self; public: - ChannelReestablish(const ChannelReestablish&) = delete; - ChannelReestablish(ChannelReestablish&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelReestablish)); } - ChannelReestablish(LDKChannelReestablish&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelReestablish)); } - operator LDKChannelReestablish() && { LDKChannelReestablish res = self; memset(&self, 0, sizeof(LDKChannelReestablish)); return res; } - ~ChannelReestablish() { ChannelReestablish_free(self); } - ChannelReestablish& operator=(ChannelReestablish&& o) { ChannelReestablish_free(self); self = o.self; memset(&o, 0, sizeof(ChannelReestablish)); return *this; } - LDKChannelReestablish* operator &() { return &self; } - LDKChannelReestablish* operator ->() { return &self; } - const LDKChannelReestablish* operator &() const { return &self; } - const LDKChannelReestablish* operator ->() const { return &self; } + PaymentSendFailure(const PaymentSendFailure&) = delete; + PaymentSendFailure(PaymentSendFailure&& o) : self(o.self) { memset(&o, 0, sizeof(PaymentSendFailure)); } + PaymentSendFailure(LDKPaymentSendFailure&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPaymentSendFailure)); } + operator LDKPaymentSendFailure() && { LDKPaymentSendFailure res = self; memset(&self, 0, sizeof(LDKPaymentSendFailure)); return res; } + ~PaymentSendFailure() { PaymentSendFailure_free(self); } + PaymentSendFailure& operator=(PaymentSendFailure&& o) { PaymentSendFailure_free(self); self = o.self; memset(&o, 0, sizeof(PaymentSendFailure)); return *this; } + LDKPaymentSendFailure* operator &() { return &self; } + LDKPaymentSendFailure* operator ->() { return &self; } + const LDKPaymentSendFailure* operator &() const { return &self; } + const LDKPaymentSendFailure* operator ->() const { return &self; } }; -class AnnouncementSignatures { +class ChannelManagerReadArgs { private: - LDKAnnouncementSignatures self; + LDKChannelManagerReadArgs self; public: - AnnouncementSignatures(const AnnouncementSignatures&) = delete; - AnnouncementSignatures(AnnouncementSignatures&& o) : self(o.self) { memset(&o, 0, sizeof(AnnouncementSignatures)); } - AnnouncementSignatures(LDKAnnouncementSignatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAnnouncementSignatures)); } - operator LDKAnnouncementSignatures() && { LDKAnnouncementSignatures res = self; memset(&self, 0, sizeof(LDKAnnouncementSignatures)); return res; } - ~AnnouncementSignatures() { AnnouncementSignatures_free(self); } - AnnouncementSignatures& operator=(AnnouncementSignatures&& o) { AnnouncementSignatures_free(self); self = o.self; memset(&o, 0, sizeof(AnnouncementSignatures)); return *this; } - LDKAnnouncementSignatures* operator &() { return &self; } - LDKAnnouncementSignatures* operator ->() { return &self; } - const LDKAnnouncementSignatures* operator &() const { return &self; } - const LDKAnnouncementSignatures* operator ->() const { return &self; } + ChannelManagerReadArgs(const ChannelManagerReadArgs&) = delete; + ChannelManagerReadArgs(ChannelManagerReadArgs&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelManagerReadArgs)); } + ChannelManagerReadArgs(LDKChannelManagerReadArgs&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelManagerReadArgs)); } + operator LDKChannelManagerReadArgs() && { LDKChannelManagerReadArgs res = self; memset(&self, 0, sizeof(LDKChannelManagerReadArgs)); return res; } + ~ChannelManagerReadArgs() { ChannelManagerReadArgs_free(self); } + ChannelManagerReadArgs& operator=(ChannelManagerReadArgs&& o) { ChannelManagerReadArgs_free(self); self = o.self; memset(&o, 0, sizeof(ChannelManagerReadArgs)); return *this; } + LDKChannelManagerReadArgs* operator &() { return &self; } + LDKChannelManagerReadArgs* operator ->() { return &self; } + const LDKChannelManagerReadArgs* operator &() const { return &self; } + const LDKChannelManagerReadArgs* operator ->() const { return &self; } }; -class NetAddress { +class SpendableOutputDescriptor { private: - LDKNetAddress self; + LDKSpendableOutputDescriptor self; public: - NetAddress(const NetAddress&) = delete; - NetAddress(NetAddress&& o) : self(o.self) { memset(&o, 0, sizeof(NetAddress)); } - NetAddress(LDKNetAddress&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNetAddress)); } - operator LDKNetAddress() && { LDKNetAddress res = self; memset(&self, 0, sizeof(LDKNetAddress)); return res; } - ~NetAddress() { NetAddress_free(self); } - NetAddress& operator=(NetAddress&& o) { NetAddress_free(self); self = o.self; memset(&o, 0, sizeof(NetAddress)); return *this; } - LDKNetAddress* operator &() { return &self; } - LDKNetAddress* operator ->() { return &self; } - const LDKNetAddress* operator &() const { return &self; } - const LDKNetAddress* operator ->() const { return &self; } + SpendableOutputDescriptor(const SpendableOutputDescriptor&) = delete; + SpendableOutputDescriptor(SpendableOutputDescriptor&& o) : self(o.self) { memset(&o, 0, sizeof(SpendableOutputDescriptor)); } + SpendableOutputDescriptor(LDKSpendableOutputDescriptor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKSpendableOutputDescriptor)); } + operator LDKSpendableOutputDescriptor() && { LDKSpendableOutputDescriptor res = self; memset(&self, 0, sizeof(LDKSpendableOutputDescriptor)); return res; } + ~SpendableOutputDescriptor() { SpendableOutputDescriptor_free(self); } + SpendableOutputDescriptor& operator=(SpendableOutputDescriptor&& o) { SpendableOutputDescriptor_free(self); self = o.self; memset(&o, 0, sizeof(SpendableOutputDescriptor)); return *this; } + LDKSpendableOutputDescriptor* operator &() { return &self; } + LDKSpendableOutputDescriptor* operator ->() { return &self; } + const LDKSpendableOutputDescriptor* operator &() const { return &self; } + const LDKSpendableOutputDescriptor* operator ->() const { return &self; } }; -class UnsignedNodeAnnouncement { +class ChannelKeys { private: - LDKUnsignedNodeAnnouncement self; + LDKChannelKeys self; public: - UnsignedNodeAnnouncement(const UnsignedNodeAnnouncement&) = delete; - UnsignedNodeAnnouncement(UnsignedNodeAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(UnsignedNodeAnnouncement)); } - UnsignedNodeAnnouncement(LDKUnsignedNodeAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUnsignedNodeAnnouncement)); } - operator LDKUnsignedNodeAnnouncement() && { LDKUnsignedNodeAnnouncement res = self; memset(&self, 0, sizeof(LDKUnsignedNodeAnnouncement)); return res; } - ~UnsignedNodeAnnouncement() { UnsignedNodeAnnouncement_free(self); } - UnsignedNodeAnnouncement& operator=(UnsignedNodeAnnouncement&& o) { UnsignedNodeAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(UnsignedNodeAnnouncement)); return *this; } - LDKUnsignedNodeAnnouncement* operator &() { return &self; } - LDKUnsignedNodeAnnouncement* operator ->() { return &self; } - const LDKUnsignedNodeAnnouncement* operator &() const { return &self; } - const LDKUnsignedNodeAnnouncement* operator ->() const { return &self; } + ChannelKeys(const ChannelKeys&) = delete; + ChannelKeys(ChannelKeys&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelKeys)); } + ChannelKeys(LDKChannelKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelKeys)); } + operator LDKChannelKeys() && { LDKChannelKeys res = self; memset(&self, 0, sizeof(LDKChannelKeys)); return res; } + ~ChannelKeys() { ChannelKeys_free(self); } + ChannelKeys& operator=(ChannelKeys&& o) { ChannelKeys_free(self); self = o.self; memset(&o, 0, sizeof(ChannelKeys)); return *this; } + LDKChannelKeys* operator &() { return &self; } + LDKChannelKeys* operator ->() { return &self; } + const LDKChannelKeys* operator &() const { return &self; } + const LDKChannelKeys* operator ->() const { return &self; } }; -class NodeAnnouncement { +class KeysInterface { private: - LDKNodeAnnouncement self; + LDKKeysInterface self; public: - NodeAnnouncement(const NodeAnnouncement&) = delete; - NodeAnnouncement(NodeAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(NodeAnnouncement)); } - NodeAnnouncement(LDKNodeAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeAnnouncement)); } - operator LDKNodeAnnouncement() && { LDKNodeAnnouncement res = self; memset(&self, 0, sizeof(LDKNodeAnnouncement)); return res; } - ~NodeAnnouncement() { NodeAnnouncement_free(self); } - NodeAnnouncement& operator=(NodeAnnouncement&& o) { NodeAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(NodeAnnouncement)); return *this; } - LDKNodeAnnouncement* operator &() { return &self; } - LDKNodeAnnouncement* operator ->() { return &self; } - const LDKNodeAnnouncement* operator &() const { return &self; } - const LDKNodeAnnouncement* operator ->() const { return &self; } + KeysInterface(const KeysInterface&) = delete; + KeysInterface(KeysInterface&& o) : self(o.self) { memset(&o, 0, sizeof(KeysInterface)); } + KeysInterface(LDKKeysInterface&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKKeysInterface)); } + operator LDKKeysInterface() && { LDKKeysInterface res = self; memset(&self, 0, sizeof(LDKKeysInterface)); return res; } + ~KeysInterface() { KeysInterface_free(self); } + KeysInterface& operator=(KeysInterface&& o) { KeysInterface_free(self); self = o.self; memset(&o, 0, sizeof(KeysInterface)); return *this; } + LDKKeysInterface* operator &() { return &self; } + LDKKeysInterface* operator ->() { return &self; } + const LDKKeysInterface* operator &() const { return &self; } + const LDKKeysInterface* operator ->() const { return &self; } }; -class UnsignedChannelAnnouncement { +class InMemoryChannelKeys { private: - LDKUnsignedChannelAnnouncement self; + LDKInMemoryChannelKeys self; public: - UnsignedChannelAnnouncement(const UnsignedChannelAnnouncement&) = delete; - UnsignedChannelAnnouncement(UnsignedChannelAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(UnsignedChannelAnnouncement)); } - UnsignedChannelAnnouncement(LDKUnsignedChannelAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUnsignedChannelAnnouncement)); } - operator LDKUnsignedChannelAnnouncement() && { LDKUnsignedChannelAnnouncement res = self; memset(&self, 0, sizeof(LDKUnsignedChannelAnnouncement)); return res; } - ~UnsignedChannelAnnouncement() { UnsignedChannelAnnouncement_free(self); } - UnsignedChannelAnnouncement& operator=(UnsignedChannelAnnouncement&& o) { UnsignedChannelAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(UnsignedChannelAnnouncement)); return *this; } - LDKUnsignedChannelAnnouncement* operator &() { return &self; } - LDKUnsignedChannelAnnouncement* operator ->() { return &self; } - const LDKUnsignedChannelAnnouncement* operator &() const { return &self; } - const LDKUnsignedChannelAnnouncement* operator ->() const { return &self; } + InMemoryChannelKeys(const InMemoryChannelKeys&) = delete; + InMemoryChannelKeys(InMemoryChannelKeys&& o) : self(o.self) { memset(&o, 0, sizeof(InMemoryChannelKeys)); } + InMemoryChannelKeys(LDKInMemoryChannelKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKInMemoryChannelKeys)); } + operator LDKInMemoryChannelKeys() && { LDKInMemoryChannelKeys res = self; memset(&self, 0, sizeof(LDKInMemoryChannelKeys)); return res; } + ~InMemoryChannelKeys() { InMemoryChannelKeys_free(self); } + InMemoryChannelKeys& operator=(InMemoryChannelKeys&& o) { InMemoryChannelKeys_free(self); self = o.self; memset(&o, 0, sizeof(InMemoryChannelKeys)); return *this; } + LDKInMemoryChannelKeys* operator &() { return &self; } + LDKInMemoryChannelKeys* operator ->() { return &self; } + const LDKInMemoryChannelKeys* operator &() const { return &self; } + const LDKInMemoryChannelKeys* operator ->() const { return &self; } }; -class ChannelAnnouncement { +class KeysManager { private: - LDKChannelAnnouncement self; + LDKKeysManager self; public: - ChannelAnnouncement(const ChannelAnnouncement&) = delete; - ChannelAnnouncement(ChannelAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelAnnouncement)); } - ChannelAnnouncement(LDKChannelAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelAnnouncement)); } - operator LDKChannelAnnouncement() && { LDKChannelAnnouncement res = self; memset(&self, 0, sizeof(LDKChannelAnnouncement)); return res; } - ~ChannelAnnouncement() { ChannelAnnouncement_free(self); } - ChannelAnnouncement& operator=(ChannelAnnouncement&& o) { ChannelAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(ChannelAnnouncement)); return *this; } - LDKChannelAnnouncement* operator &() { return &self; } - LDKChannelAnnouncement* operator ->() { return &self; } - const LDKChannelAnnouncement* operator &() const { return &self; } - const LDKChannelAnnouncement* operator ->() const { return &self; } + KeysManager(const KeysManager&) = delete; + KeysManager(KeysManager&& o) : self(o.self) { memset(&o, 0, sizeof(KeysManager)); } + KeysManager(LDKKeysManager&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKKeysManager)); } + operator LDKKeysManager() && { LDKKeysManager res = self; memset(&self, 0, sizeof(LDKKeysManager)); return res; } + ~KeysManager() { KeysManager_free(self); } + KeysManager& operator=(KeysManager&& o) { KeysManager_free(self); self = o.self; memset(&o, 0, sizeof(KeysManager)); return *this; } + LDKKeysManager* operator &() { return &self; } + LDKKeysManager* operator ->() { return &self; } + const LDKKeysManager* operator &() const { return &self; } + const LDKKeysManager* operator ->() const { return &self; } }; -class UnsignedChannelUpdate { +class RouteHop { private: - LDKUnsignedChannelUpdate self; + LDKRouteHop self; public: - UnsignedChannelUpdate(const UnsignedChannelUpdate&) = delete; - UnsignedChannelUpdate(UnsignedChannelUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(UnsignedChannelUpdate)); } - UnsignedChannelUpdate(LDKUnsignedChannelUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUnsignedChannelUpdate)); } - operator LDKUnsignedChannelUpdate() && { LDKUnsignedChannelUpdate res = self; memset(&self, 0, sizeof(LDKUnsignedChannelUpdate)); return res; } - ~UnsignedChannelUpdate() { UnsignedChannelUpdate_free(self); } - UnsignedChannelUpdate& operator=(UnsignedChannelUpdate&& o) { UnsignedChannelUpdate_free(self); self = o.self; memset(&o, 0, sizeof(UnsignedChannelUpdate)); return *this; } - LDKUnsignedChannelUpdate* operator &() { return &self; } - LDKUnsignedChannelUpdate* operator ->() { return &self; } - const LDKUnsignedChannelUpdate* operator &() const { return &self; } - const LDKUnsignedChannelUpdate* operator ->() const { return &self; } + RouteHop(const RouteHop&) = delete; + RouteHop(RouteHop&& o) : self(o.self) { memset(&o, 0, sizeof(RouteHop)); } + RouteHop(LDKRouteHop&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRouteHop)); } + operator LDKRouteHop() && { LDKRouteHop res = self; memset(&self, 0, sizeof(LDKRouteHop)); return res; } + ~RouteHop() { RouteHop_free(self); } + RouteHop& operator=(RouteHop&& o) { RouteHop_free(self); self = o.self; memset(&o, 0, sizeof(RouteHop)); return *this; } + LDKRouteHop* operator &() { return &self; } + LDKRouteHop* operator ->() { return &self; } + const LDKRouteHop* operator &() const { return &self; } + const LDKRouteHop* operator ->() const { return &self; } }; -class ChannelUpdate { +class Route { private: - LDKChannelUpdate self; + LDKRoute self; public: - ChannelUpdate(const ChannelUpdate&) = delete; - ChannelUpdate(ChannelUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelUpdate)); } - ChannelUpdate(LDKChannelUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelUpdate)); } - operator LDKChannelUpdate() && { LDKChannelUpdate res = self; memset(&self, 0, sizeof(LDKChannelUpdate)); return res; } - ~ChannelUpdate() { ChannelUpdate_free(self); } - ChannelUpdate& operator=(ChannelUpdate&& o) { ChannelUpdate_free(self); self = o.self; memset(&o, 0, sizeof(ChannelUpdate)); return *this; } - LDKChannelUpdate* operator &() { return &self; } - LDKChannelUpdate* operator ->() { return &self; } - const LDKChannelUpdate* operator &() const { return &self; } - const LDKChannelUpdate* operator ->() const { return &self; } + Route(const Route&) = delete; + Route(Route&& o) : self(o.self) { memset(&o, 0, sizeof(Route)); } + Route(LDKRoute&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRoute)); } + operator LDKRoute() && { LDKRoute res = self; memset(&self, 0, sizeof(LDKRoute)); return res; } + ~Route() { Route_free(self); } + Route& operator=(Route&& o) { Route_free(self); self = o.self; memset(&o, 0, sizeof(Route)); return *this; } + LDKRoute* operator &() { return &self; } + LDKRoute* operator ->() { return &self; } + const LDKRoute* operator &() const { return &self; } + const LDKRoute* operator ->() const { return &self; } }; -class QueryChannelRange { +class RouteHint { private: - LDKQueryChannelRange self; + LDKRouteHint self; public: - QueryChannelRange(const QueryChannelRange&) = delete; - QueryChannelRange(QueryChannelRange&& o) : self(o.self) { memset(&o, 0, sizeof(QueryChannelRange)); } - QueryChannelRange(LDKQueryChannelRange&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKQueryChannelRange)); } - operator LDKQueryChannelRange() && { LDKQueryChannelRange res = self; memset(&self, 0, sizeof(LDKQueryChannelRange)); return res; } - ~QueryChannelRange() { QueryChannelRange_free(self); } - QueryChannelRange& operator=(QueryChannelRange&& o) { QueryChannelRange_free(self); self = o.self; memset(&o, 0, sizeof(QueryChannelRange)); return *this; } - LDKQueryChannelRange* operator &() { return &self; } - LDKQueryChannelRange* operator ->() { return &self; } - const LDKQueryChannelRange* operator &() const { return &self; } - const LDKQueryChannelRange* operator ->() const { return &self; } + RouteHint(const RouteHint&) = delete; + RouteHint(RouteHint&& o) : self(o.self) { memset(&o, 0, sizeof(RouteHint)); } + RouteHint(LDKRouteHint&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRouteHint)); } + operator LDKRouteHint() && { LDKRouteHint res = self; memset(&self, 0, sizeof(LDKRouteHint)); return res; } + ~RouteHint() { RouteHint_free(self); } + RouteHint& operator=(RouteHint&& o) { RouteHint_free(self); self = o.self; memset(&o, 0, sizeof(RouteHint)); return *this; } + LDKRouteHint* operator &() { return &self; } + LDKRouteHint* operator ->() { return &self; } + const LDKRouteHint* operator &() const { return &self; } + const LDKRouteHint* operator ->() const { return &self; } }; -class ReplyChannelRange { +class DecodeError { private: - LDKReplyChannelRange self; + LDKDecodeError self; public: - ReplyChannelRange(const ReplyChannelRange&) = delete; - ReplyChannelRange(ReplyChannelRange&& o) : self(o.self) { memset(&o, 0, sizeof(ReplyChannelRange)); } - ReplyChannelRange(LDKReplyChannelRange&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKReplyChannelRange)); } - operator LDKReplyChannelRange() && { LDKReplyChannelRange res = self; memset(&self, 0, sizeof(LDKReplyChannelRange)); return res; } - ~ReplyChannelRange() { ReplyChannelRange_free(self); } - ReplyChannelRange& operator=(ReplyChannelRange&& o) { ReplyChannelRange_free(self); self = o.self; memset(&o, 0, sizeof(ReplyChannelRange)); return *this; } - LDKReplyChannelRange* operator &() { return &self; } - LDKReplyChannelRange* operator ->() { return &self; } - const LDKReplyChannelRange* operator &() const { return &self; } - const LDKReplyChannelRange* operator ->() const { return &self; } + DecodeError(const DecodeError&) = delete; + DecodeError(DecodeError&& o) : self(o.self) { memset(&o, 0, sizeof(DecodeError)); } + DecodeError(LDKDecodeError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDecodeError)); } + operator LDKDecodeError() && { LDKDecodeError res = self; memset(&self, 0, sizeof(LDKDecodeError)); return res; } + ~DecodeError() { DecodeError_free(self); } + DecodeError& operator=(DecodeError&& o) { DecodeError_free(self); self = o.self; memset(&o, 0, sizeof(DecodeError)); return *this; } + LDKDecodeError* operator &() { return &self; } + LDKDecodeError* operator ->() { return &self; } + const LDKDecodeError* operator &() const { return &self; } + const LDKDecodeError* operator ->() const { return &self; } +}; +class Init { +private: + LDKInit self; +public: + Init(const Init&) = delete; + Init(Init&& o) : self(o.self) { memset(&o, 0, sizeof(Init)); } + Init(LDKInit&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKInit)); } + operator LDKInit() && { LDKInit res = self; memset(&self, 0, sizeof(LDKInit)); return res; } + ~Init() { Init_free(self); } + Init& operator=(Init&& o) { Init_free(self); self = o.self; memset(&o, 0, sizeof(Init)); return *this; } + LDKInit* operator &() { return &self; } + LDKInit* operator ->() { return &self; } + const LDKInit* operator &() const { return &self; } + const LDKInit* operator ->() const { return &self; } }; -class QueryShortChannelIds { +class ErrorMessage { private: - LDKQueryShortChannelIds self; + LDKErrorMessage self; public: - QueryShortChannelIds(const QueryShortChannelIds&) = delete; - QueryShortChannelIds(QueryShortChannelIds&& o) : self(o.self) { memset(&o, 0, sizeof(QueryShortChannelIds)); } - QueryShortChannelIds(LDKQueryShortChannelIds&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKQueryShortChannelIds)); } - operator LDKQueryShortChannelIds() && { LDKQueryShortChannelIds res = self; memset(&self, 0, sizeof(LDKQueryShortChannelIds)); return res; } - ~QueryShortChannelIds() { QueryShortChannelIds_free(self); } - QueryShortChannelIds& operator=(QueryShortChannelIds&& o) { QueryShortChannelIds_free(self); self = o.self; memset(&o, 0, sizeof(QueryShortChannelIds)); return *this; } - LDKQueryShortChannelIds* operator &() { return &self; } - LDKQueryShortChannelIds* operator ->() { return &self; } - const LDKQueryShortChannelIds* operator &() const { return &self; } - const LDKQueryShortChannelIds* operator ->() const { return &self; } + ErrorMessage(const ErrorMessage&) = delete; + ErrorMessage(ErrorMessage&& o) : self(o.self) { memset(&o, 0, sizeof(ErrorMessage)); } + ErrorMessage(LDKErrorMessage&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKErrorMessage)); } + operator LDKErrorMessage() && { LDKErrorMessage res = self; memset(&self, 0, sizeof(LDKErrorMessage)); return res; } + ~ErrorMessage() { ErrorMessage_free(self); } + ErrorMessage& operator=(ErrorMessage&& o) { ErrorMessage_free(self); self = o.self; memset(&o, 0, sizeof(ErrorMessage)); return *this; } + LDKErrorMessage* operator &() { return &self; } + LDKErrorMessage* operator ->() { return &self; } + const LDKErrorMessage* operator &() const { return &self; } + const LDKErrorMessage* operator ->() const { return &self; } }; -class ReplyShortChannelIdsEnd { +class Ping { private: - LDKReplyShortChannelIdsEnd self; + LDKPing self; public: - ReplyShortChannelIdsEnd(const ReplyShortChannelIdsEnd&) = delete; - ReplyShortChannelIdsEnd(ReplyShortChannelIdsEnd&& o) : self(o.self) { memset(&o, 0, sizeof(ReplyShortChannelIdsEnd)); } - ReplyShortChannelIdsEnd(LDKReplyShortChannelIdsEnd&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKReplyShortChannelIdsEnd)); } - operator LDKReplyShortChannelIdsEnd() && { LDKReplyShortChannelIdsEnd res = self; memset(&self, 0, sizeof(LDKReplyShortChannelIdsEnd)); return res; } - ~ReplyShortChannelIdsEnd() { ReplyShortChannelIdsEnd_free(self); } - ReplyShortChannelIdsEnd& operator=(ReplyShortChannelIdsEnd&& o) { ReplyShortChannelIdsEnd_free(self); self = o.self; memset(&o, 0, sizeof(ReplyShortChannelIdsEnd)); return *this; } - LDKReplyShortChannelIdsEnd* operator &() { return &self; } - LDKReplyShortChannelIdsEnd* operator ->() { return &self; } - const LDKReplyShortChannelIdsEnd* operator &() const { return &self; } - const LDKReplyShortChannelIdsEnd* operator ->() const { return &self; } + Ping(const Ping&) = delete; + Ping(Ping&& o) : self(o.self) { memset(&o, 0, sizeof(Ping)); } + Ping(LDKPing&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPing)); } + operator LDKPing() && { LDKPing res = self; memset(&self, 0, sizeof(LDKPing)); return res; } + ~Ping() { Ping_free(self); } + Ping& operator=(Ping&& o) { Ping_free(self); self = o.self; memset(&o, 0, sizeof(Ping)); return *this; } + LDKPing* operator &() { return &self; } + LDKPing* operator ->() { return &self; } + const LDKPing* operator &() const { return &self; } + const LDKPing* operator ->() const { return &self; } }; -class GossipTimestampFilter { +class Pong { private: - LDKGossipTimestampFilter self; + LDKPong self; public: - GossipTimestampFilter(const GossipTimestampFilter&) = delete; - GossipTimestampFilter(GossipTimestampFilter&& o) : self(o.self) { memset(&o, 0, sizeof(GossipTimestampFilter)); } - GossipTimestampFilter(LDKGossipTimestampFilter&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKGossipTimestampFilter)); } - operator LDKGossipTimestampFilter() && { LDKGossipTimestampFilter res = self; memset(&self, 0, sizeof(LDKGossipTimestampFilter)); return res; } - ~GossipTimestampFilter() { GossipTimestampFilter_free(self); } - GossipTimestampFilter& operator=(GossipTimestampFilter&& o) { GossipTimestampFilter_free(self); self = o.self; memset(&o, 0, sizeof(GossipTimestampFilter)); return *this; } - LDKGossipTimestampFilter* operator &() { return &self; } - LDKGossipTimestampFilter* operator ->() { return &self; } - const LDKGossipTimestampFilter* operator &() const { return &self; } - const LDKGossipTimestampFilter* operator ->() const { return &self; } + Pong(const Pong&) = delete; + Pong(Pong&& o) : self(o.self) { memset(&o, 0, sizeof(Pong)); } + Pong(LDKPong&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPong)); } + operator LDKPong() && { LDKPong res = self; memset(&self, 0, sizeof(LDKPong)); return res; } + ~Pong() { Pong_free(self); } + Pong& operator=(Pong&& o) { Pong_free(self); self = o.self; memset(&o, 0, sizeof(Pong)); return *this; } + LDKPong* operator &() { return &self; } + LDKPong* operator ->() { return &self; } + const LDKPong* operator &() const { return &self; } + const LDKPong* operator ->() const { return &self; } }; -class ErrorAction { +class OpenChannel { private: - LDKErrorAction self; + LDKOpenChannel self; public: - ErrorAction(const ErrorAction&) = delete; - ErrorAction(ErrorAction&& o) : self(o.self) { memset(&o, 0, sizeof(ErrorAction)); } - ErrorAction(LDKErrorAction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKErrorAction)); } - operator LDKErrorAction() && { LDKErrorAction res = self; memset(&self, 0, sizeof(LDKErrorAction)); return res; } - ~ErrorAction() { ErrorAction_free(self); } - ErrorAction& operator=(ErrorAction&& o) { ErrorAction_free(self); self = o.self; memset(&o, 0, sizeof(ErrorAction)); return *this; } - LDKErrorAction* operator &() { return &self; } - LDKErrorAction* operator ->() { return &self; } - const LDKErrorAction* operator &() const { return &self; } - const LDKErrorAction* operator ->() const { return &self; } + OpenChannel(const OpenChannel&) = delete; + OpenChannel(OpenChannel&& o) : self(o.self) { memset(&o, 0, sizeof(OpenChannel)); } + OpenChannel(LDKOpenChannel&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKOpenChannel)); } + operator LDKOpenChannel() && { LDKOpenChannel res = self; memset(&self, 0, sizeof(LDKOpenChannel)); return res; } + ~OpenChannel() { OpenChannel_free(self); } + OpenChannel& operator=(OpenChannel&& o) { OpenChannel_free(self); self = o.self; memset(&o, 0, sizeof(OpenChannel)); return *this; } + LDKOpenChannel* operator &() { return &self; } + LDKOpenChannel* operator ->() { return &self; } + const LDKOpenChannel* operator &() const { return &self; } + const LDKOpenChannel* operator ->() const { return &self; } }; -class LightningError { +class AcceptChannel { private: - LDKLightningError self; + LDKAcceptChannel self; public: - LightningError(const LightningError&) = delete; - LightningError(LightningError&& o) : self(o.self) { memset(&o, 0, sizeof(LightningError)); } - LightningError(LDKLightningError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLightningError)); } - operator LDKLightningError() && { LDKLightningError res = self; memset(&self, 0, sizeof(LDKLightningError)); return res; } - ~LightningError() { LightningError_free(self); } - LightningError& operator=(LightningError&& o) { LightningError_free(self); self = o.self; memset(&o, 0, sizeof(LightningError)); return *this; } - LDKLightningError* operator &() { return &self; } - LDKLightningError* operator ->() { return &self; } - const LDKLightningError* operator &() const { return &self; } - const LDKLightningError* operator ->() const { return &self; } + AcceptChannel(const AcceptChannel&) = delete; + AcceptChannel(AcceptChannel&& o) : self(o.self) { memset(&o, 0, sizeof(AcceptChannel)); } + AcceptChannel(LDKAcceptChannel&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAcceptChannel)); } + operator LDKAcceptChannel() && { LDKAcceptChannel res = self; memset(&self, 0, sizeof(LDKAcceptChannel)); return res; } + ~AcceptChannel() { AcceptChannel_free(self); } + AcceptChannel& operator=(AcceptChannel&& o) { AcceptChannel_free(self); self = o.self; memset(&o, 0, sizeof(AcceptChannel)); return *this; } + LDKAcceptChannel* operator &() { return &self; } + LDKAcceptChannel* operator ->() { return &self; } + const LDKAcceptChannel* operator &() const { return &self; } + const LDKAcceptChannel* operator ->() const { return &self; } }; -class CommitmentUpdate { +class FundingCreated { private: - LDKCommitmentUpdate self; + LDKFundingCreated self; public: - CommitmentUpdate(const CommitmentUpdate&) = delete; - CommitmentUpdate(CommitmentUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(CommitmentUpdate)); } - CommitmentUpdate(LDKCommitmentUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCommitmentUpdate)); } - operator LDKCommitmentUpdate() && { LDKCommitmentUpdate res = self; memset(&self, 0, sizeof(LDKCommitmentUpdate)); return res; } - ~CommitmentUpdate() { CommitmentUpdate_free(self); } - CommitmentUpdate& operator=(CommitmentUpdate&& o) { CommitmentUpdate_free(self); self = o.self; memset(&o, 0, sizeof(CommitmentUpdate)); return *this; } - LDKCommitmentUpdate* operator &() { return &self; } - LDKCommitmentUpdate* operator ->() { return &self; } - const LDKCommitmentUpdate* operator &() const { return &self; } - const LDKCommitmentUpdate* operator ->() const { return &self; } + FundingCreated(const FundingCreated&) = delete; + FundingCreated(FundingCreated&& o) : self(o.self) { memset(&o, 0, sizeof(FundingCreated)); } + FundingCreated(LDKFundingCreated&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFundingCreated)); } + operator LDKFundingCreated() && { LDKFundingCreated res = self; memset(&self, 0, sizeof(LDKFundingCreated)); return res; } + ~FundingCreated() { FundingCreated_free(self); } + FundingCreated& operator=(FundingCreated&& o) { FundingCreated_free(self); self = o.self; memset(&o, 0, sizeof(FundingCreated)); return *this; } + LDKFundingCreated* operator &() { return &self; } + LDKFundingCreated* operator ->() { return &self; } + const LDKFundingCreated* operator &() const { return &self; } + const LDKFundingCreated* operator ->() const { return &self; } }; -class HTLCFailChannelUpdate { +class FundingSigned { private: - LDKHTLCFailChannelUpdate self; + LDKFundingSigned self; public: - HTLCFailChannelUpdate(const HTLCFailChannelUpdate&) = delete; - HTLCFailChannelUpdate(HTLCFailChannelUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(HTLCFailChannelUpdate)); } - HTLCFailChannelUpdate(LDKHTLCFailChannelUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHTLCFailChannelUpdate)); } - operator LDKHTLCFailChannelUpdate() && { LDKHTLCFailChannelUpdate res = self; memset(&self, 0, sizeof(LDKHTLCFailChannelUpdate)); return res; } - ~HTLCFailChannelUpdate() { HTLCFailChannelUpdate_free(self); } - HTLCFailChannelUpdate& operator=(HTLCFailChannelUpdate&& o) { HTLCFailChannelUpdate_free(self); self = o.self; memset(&o, 0, sizeof(HTLCFailChannelUpdate)); return *this; } - LDKHTLCFailChannelUpdate* operator &() { return &self; } - LDKHTLCFailChannelUpdate* operator ->() { return &self; } - const LDKHTLCFailChannelUpdate* operator &() const { return &self; } - const LDKHTLCFailChannelUpdate* operator ->() const { return &self; } + FundingSigned(const FundingSigned&) = delete; + FundingSigned(FundingSigned&& o) : self(o.self) { memset(&o, 0, sizeof(FundingSigned)); } + FundingSigned(LDKFundingSigned&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFundingSigned)); } + operator LDKFundingSigned() && { LDKFundingSigned res = self; memset(&self, 0, sizeof(LDKFundingSigned)); return res; } + ~FundingSigned() { FundingSigned_free(self); } + FundingSigned& operator=(FundingSigned&& o) { FundingSigned_free(self); self = o.self; memset(&o, 0, sizeof(FundingSigned)); return *this; } + LDKFundingSigned* operator &() { return &self; } + LDKFundingSigned* operator ->() { return &self; } + const LDKFundingSigned* operator &() const { return &self; } + const LDKFundingSigned* operator ->() const { return &self; } }; -class ChannelMessageHandler { +class FundingLocked { private: - LDKChannelMessageHandler self; + LDKFundingLocked self; public: - ChannelMessageHandler(const ChannelMessageHandler&) = delete; - ChannelMessageHandler(ChannelMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMessageHandler)); } - ChannelMessageHandler(LDKChannelMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMessageHandler)); } - operator LDKChannelMessageHandler() && { LDKChannelMessageHandler res = self; memset(&self, 0, sizeof(LDKChannelMessageHandler)); return res; } - ~ChannelMessageHandler() { ChannelMessageHandler_free(self); } - ChannelMessageHandler& operator=(ChannelMessageHandler&& o) { ChannelMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMessageHandler)); return *this; } - LDKChannelMessageHandler* operator &() { return &self; } - LDKChannelMessageHandler* operator ->() { return &self; } - const LDKChannelMessageHandler* operator &() const { return &self; } - const LDKChannelMessageHandler* operator ->() const { return &self; } + FundingLocked(const FundingLocked&) = delete; + FundingLocked(FundingLocked&& o) : self(o.self) { memset(&o, 0, sizeof(FundingLocked)); } + FundingLocked(LDKFundingLocked&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFundingLocked)); } + operator LDKFundingLocked() && { LDKFundingLocked res = self; memset(&self, 0, sizeof(LDKFundingLocked)); return res; } + ~FundingLocked() { FundingLocked_free(self); } + FundingLocked& operator=(FundingLocked&& o) { FundingLocked_free(self); self = o.self; memset(&o, 0, sizeof(FundingLocked)); return *this; } + LDKFundingLocked* operator &() { return &self; } + LDKFundingLocked* operator ->() { return &self; } + const LDKFundingLocked* operator &() const { return &self; } + const LDKFundingLocked* operator ->() const { return &self; } }; -class RoutingMessageHandler { +class Shutdown { private: - LDKRoutingMessageHandler self; + LDKShutdown self; public: - RoutingMessageHandler(const RoutingMessageHandler&) = delete; - RoutingMessageHandler(RoutingMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(RoutingMessageHandler)); } - RoutingMessageHandler(LDKRoutingMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRoutingMessageHandler)); } - operator LDKRoutingMessageHandler() && { LDKRoutingMessageHandler res = self; memset(&self, 0, sizeof(LDKRoutingMessageHandler)); return res; } - ~RoutingMessageHandler() { RoutingMessageHandler_free(self); } - RoutingMessageHandler& operator=(RoutingMessageHandler&& o) { RoutingMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(RoutingMessageHandler)); return *this; } - LDKRoutingMessageHandler* operator &() { return &self; } - LDKRoutingMessageHandler* operator ->() { return &self; } - const LDKRoutingMessageHandler* operator &() const { return &self; } - const LDKRoutingMessageHandler* operator ->() const { return &self; } + Shutdown(const Shutdown&) = delete; + Shutdown(Shutdown&& o) : self(o.self) { memset(&o, 0, sizeof(Shutdown)); } + Shutdown(LDKShutdown&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKShutdown)); } + operator LDKShutdown() && { LDKShutdown res = self; memset(&self, 0, sizeof(LDKShutdown)); return res; } + ~Shutdown() { Shutdown_free(self); } + Shutdown& operator=(Shutdown&& o) { Shutdown_free(self); self = o.self; memset(&o, 0, sizeof(Shutdown)); return *this; } + LDKShutdown* operator &() { return &self; } + LDKShutdown* operator ->() { return &self; } + const LDKShutdown* operator &() const { return &self; } + const LDKShutdown* operator ->() const { return &self; } }; -class MessageHandler { +class ClosingSigned { private: - LDKMessageHandler self; + LDKClosingSigned self; public: - MessageHandler(const MessageHandler&) = delete; - MessageHandler(MessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(MessageHandler)); } - MessageHandler(LDKMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMessageHandler)); } - operator LDKMessageHandler() && { LDKMessageHandler res = self; memset(&self, 0, sizeof(LDKMessageHandler)); return res; } - ~MessageHandler() { MessageHandler_free(self); } - MessageHandler& operator=(MessageHandler&& o) { MessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(MessageHandler)); return *this; } - LDKMessageHandler* operator &() { return &self; } - LDKMessageHandler* operator ->() { return &self; } - const LDKMessageHandler* operator &() const { return &self; } - const LDKMessageHandler* operator ->() const { return &self; } + ClosingSigned(const ClosingSigned&) = delete; + ClosingSigned(ClosingSigned&& o) : self(o.self) { memset(&o, 0, sizeof(ClosingSigned)); } + ClosingSigned(LDKClosingSigned&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKClosingSigned)); } + operator LDKClosingSigned() && { LDKClosingSigned res = self; memset(&self, 0, sizeof(LDKClosingSigned)); return res; } + ~ClosingSigned() { ClosingSigned_free(self); } + ClosingSigned& operator=(ClosingSigned&& o) { ClosingSigned_free(self); self = o.self; memset(&o, 0, sizeof(ClosingSigned)); return *this; } + LDKClosingSigned* operator &() { return &self; } + LDKClosingSigned* operator ->() { return &self; } + const LDKClosingSigned* operator &() const { return &self; } + const LDKClosingSigned* operator ->() const { return &self; } +}; +class UpdateAddHTLC { +private: + LDKUpdateAddHTLC self; +public: + UpdateAddHTLC(const UpdateAddHTLC&) = delete; + UpdateAddHTLC(UpdateAddHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateAddHTLC)); } + UpdateAddHTLC(LDKUpdateAddHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateAddHTLC)); } + operator LDKUpdateAddHTLC() && { LDKUpdateAddHTLC res = self; memset(&self, 0, sizeof(LDKUpdateAddHTLC)); return res; } + ~UpdateAddHTLC() { UpdateAddHTLC_free(self); } + UpdateAddHTLC& operator=(UpdateAddHTLC&& o) { UpdateAddHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateAddHTLC)); return *this; } + LDKUpdateAddHTLC* operator &() { return &self; } + LDKUpdateAddHTLC* operator ->() { return &self; } + const LDKUpdateAddHTLC* operator &() const { return &self; } + const LDKUpdateAddHTLC* operator ->() const { return &self; } }; -class SocketDescriptor { +class UpdateFulfillHTLC { private: - LDKSocketDescriptor self; + LDKUpdateFulfillHTLC self; public: - SocketDescriptor(const SocketDescriptor&) = delete; - SocketDescriptor(SocketDescriptor&& o) : self(o.self) { memset(&o, 0, sizeof(SocketDescriptor)); } - SocketDescriptor(LDKSocketDescriptor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKSocketDescriptor)); } - operator LDKSocketDescriptor() && { LDKSocketDescriptor res = self; memset(&self, 0, sizeof(LDKSocketDescriptor)); return res; } - ~SocketDescriptor() { SocketDescriptor_free(self); } - SocketDescriptor& operator=(SocketDescriptor&& o) { SocketDescriptor_free(self); self = o.self; memset(&o, 0, sizeof(SocketDescriptor)); return *this; } - LDKSocketDescriptor* operator &() { return &self; } - LDKSocketDescriptor* operator ->() { return &self; } - const LDKSocketDescriptor* operator &() const { return &self; } - const LDKSocketDescriptor* operator ->() const { return &self; } + UpdateFulfillHTLC(const UpdateFulfillHTLC&) = delete; + UpdateFulfillHTLC(UpdateFulfillHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFulfillHTLC)); } + UpdateFulfillHTLC(LDKUpdateFulfillHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFulfillHTLC)); } + operator LDKUpdateFulfillHTLC() && { LDKUpdateFulfillHTLC res = self; memset(&self, 0, sizeof(LDKUpdateFulfillHTLC)); return res; } + ~UpdateFulfillHTLC() { UpdateFulfillHTLC_free(self); } + UpdateFulfillHTLC& operator=(UpdateFulfillHTLC&& o) { UpdateFulfillHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFulfillHTLC)); return *this; } + LDKUpdateFulfillHTLC* operator &() { return &self; } + LDKUpdateFulfillHTLC* operator ->() { return &self; } + const LDKUpdateFulfillHTLC* operator &() const { return &self; } + const LDKUpdateFulfillHTLC* operator ->() const { return &self; } }; -class PeerHandleError { +class UpdateFailHTLC { private: - LDKPeerHandleError self; + LDKUpdateFailHTLC self; public: - PeerHandleError(const PeerHandleError&) = delete; - PeerHandleError(PeerHandleError&& o) : self(o.self) { memset(&o, 0, sizeof(PeerHandleError)); } - PeerHandleError(LDKPeerHandleError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPeerHandleError)); } - operator LDKPeerHandleError() && { LDKPeerHandleError res = self; memset(&self, 0, sizeof(LDKPeerHandleError)); return res; } - ~PeerHandleError() { PeerHandleError_free(self); } - PeerHandleError& operator=(PeerHandleError&& o) { PeerHandleError_free(self); self = o.self; memset(&o, 0, sizeof(PeerHandleError)); return *this; } - LDKPeerHandleError* operator &() { return &self; } - LDKPeerHandleError* operator ->() { return &self; } - const LDKPeerHandleError* operator &() const { return &self; } - const LDKPeerHandleError* operator ->() const { return &self; } + UpdateFailHTLC(const UpdateFailHTLC&) = delete; + UpdateFailHTLC(UpdateFailHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFailHTLC)); } + UpdateFailHTLC(LDKUpdateFailHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFailHTLC)); } + operator LDKUpdateFailHTLC() && { LDKUpdateFailHTLC res = self; memset(&self, 0, sizeof(LDKUpdateFailHTLC)); return res; } + ~UpdateFailHTLC() { UpdateFailHTLC_free(self); } + UpdateFailHTLC& operator=(UpdateFailHTLC&& o) { UpdateFailHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFailHTLC)); return *this; } + LDKUpdateFailHTLC* operator &() { return &self; } + LDKUpdateFailHTLC* operator ->() { return &self; } + const LDKUpdateFailHTLC* operator &() const { return &self; } + const LDKUpdateFailHTLC* operator ->() const { return &self; } }; -class PeerManager { +class UpdateFailMalformedHTLC { private: - LDKPeerManager self; + LDKUpdateFailMalformedHTLC self; public: - PeerManager(const PeerManager&) = delete; - PeerManager(PeerManager&& o) : self(o.self) { memset(&o, 0, sizeof(PeerManager)); } - PeerManager(LDKPeerManager&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPeerManager)); } - operator LDKPeerManager() && { LDKPeerManager res = self; memset(&self, 0, sizeof(LDKPeerManager)); return res; } - ~PeerManager() { PeerManager_free(self); } - PeerManager& operator=(PeerManager&& o) { PeerManager_free(self); self = o.self; memset(&o, 0, sizeof(PeerManager)); return *this; } - LDKPeerManager* operator &() { return &self; } - LDKPeerManager* operator ->() { return &self; } - const LDKPeerManager* operator &() const { return &self; } - const LDKPeerManager* operator ->() const { return &self; } + UpdateFailMalformedHTLC(const UpdateFailMalformedHTLC&) = delete; + UpdateFailMalformedHTLC(UpdateFailMalformedHTLC&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFailMalformedHTLC)); } + UpdateFailMalformedHTLC(LDKUpdateFailMalformedHTLC&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFailMalformedHTLC)); } + operator LDKUpdateFailMalformedHTLC() && { LDKUpdateFailMalformedHTLC res = self; memset(&self, 0, sizeof(LDKUpdateFailMalformedHTLC)); return res; } + ~UpdateFailMalformedHTLC() { UpdateFailMalformedHTLC_free(self); } + UpdateFailMalformedHTLC& operator=(UpdateFailMalformedHTLC&& o) { UpdateFailMalformedHTLC_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFailMalformedHTLC)); return *this; } + LDKUpdateFailMalformedHTLC* operator &() { return &self; } + LDKUpdateFailMalformedHTLC* operator ->() { return &self; } + const LDKUpdateFailMalformedHTLC* operator &() const { return &self; } + const LDKUpdateFailMalformedHTLC* operator ->() const { return &self; } }; -class TxCreationKeys { +class CommitmentSigned { private: - LDKTxCreationKeys self; + LDKCommitmentSigned self; public: - TxCreationKeys(const TxCreationKeys&) = delete; - TxCreationKeys(TxCreationKeys&& o) : self(o.self) { memset(&o, 0, sizeof(TxCreationKeys)); } - TxCreationKeys(LDKTxCreationKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKTxCreationKeys)); } - operator LDKTxCreationKeys() && { LDKTxCreationKeys res = self; memset(&self, 0, sizeof(LDKTxCreationKeys)); return res; } - ~TxCreationKeys() { TxCreationKeys_free(self); } - TxCreationKeys& operator=(TxCreationKeys&& o) { TxCreationKeys_free(self); self = o.self; memset(&o, 0, sizeof(TxCreationKeys)); return *this; } - LDKTxCreationKeys* operator &() { return &self; } - LDKTxCreationKeys* operator ->() { return &self; } - const LDKTxCreationKeys* operator &() const { return &self; } - const LDKTxCreationKeys* operator ->() const { return &self; } + CommitmentSigned(const CommitmentSigned&) = delete; + CommitmentSigned(CommitmentSigned&& o) : self(o.self) { memset(&o, 0, sizeof(CommitmentSigned)); } + CommitmentSigned(LDKCommitmentSigned&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCommitmentSigned)); } + operator LDKCommitmentSigned() && { LDKCommitmentSigned res = self; memset(&self, 0, sizeof(LDKCommitmentSigned)); return res; } + ~CommitmentSigned() { CommitmentSigned_free(self); } + CommitmentSigned& operator=(CommitmentSigned&& o) { CommitmentSigned_free(self); self = o.self; memset(&o, 0, sizeof(CommitmentSigned)); return *this; } + LDKCommitmentSigned* operator &() { return &self; } + LDKCommitmentSigned* operator ->() { return &self; } + const LDKCommitmentSigned* operator &() const { return &self; } + const LDKCommitmentSigned* operator ->() const { return &self; } }; -class ChannelPublicKeys { +class RevokeAndACK { private: - LDKChannelPublicKeys self; + LDKRevokeAndACK self; public: - ChannelPublicKeys(const ChannelPublicKeys&) = delete; - ChannelPublicKeys(ChannelPublicKeys&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelPublicKeys)); } - ChannelPublicKeys(LDKChannelPublicKeys&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelPublicKeys)); } - operator LDKChannelPublicKeys() && { LDKChannelPublicKeys res = self; memset(&self, 0, sizeof(LDKChannelPublicKeys)); return res; } - ~ChannelPublicKeys() { ChannelPublicKeys_free(self); } - ChannelPublicKeys& operator=(ChannelPublicKeys&& o) { ChannelPublicKeys_free(self); self = o.self; memset(&o, 0, sizeof(ChannelPublicKeys)); return *this; } - LDKChannelPublicKeys* operator &() { return &self; } - LDKChannelPublicKeys* operator ->() { return &self; } - const LDKChannelPublicKeys* operator &() const { return &self; } - const LDKChannelPublicKeys* operator ->() const { return &self; } + RevokeAndACK(const RevokeAndACK&) = delete; + RevokeAndACK(RevokeAndACK&& o) : self(o.self) { memset(&o, 0, sizeof(RevokeAndACK)); } + RevokeAndACK(LDKRevokeAndACK&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRevokeAndACK)); } + operator LDKRevokeAndACK() && { LDKRevokeAndACK res = self; memset(&self, 0, sizeof(LDKRevokeAndACK)); return res; } + ~RevokeAndACK() { RevokeAndACK_free(self); } + RevokeAndACK& operator=(RevokeAndACK&& o) { RevokeAndACK_free(self); self = o.self; memset(&o, 0, sizeof(RevokeAndACK)); return *this; } + LDKRevokeAndACK* operator &() { return &self; } + LDKRevokeAndACK* operator ->() { return &self; } + const LDKRevokeAndACK* operator &() const { return &self; } + const LDKRevokeAndACK* operator ->() const { return &self; } }; -class HTLCOutputInCommitment { +class UpdateFee { private: - LDKHTLCOutputInCommitment self; + LDKUpdateFee self; public: - HTLCOutputInCommitment(const HTLCOutputInCommitment&) = delete; - HTLCOutputInCommitment(HTLCOutputInCommitment&& o) : self(o.self) { memset(&o, 0, sizeof(HTLCOutputInCommitment)); } - HTLCOutputInCommitment(LDKHTLCOutputInCommitment&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHTLCOutputInCommitment)); } - operator LDKHTLCOutputInCommitment() && { LDKHTLCOutputInCommitment res = self; memset(&self, 0, sizeof(LDKHTLCOutputInCommitment)); return res; } - ~HTLCOutputInCommitment() { HTLCOutputInCommitment_free(self); } - HTLCOutputInCommitment& operator=(HTLCOutputInCommitment&& o) { HTLCOutputInCommitment_free(self); self = o.self; memset(&o, 0, sizeof(HTLCOutputInCommitment)); return *this; } - LDKHTLCOutputInCommitment* operator &() { return &self; } - LDKHTLCOutputInCommitment* operator ->() { return &self; } - const LDKHTLCOutputInCommitment* operator &() const { return &self; } - const LDKHTLCOutputInCommitment* operator ->() const { return &self; } + UpdateFee(const UpdateFee&) = delete; + UpdateFee(UpdateFee&& o) : self(o.self) { memset(&o, 0, sizeof(UpdateFee)); } + UpdateFee(LDKUpdateFee&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUpdateFee)); } + operator LDKUpdateFee() && { LDKUpdateFee res = self; memset(&self, 0, sizeof(LDKUpdateFee)); return res; } + ~UpdateFee() { UpdateFee_free(self); } + UpdateFee& operator=(UpdateFee&& o) { UpdateFee_free(self); self = o.self; memset(&o, 0, sizeof(UpdateFee)); return *this; } + LDKUpdateFee* operator &() { return &self; } + LDKUpdateFee* operator ->() { return &self; } + const LDKUpdateFee* operator &() const { return &self; } + const LDKUpdateFee* operator ->() const { return &self; } }; -class ChannelTransactionParameters { +class DataLossProtect { private: - LDKChannelTransactionParameters self; + LDKDataLossProtect self; public: - ChannelTransactionParameters(const ChannelTransactionParameters&) = delete; - ChannelTransactionParameters(ChannelTransactionParameters&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelTransactionParameters)); } - ChannelTransactionParameters(LDKChannelTransactionParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelTransactionParameters)); } - operator LDKChannelTransactionParameters() && { LDKChannelTransactionParameters res = self; memset(&self, 0, sizeof(LDKChannelTransactionParameters)); return res; } - ~ChannelTransactionParameters() { ChannelTransactionParameters_free(self); } - ChannelTransactionParameters& operator=(ChannelTransactionParameters&& o) { ChannelTransactionParameters_free(self); self = o.self; memset(&o, 0, sizeof(ChannelTransactionParameters)); return *this; } - LDKChannelTransactionParameters* operator &() { return &self; } - LDKChannelTransactionParameters* operator ->() { return &self; } - const LDKChannelTransactionParameters* operator &() const { return &self; } - const LDKChannelTransactionParameters* operator ->() const { return &self; } + DataLossProtect(const DataLossProtect&) = delete; + DataLossProtect(DataLossProtect&& o) : self(o.self) { memset(&o, 0, sizeof(DataLossProtect)); } + DataLossProtect(LDKDataLossProtect&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDataLossProtect)); } + operator LDKDataLossProtect() && { LDKDataLossProtect res = self; memset(&self, 0, sizeof(LDKDataLossProtect)); return res; } + ~DataLossProtect() { DataLossProtect_free(self); } + DataLossProtect& operator=(DataLossProtect&& o) { DataLossProtect_free(self); self = o.self; memset(&o, 0, sizeof(DataLossProtect)); return *this; } + LDKDataLossProtect* operator &() { return &self; } + LDKDataLossProtect* operator ->() { return &self; } + const LDKDataLossProtect* operator &() const { return &self; } + const LDKDataLossProtect* operator ->() const { return &self; } }; -class CounterpartyChannelTransactionParameters { +class ChannelReestablish { private: - LDKCounterpartyChannelTransactionParameters self; + LDKChannelReestablish self; public: - CounterpartyChannelTransactionParameters(const CounterpartyChannelTransactionParameters&) = delete; - CounterpartyChannelTransactionParameters(CounterpartyChannelTransactionParameters&& o) : self(o.self) { memset(&o, 0, sizeof(CounterpartyChannelTransactionParameters)); } - CounterpartyChannelTransactionParameters(LDKCounterpartyChannelTransactionParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCounterpartyChannelTransactionParameters)); } - operator LDKCounterpartyChannelTransactionParameters() && { LDKCounterpartyChannelTransactionParameters res = self; memset(&self, 0, sizeof(LDKCounterpartyChannelTransactionParameters)); return res; } - ~CounterpartyChannelTransactionParameters() { CounterpartyChannelTransactionParameters_free(self); } - CounterpartyChannelTransactionParameters& operator=(CounterpartyChannelTransactionParameters&& o) { CounterpartyChannelTransactionParameters_free(self); self = o.self; memset(&o, 0, sizeof(CounterpartyChannelTransactionParameters)); return *this; } - LDKCounterpartyChannelTransactionParameters* operator &() { return &self; } - LDKCounterpartyChannelTransactionParameters* operator ->() { return &self; } - const LDKCounterpartyChannelTransactionParameters* operator &() const { return &self; } - const LDKCounterpartyChannelTransactionParameters* operator ->() const { return &self; } + ChannelReestablish(const ChannelReestablish&) = delete; + ChannelReestablish(ChannelReestablish&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelReestablish)); } + ChannelReestablish(LDKChannelReestablish&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelReestablish)); } + operator LDKChannelReestablish() && { LDKChannelReestablish res = self; memset(&self, 0, sizeof(LDKChannelReestablish)); return res; } + ~ChannelReestablish() { ChannelReestablish_free(self); } + ChannelReestablish& operator=(ChannelReestablish&& o) { ChannelReestablish_free(self); self = o.self; memset(&o, 0, sizeof(ChannelReestablish)); return *this; } + LDKChannelReestablish* operator &() { return &self; } + LDKChannelReestablish* operator ->() { return &self; } + const LDKChannelReestablish* operator &() const { return &self; } + const LDKChannelReestablish* operator ->() const { return &self; } }; -class DirectedChannelTransactionParameters { +class AnnouncementSignatures { private: - LDKDirectedChannelTransactionParameters self; + LDKAnnouncementSignatures self; public: - DirectedChannelTransactionParameters(const DirectedChannelTransactionParameters&) = delete; - DirectedChannelTransactionParameters(DirectedChannelTransactionParameters&& o) : self(o.self) { memset(&o, 0, sizeof(DirectedChannelTransactionParameters)); } - DirectedChannelTransactionParameters(LDKDirectedChannelTransactionParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDirectedChannelTransactionParameters)); } - operator LDKDirectedChannelTransactionParameters() && { LDKDirectedChannelTransactionParameters res = self; memset(&self, 0, sizeof(LDKDirectedChannelTransactionParameters)); return res; } - ~DirectedChannelTransactionParameters() { DirectedChannelTransactionParameters_free(self); } - DirectedChannelTransactionParameters& operator=(DirectedChannelTransactionParameters&& o) { DirectedChannelTransactionParameters_free(self); self = o.self; memset(&o, 0, sizeof(DirectedChannelTransactionParameters)); return *this; } - LDKDirectedChannelTransactionParameters* operator &() { return &self; } - LDKDirectedChannelTransactionParameters* operator ->() { return &self; } - const LDKDirectedChannelTransactionParameters* operator &() const { return &self; } - const LDKDirectedChannelTransactionParameters* operator ->() const { return &self; } + AnnouncementSignatures(const AnnouncementSignatures&) = delete; + AnnouncementSignatures(AnnouncementSignatures&& o) : self(o.self) { memset(&o, 0, sizeof(AnnouncementSignatures)); } + AnnouncementSignatures(LDKAnnouncementSignatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKAnnouncementSignatures)); } + operator LDKAnnouncementSignatures() && { LDKAnnouncementSignatures res = self; memset(&self, 0, sizeof(LDKAnnouncementSignatures)); return res; } + ~AnnouncementSignatures() { AnnouncementSignatures_free(self); } + AnnouncementSignatures& operator=(AnnouncementSignatures&& o) { AnnouncementSignatures_free(self); self = o.self; memset(&o, 0, sizeof(AnnouncementSignatures)); return *this; } + LDKAnnouncementSignatures* operator &() { return &self; } + LDKAnnouncementSignatures* operator ->() { return &self; } + const LDKAnnouncementSignatures* operator &() const { return &self; } + const LDKAnnouncementSignatures* operator ->() const { return &self; } }; -class HolderCommitmentTransaction { +class NetAddress { private: - LDKHolderCommitmentTransaction self; + LDKNetAddress self; public: - HolderCommitmentTransaction(const HolderCommitmentTransaction&) = delete; - HolderCommitmentTransaction(HolderCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(HolderCommitmentTransaction)); } - HolderCommitmentTransaction(LDKHolderCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHolderCommitmentTransaction)); } - operator LDKHolderCommitmentTransaction() && { LDKHolderCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKHolderCommitmentTransaction)); return res; } - ~HolderCommitmentTransaction() { HolderCommitmentTransaction_free(self); } - HolderCommitmentTransaction& operator=(HolderCommitmentTransaction&& o) { HolderCommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(HolderCommitmentTransaction)); return *this; } - LDKHolderCommitmentTransaction* operator &() { return &self; } - LDKHolderCommitmentTransaction* operator ->() { return &self; } - const LDKHolderCommitmentTransaction* operator &() const { return &self; } - const LDKHolderCommitmentTransaction* operator ->() const { return &self; } + NetAddress(const NetAddress&) = delete; + NetAddress(NetAddress&& o) : self(o.self) { memset(&o, 0, sizeof(NetAddress)); } + NetAddress(LDKNetAddress&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNetAddress)); } + operator LDKNetAddress() && { LDKNetAddress res = self; memset(&self, 0, sizeof(LDKNetAddress)); return res; } + ~NetAddress() { NetAddress_free(self); } + NetAddress& operator=(NetAddress&& o) { NetAddress_free(self); self = o.self; memset(&o, 0, sizeof(NetAddress)); return *this; } + LDKNetAddress* operator &() { return &self; } + LDKNetAddress* operator ->() { return &self; } + const LDKNetAddress* operator &() const { return &self; } + const LDKNetAddress* operator ->() const { return &self; } }; -class BuiltCommitmentTransaction { -private: - LDKBuiltCommitmentTransaction self; -public: - BuiltCommitmentTransaction(const BuiltCommitmentTransaction&) = delete; - BuiltCommitmentTransaction(BuiltCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(BuiltCommitmentTransaction)); } - BuiltCommitmentTransaction(LDKBuiltCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKBuiltCommitmentTransaction)); } - operator LDKBuiltCommitmentTransaction() && { LDKBuiltCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKBuiltCommitmentTransaction)); return res; } - ~BuiltCommitmentTransaction() { BuiltCommitmentTransaction_free(self); } - BuiltCommitmentTransaction& operator=(BuiltCommitmentTransaction&& o) { BuiltCommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(BuiltCommitmentTransaction)); return *this; } - LDKBuiltCommitmentTransaction* operator &() { return &self; } - LDKBuiltCommitmentTransaction* operator ->() { return &self; } - const LDKBuiltCommitmentTransaction* operator &() const { return &self; } - const LDKBuiltCommitmentTransaction* operator ->() const { return &self; } +class UnsignedNodeAnnouncement { +private: + LDKUnsignedNodeAnnouncement self; +public: + UnsignedNodeAnnouncement(const UnsignedNodeAnnouncement&) = delete; + UnsignedNodeAnnouncement(UnsignedNodeAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(UnsignedNodeAnnouncement)); } + UnsignedNodeAnnouncement(LDKUnsignedNodeAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUnsignedNodeAnnouncement)); } + operator LDKUnsignedNodeAnnouncement() && { LDKUnsignedNodeAnnouncement res = self; memset(&self, 0, sizeof(LDKUnsignedNodeAnnouncement)); return res; } + ~UnsignedNodeAnnouncement() { UnsignedNodeAnnouncement_free(self); } + UnsignedNodeAnnouncement& operator=(UnsignedNodeAnnouncement&& o) { UnsignedNodeAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(UnsignedNodeAnnouncement)); return *this; } + LDKUnsignedNodeAnnouncement* operator &() { return &self; } + LDKUnsignedNodeAnnouncement* operator ->() { return &self; } + const LDKUnsignedNodeAnnouncement* operator &() const { return &self; } + const LDKUnsignedNodeAnnouncement* operator ->() const { return &self; } }; -class CommitmentTransaction { +class NodeAnnouncement { private: - LDKCommitmentTransaction self; + LDKNodeAnnouncement self; public: - CommitmentTransaction(const CommitmentTransaction&) = delete; - CommitmentTransaction(CommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(CommitmentTransaction)); } - CommitmentTransaction(LDKCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCommitmentTransaction)); } - operator LDKCommitmentTransaction() && { LDKCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKCommitmentTransaction)); return res; } - ~CommitmentTransaction() { CommitmentTransaction_free(self); } - CommitmentTransaction& operator=(CommitmentTransaction&& o) { CommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(CommitmentTransaction)); return *this; } - LDKCommitmentTransaction* operator &() { return &self; } - LDKCommitmentTransaction* operator ->() { return &self; } - const LDKCommitmentTransaction* operator &() const { return &self; } - const LDKCommitmentTransaction* operator ->() const { return &self; } + NodeAnnouncement(const NodeAnnouncement&) = delete; + NodeAnnouncement(NodeAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(NodeAnnouncement)); } + NodeAnnouncement(LDKNodeAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeAnnouncement)); } + operator LDKNodeAnnouncement() && { LDKNodeAnnouncement res = self; memset(&self, 0, sizeof(LDKNodeAnnouncement)); return res; } + ~NodeAnnouncement() { NodeAnnouncement_free(self); } + NodeAnnouncement& operator=(NodeAnnouncement&& o) { NodeAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(NodeAnnouncement)); return *this; } + LDKNodeAnnouncement* operator &() { return &self; } + LDKNodeAnnouncement* operator ->() { return &self; } + const LDKNodeAnnouncement* operator &() const { return &self; } + const LDKNodeAnnouncement* operator ->() const { return &self; } }; -class TrustedCommitmentTransaction { +class UnsignedChannelAnnouncement { private: - LDKTrustedCommitmentTransaction self; + LDKUnsignedChannelAnnouncement self; public: - TrustedCommitmentTransaction(const TrustedCommitmentTransaction&) = delete; - TrustedCommitmentTransaction(TrustedCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(TrustedCommitmentTransaction)); } - TrustedCommitmentTransaction(LDKTrustedCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKTrustedCommitmentTransaction)); } - operator LDKTrustedCommitmentTransaction() && { LDKTrustedCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKTrustedCommitmentTransaction)); return res; } - ~TrustedCommitmentTransaction() { TrustedCommitmentTransaction_free(self); } - TrustedCommitmentTransaction& operator=(TrustedCommitmentTransaction&& o) { TrustedCommitmentTransaction_free(self); self = o.self; memset(&o, 0, sizeof(TrustedCommitmentTransaction)); return *this; } - LDKTrustedCommitmentTransaction* operator &() { return &self; } - LDKTrustedCommitmentTransaction* operator ->() { return &self; } - const LDKTrustedCommitmentTransaction* operator &() const { return &self; } - const LDKTrustedCommitmentTransaction* operator ->() const { return &self; } + UnsignedChannelAnnouncement(const UnsignedChannelAnnouncement&) = delete; + UnsignedChannelAnnouncement(UnsignedChannelAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(UnsignedChannelAnnouncement)); } + UnsignedChannelAnnouncement(LDKUnsignedChannelAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUnsignedChannelAnnouncement)); } + operator LDKUnsignedChannelAnnouncement() && { LDKUnsignedChannelAnnouncement res = self; memset(&self, 0, sizeof(LDKUnsignedChannelAnnouncement)); return res; } + ~UnsignedChannelAnnouncement() { UnsignedChannelAnnouncement_free(self); } + UnsignedChannelAnnouncement& operator=(UnsignedChannelAnnouncement&& o) { UnsignedChannelAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(UnsignedChannelAnnouncement)); return *this; } + LDKUnsignedChannelAnnouncement* operator &() { return &self; } + LDKUnsignedChannelAnnouncement* operator ->() { return &self; } + const LDKUnsignedChannelAnnouncement* operator &() const { return &self; } + const LDKUnsignedChannelAnnouncement* operator ->() const { return &self; } }; -class InitFeatures { +class ChannelAnnouncement { private: - LDKInitFeatures self; + LDKChannelAnnouncement self; public: - InitFeatures(const InitFeatures&) = delete; - InitFeatures(InitFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(InitFeatures)); } - InitFeatures(LDKInitFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKInitFeatures)); } - operator LDKInitFeatures() && { LDKInitFeatures res = self; memset(&self, 0, sizeof(LDKInitFeatures)); return res; } - ~InitFeatures() { InitFeatures_free(self); } - InitFeatures& operator=(InitFeatures&& o) { InitFeatures_free(self); self = o.self; memset(&o, 0, sizeof(InitFeatures)); return *this; } - LDKInitFeatures* operator &() { return &self; } - LDKInitFeatures* operator ->() { return &self; } - const LDKInitFeatures* operator &() const { return &self; } - const LDKInitFeatures* operator ->() const { return &self; } + ChannelAnnouncement(const ChannelAnnouncement&) = delete; + ChannelAnnouncement(ChannelAnnouncement&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelAnnouncement)); } + ChannelAnnouncement(LDKChannelAnnouncement&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelAnnouncement)); } + operator LDKChannelAnnouncement() && { LDKChannelAnnouncement res = self; memset(&self, 0, sizeof(LDKChannelAnnouncement)); return res; } + ~ChannelAnnouncement() { ChannelAnnouncement_free(self); } + ChannelAnnouncement& operator=(ChannelAnnouncement&& o) { ChannelAnnouncement_free(self); self = o.self; memset(&o, 0, sizeof(ChannelAnnouncement)); return *this; } + LDKChannelAnnouncement* operator &() { return &self; } + LDKChannelAnnouncement* operator ->() { return &self; } + const LDKChannelAnnouncement* operator &() const { return &self; } + const LDKChannelAnnouncement* operator ->() const { return &self; } }; -class NodeFeatures { +class UnsignedChannelUpdate { private: - LDKNodeFeatures self; + LDKUnsignedChannelUpdate self; public: - NodeFeatures(const NodeFeatures&) = delete; - NodeFeatures(NodeFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(NodeFeatures)); } - NodeFeatures(LDKNodeFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeFeatures)); } - operator LDKNodeFeatures() && { LDKNodeFeatures res = self; memset(&self, 0, sizeof(LDKNodeFeatures)); return res; } - ~NodeFeatures() { NodeFeatures_free(self); } - NodeFeatures& operator=(NodeFeatures&& o) { NodeFeatures_free(self); self = o.self; memset(&o, 0, sizeof(NodeFeatures)); return *this; } - LDKNodeFeatures* operator &() { return &self; } - LDKNodeFeatures* operator ->() { return &self; } - const LDKNodeFeatures* operator &() const { return &self; } - const LDKNodeFeatures* operator ->() const { return &self; } + UnsignedChannelUpdate(const UnsignedChannelUpdate&) = delete; + UnsignedChannelUpdate(UnsignedChannelUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(UnsignedChannelUpdate)); } + UnsignedChannelUpdate(LDKUnsignedChannelUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKUnsignedChannelUpdate)); } + operator LDKUnsignedChannelUpdate() && { LDKUnsignedChannelUpdate res = self; memset(&self, 0, sizeof(LDKUnsignedChannelUpdate)); return res; } + ~UnsignedChannelUpdate() { UnsignedChannelUpdate_free(self); } + UnsignedChannelUpdate& operator=(UnsignedChannelUpdate&& o) { UnsignedChannelUpdate_free(self); self = o.self; memset(&o, 0, sizeof(UnsignedChannelUpdate)); return *this; } + LDKUnsignedChannelUpdate* operator &() { return &self; } + LDKUnsignedChannelUpdate* operator ->() { return &self; } + const LDKUnsignedChannelUpdate* operator &() const { return &self; } + const LDKUnsignedChannelUpdate* operator ->() const { return &self; } }; -class ChannelFeatures { +class ChannelUpdate { private: - LDKChannelFeatures self; + LDKChannelUpdate self; public: - ChannelFeatures(const ChannelFeatures&) = delete; - ChannelFeatures(ChannelFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelFeatures)); } - ChannelFeatures(LDKChannelFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelFeatures)); } - operator LDKChannelFeatures() && { LDKChannelFeatures res = self; memset(&self, 0, sizeof(LDKChannelFeatures)); return res; } - ~ChannelFeatures() { ChannelFeatures_free(self); } - ChannelFeatures& operator=(ChannelFeatures&& o) { ChannelFeatures_free(self); self = o.self; memset(&o, 0, sizeof(ChannelFeatures)); return *this; } - LDKChannelFeatures* operator &() { return &self; } - LDKChannelFeatures* operator ->() { return &self; } - const LDKChannelFeatures* operator &() const { return &self; } - const LDKChannelFeatures* operator ->() const { return &self; } + ChannelUpdate(const ChannelUpdate&) = delete; + ChannelUpdate(ChannelUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelUpdate)); } + ChannelUpdate(LDKChannelUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelUpdate)); } + operator LDKChannelUpdate() && { LDKChannelUpdate res = self; memset(&self, 0, sizeof(LDKChannelUpdate)); return res; } + ~ChannelUpdate() { ChannelUpdate_free(self); } + ChannelUpdate& operator=(ChannelUpdate&& o) { ChannelUpdate_free(self); self = o.self; memset(&o, 0, sizeof(ChannelUpdate)); return *this; } + LDKChannelUpdate* operator &() { return &self; } + LDKChannelUpdate* operator ->() { return &self; } + const LDKChannelUpdate* operator &() const { return &self; } + const LDKChannelUpdate* operator ->() const { return &self; } }; -class RouteHop { +class QueryChannelRange { private: - LDKRouteHop self; + LDKQueryChannelRange self; public: - RouteHop(const RouteHop&) = delete; - RouteHop(RouteHop&& o) : self(o.self) { memset(&o, 0, sizeof(RouteHop)); } - RouteHop(LDKRouteHop&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRouteHop)); } - operator LDKRouteHop() && { LDKRouteHop res = self; memset(&self, 0, sizeof(LDKRouteHop)); return res; } - ~RouteHop() { RouteHop_free(self); } - RouteHop& operator=(RouteHop&& o) { RouteHop_free(self); self = o.self; memset(&o, 0, sizeof(RouteHop)); return *this; } - LDKRouteHop* operator &() { return &self; } - LDKRouteHop* operator ->() { return &self; } - const LDKRouteHop* operator &() const { return &self; } - const LDKRouteHop* operator ->() const { return &self; } + QueryChannelRange(const QueryChannelRange&) = delete; + QueryChannelRange(QueryChannelRange&& o) : self(o.self) { memset(&o, 0, sizeof(QueryChannelRange)); } + QueryChannelRange(LDKQueryChannelRange&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKQueryChannelRange)); } + operator LDKQueryChannelRange() && { LDKQueryChannelRange res = self; memset(&self, 0, sizeof(LDKQueryChannelRange)); return res; } + ~QueryChannelRange() { QueryChannelRange_free(self); } + QueryChannelRange& operator=(QueryChannelRange&& o) { QueryChannelRange_free(self); self = o.self; memset(&o, 0, sizeof(QueryChannelRange)); return *this; } + LDKQueryChannelRange* operator &() { return &self; } + LDKQueryChannelRange* operator ->() { return &self; } + const LDKQueryChannelRange* operator &() const { return &self; } + const LDKQueryChannelRange* operator ->() const { return &self; } }; -class Route { +class ReplyChannelRange { private: - LDKRoute self; + LDKReplyChannelRange self; public: - Route(const Route&) = delete; - Route(Route&& o) : self(o.self) { memset(&o, 0, sizeof(Route)); } - Route(LDKRoute&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRoute)); } - operator LDKRoute() && { LDKRoute res = self; memset(&self, 0, sizeof(LDKRoute)); return res; } - ~Route() { Route_free(self); } - Route& operator=(Route&& o) { Route_free(self); self = o.self; memset(&o, 0, sizeof(Route)); return *this; } - LDKRoute* operator &() { return &self; } - LDKRoute* operator ->() { return &self; } - const LDKRoute* operator &() const { return &self; } - const LDKRoute* operator ->() const { return &self; } + ReplyChannelRange(const ReplyChannelRange&) = delete; + ReplyChannelRange(ReplyChannelRange&& o) : self(o.self) { memset(&o, 0, sizeof(ReplyChannelRange)); } + ReplyChannelRange(LDKReplyChannelRange&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKReplyChannelRange)); } + operator LDKReplyChannelRange() && { LDKReplyChannelRange res = self; memset(&self, 0, sizeof(LDKReplyChannelRange)); return res; } + ~ReplyChannelRange() { ReplyChannelRange_free(self); } + ReplyChannelRange& operator=(ReplyChannelRange&& o) { ReplyChannelRange_free(self); self = o.self; memset(&o, 0, sizeof(ReplyChannelRange)); return *this; } + LDKReplyChannelRange* operator &() { return &self; } + LDKReplyChannelRange* operator ->() { return &self; } + const LDKReplyChannelRange* operator &() const { return &self; } + const LDKReplyChannelRange* operator ->() const { return &self; } }; -class RouteHint { +class QueryShortChannelIds { private: - LDKRouteHint self; + LDKQueryShortChannelIds self; public: - RouteHint(const RouteHint&) = delete; - RouteHint(RouteHint&& o) : self(o.self) { memset(&o, 0, sizeof(RouteHint)); } - RouteHint(LDKRouteHint&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRouteHint)); } - operator LDKRouteHint() && { LDKRouteHint res = self; memset(&self, 0, sizeof(LDKRouteHint)); return res; } - ~RouteHint() { RouteHint_free(self); } - RouteHint& operator=(RouteHint&& o) { RouteHint_free(self); self = o.self; memset(&o, 0, sizeof(RouteHint)); return *this; } - LDKRouteHint* operator &() { return &self; } - LDKRouteHint* operator ->() { return &self; } - const LDKRouteHint* operator &() const { return &self; } - const LDKRouteHint* operator ->() const { return &self; } + QueryShortChannelIds(const QueryShortChannelIds&) = delete; + QueryShortChannelIds(QueryShortChannelIds&& o) : self(o.self) { memset(&o, 0, sizeof(QueryShortChannelIds)); } + QueryShortChannelIds(LDKQueryShortChannelIds&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKQueryShortChannelIds)); } + operator LDKQueryShortChannelIds() && { LDKQueryShortChannelIds res = self; memset(&self, 0, sizeof(LDKQueryShortChannelIds)); return res; } + ~QueryShortChannelIds() { QueryShortChannelIds_free(self); } + QueryShortChannelIds& operator=(QueryShortChannelIds&& o) { QueryShortChannelIds_free(self); self = o.self; memset(&o, 0, sizeof(QueryShortChannelIds)); return *this; } + LDKQueryShortChannelIds* operator &() { return &self; } + LDKQueryShortChannelIds* operator ->() { return &self; } + const LDKQueryShortChannelIds* operator &() const { return &self; } + const LDKQueryShortChannelIds* operator ->() const { return &self; } }; -class NetworkGraph { +class ReplyShortChannelIdsEnd { private: - LDKNetworkGraph self; + LDKReplyShortChannelIdsEnd self; public: - NetworkGraph(const NetworkGraph&) = delete; - NetworkGraph(NetworkGraph&& o) : self(o.self) { memset(&o, 0, sizeof(NetworkGraph)); } - NetworkGraph(LDKNetworkGraph&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNetworkGraph)); } - operator LDKNetworkGraph() && { LDKNetworkGraph res = self; memset(&self, 0, sizeof(LDKNetworkGraph)); return res; } - ~NetworkGraph() { NetworkGraph_free(self); } - NetworkGraph& operator=(NetworkGraph&& o) { NetworkGraph_free(self); self = o.self; memset(&o, 0, sizeof(NetworkGraph)); return *this; } - LDKNetworkGraph* operator &() { return &self; } - LDKNetworkGraph* operator ->() { return &self; } - const LDKNetworkGraph* operator &() const { return &self; } - const LDKNetworkGraph* operator ->() const { return &self; } + ReplyShortChannelIdsEnd(const ReplyShortChannelIdsEnd&) = delete; + ReplyShortChannelIdsEnd(ReplyShortChannelIdsEnd&& o) : self(o.self) { memset(&o, 0, sizeof(ReplyShortChannelIdsEnd)); } + ReplyShortChannelIdsEnd(LDKReplyShortChannelIdsEnd&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKReplyShortChannelIdsEnd)); } + operator LDKReplyShortChannelIdsEnd() && { LDKReplyShortChannelIdsEnd res = self; memset(&self, 0, sizeof(LDKReplyShortChannelIdsEnd)); return res; } + ~ReplyShortChannelIdsEnd() { ReplyShortChannelIdsEnd_free(self); } + ReplyShortChannelIdsEnd& operator=(ReplyShortChannelIdsEnd&& o) { ReplyShortChannelIdsEnd_free(self); self = o.self; memset(&o, 0, sizeof(ReplyShortChannelIdsEnd)); return *this; } + LDKReplyShortChannelIdsEnd* operator &() { return &self; } + LDKReplyShortChannelIdsEnd* operator ->() { return &self; } + const LDKReplyShortChannelIdsEnd* operator &() const { return &self; } + const LDKReplyShortChannelIdsEnd* operator ->() const { return &self; } }; -class LockedNetworkGraph { +class GossipTimestampFilter { private: - LDKLockedNetworkGraph self; + LDKGossipTimestampFilter self; public: - LockedNetworkGraph(const LockedNetworkGraph&) = delete; - LockedNetworkGraph(LockedNetworkGraph&& o) : self(o.self) { memset(&o, 0, sizeof(LockedNetworkGraph)); } - LockedNetworkGraph(LDKLockedNetworkGraph&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLockedNetworkGraph)); } - operator LDKLockedNetworkGraph() && { LDKLockedNetworkGraph res = self; memset(&self, 0, sizeof(LDKLockedNetworkGraph)); return res; } - ~LockedNetworkGraph() { LockedNetworkGraph_free(self); } - LockedNetworkGraph& operator=(LockedNetworkGraph&& o) { LockedNetworkGraph_free(self); self = o.self; memset(&o, 0, sizeof(LockedNetworkGraph)); return *this; } - LDKLockedNetworkGraph* operator &() { return &self; } - LDKLockedNetworkGraph* operator ->() { return &self; } - const LDKLockedNetworkGraph* operator &() const { return &self; } - const LDKLockedNetworkGraph* operator ->() const { return &self; } + GossipTimestampFilter(const GossipTimestampFilter&) = delete; + GossipTimestampFilter(GossipTimestampFilter&& o) : self(o.self) { memset(&o, 0, sizeof(GossipTimestampFilter)); } + GossipTimestampFilter(LDKGossipTimestampFilter&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKGossipTimestampFilter)); } + operator LDKGossipTimestampFilter() && { LDKGossipTimestampFilter res = self; memset(&self, 0, sizeof(LDKGossipTimestampFilter)); return res; } + ~GossipTimestampFilter() { GossipTimestampFilter_free(self); } + GossipTimestampFilter& operator=(GossipTimestampFilter&& o) { GossipTimestampFilter_free(self); self = o.self; memset(&o, 0, sizeof(GossipTimestampFilter)); return *this; } + LDKGossipTimestampFilter* operator &() { return &self; } + LDKGossipTimestampFilter* operator ->() { return &self; } + const LDKGossipTimestampFilter* operator &() const { return &self; } + const LDKGossipTimestampFilter* operator ->() const { return &self; } }; -class NetGraphMsgHandler { +class ErrorAction { private: - LDKNetGraphMsgHandler self; + LDKErrorAction self; public: - NetGraphMsgHandler(const NetGraphMsgHandler&) = delete; - NetGraphMsgHandler(NetGraphMsgHandler&& o) : self(o.self) { memset(&o, 0, sizeof(NetGraphMsgHandler)); } - NetGraphMsgHandler(LDKNetGraphMsgHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNetGraphMsgHandler)); } - operator LDKNetGraphMsgHandler() && { LDKNetGraphMsgHandler res = self; memset(&self, 0, sizeof(LDKNetGraphMsgHandler)); return res; } - ~NetGraphMsgHandler() { NetGraphMsgHandler_free(self); } - NetGraphMsgHandler& operator=(NetGraphMsgHandler&& o) { NetGraphMsgHandler_free(self); self = o.self; memset(&o, 0, sizeof(NetGraphMsgHandler)); return *this; } - LDKNetGraphMsgHandler* operator &() { return &self; } - LDKNetGraphMsgHandler* operator ->() { return &self; } - const LDKNetGraphMsgHandler* operator &() const { return &self; } - const LDKNetGraphMsgHandler* operator ->() const { return &self; } + ErrorAction(const ErrorAction&) = delete; + ErrorAction(ErrorAction&& o) : self(o.self) { memset(&o, 0, sizeof(ErrorAction)); } + ErrorAction(LDKErrorAction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKErrorAction)); } + operator LDKErrorAction() && { LDKErrorAction res = self; memset(&self, 0, sizeof(LDKErrorAction)); return res; } + ~ErrorAction() { ErrorAction_free(self); } + ErrorAction& operator=(ErrorAction&& o) { ErrorAction_free(self); self = o.self; memset(&o, 0, sizeof(ErrorAction)); return *this; } + LDKErrorAction* operator &() { return &self; } + LDKErrorAction* operator ->() { return &self; } + const LDKErrorAction* operator &() const { return &self; } + const LDKErrorAction* operator ->() const { return &self; } }; -class DirectionalChannelInfo { +class LightningError { private: - LDKDirectionalChannelInfo self; + LDKLightningError self; public: - DirectionalChannelInfo(const DirectionalChannelInfo&) = delete; - DirectionalChannelInfo(DirectionalChannelInfo&& o) : self(o.self) { memset(&o, 0, sizeof(DirectionalChannelInfo)); } - DirectionalChannelInfo(LDKDirectionalChannelInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKDirectionalChannelInfo)); } - operator LDKDirectionalChannelInfo() && { LDKDirectionalChannelInfo res = self; memset(&self, 0, sizeof(LDKDirectionalChannelInfo)); return res; } - ~DirectionalChannelInfo() { DirectionalChannelInfo_free(self); } - DirectionalChannelInfo& operator=(DirectionalChannelInfo&& o) { DirectionalChannelInfo_free(self); self = o.self; memset(&o, 0, sizeof(DirectionalChannelInfo)); return *this; } - LDKDirectionalChannelInfo* operator &() { return &self; } - LDKDirectionalChannelInfo* operator ->() { return &self; } - const LDKDirectionalChannelInfo* operator &() const { return &self; } - const LDKDirectionalChannelInfo* operator ->() const { return &self; } + LightningError(const LightningError&) = delete; + LightningError(LightningError&& o) : self(o.self) { memset(&o, 0, sizeof(LightningError)); } + LightningError(LDKLightningError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLightningError)); } + operator LDKLightningError() && { LDKLightningError res = self; memset(&self, 0, sizeof(LDKLightningError)); return res; } + ~LightningError() { LightningError_free(self); } + LightningError& operator=(LightningError&& o) { LightningError_free(self); self = o.self; memset(&o, 0, sizeof(LightningError)); return *this; } + LDKLightningError* operator &() { return &self; } + LDKLightningError* operator ->() { return &self; } + const LDKLightningError* operator &() const { return &self; } + const LDKLightningError* operator ->() const { return &self; } }; -class ChannelInfo { +class CommitmentUpdate { private: - LDKChannelInfo self; + LDKCommitmentUpdate self; public: - ChannelInfo(const ChannelInfo&) = delete; - ChannelInfo(ChannelInfo&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelInfo)); } - ChannelInfo(LDKChannelInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelInfo)); } - operator LDKChannelInfo() && { LDKChannelInfo res = self; memset(&self, 0, sizeof(LDKChannelInfo)); return res; } - ~ChannelInfo() { ChannelInfo_free(self); } - ChannelInfo& operator=(ChannelInfo&& o) { ChannelInfo_free(self); self = o.self; memset(&o, 0, sizeof(ChannelInfo)); return *this; } - LDKChannelInfo* operator &() { return &self; } - LDKChannelInfo* operator ->() { return &self; } - const LDKChannelInfo* operator &() const { return &self; } - const LDKChannelInfo* operator ->() const { return &self; } + CommitmentUpdate(const CommitmentUpdate&) = delete; + CommitmentUpdate(CommitmentUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(CommitmentUpdate)); } + CommitmentUpdate(LDKCommitmentUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCommitmentUpdate)); } + operator LDKCommitmentUpdate() && { LDKCommitmentUpdate res = self; memset(&self, 0, sizeof(LDKCommitmentUpdate)); return res; } + ~CommitmentUpdate() { CommitmentUpdate_free(self); } + CommitmentUpdate& operator=(CommitmentUpdate&& o) { CommitmentUpdate_free(self); self = o.self; memset(&o, 0, sizeof(CommitmentUpdate)); return *this; } + LDKCommitmentUpdate* operator &() { return &self; } + LDKCommitmentUpdate* operator ->() { return &self; } + const LDKCommitmentUpdate* operator &() const { return &self; } + const LDKCommitmentUpdate* operator ->() const { return &self; } }; -class RoutingFees { +class HTLCFailChannelUpdate { private: - LDKRoutingFees self; + LDKHTLCFailChannelUpdate self; public: - RoutingFees(const RoutingFees&) = delete; - RoutingFees(RoutingFees&& o) : self(o.self) { memset(&o, 0, sizeof(RoutingFees)); } - RoutingFees(LDKRoutingFees&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRoutingFees)); } - operator LDKRoutingFees() && { LDKRoutingFees res = self; memset(&self, 0, sizeof(LDKRoutingFees)); return res; } - ~RoutingFees() { RoutingFees_free(self); } - RoutingFees& operator=(RoutingFees&& o) { RoutingFees_free(self); self = o.self; memset(&o, 0, sizeof(RoutingFees)); return *this; } - LDKRoutingFees* operator &() { return &self; } - LDKRoutingFees* operator ->() { return &self; } - const LDKRoutingFees* operator &() const { return &self; } - const LDKRoutingFees* operator ->() const { return &self; } + HTLCFailChannelUpdate(const HTLCFailChannelUpdate&) = delete; + HTLCFailChannelUpdate(HTLCFailChannelUpdate&& o) : self(o.self) { memset(&o, 0, sizeof(HTLCFailChannelUpdate)); } + HTLCFailChannelUpdate(LDKHTLCFailChannelUpdate&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHTLCFailChannelUpdate)); } + operator LDKHTLCFailChannelUpdate() && { LDKHTLCFailChannelUpdate res = self; memset(&self, 0, sizeof(LDKHTLCFailChannelUpdate)); return res; } + ~HTLCFailChannelUpdate() { HTLCFailChannelUpdate_free(self); } + HTLCFailChannelUpdate& operator=(HTLCFailChannelUpdate&& o) { HTLCFailChannelUpdate_free(self); self = o.self; memset(&o, 0, sizeof(HTLCFailChannelUpdate)); return *this; } + LDKHTLCFailChannelUpdate* operator &() { return &self; } + LDKHTLCFailChannelUpdate* operator ->() { return &self; } + const LDKHTLCFailChannelUpdate* operator &() const { return &self; } + const LDKHTLCFailChannelUpdate* operator ->() const { return &self; } }; -class NodeAnnouncementInfo { +class ChannelMessageHandler { private: - LDKNodeAnnouncementInfo self; + LDKChannelMessageHandler self; public: - NodeAnnouncementInfo(const NodeAnnouncementInfo&) = delete; - NodeAnnouncementInfo(NodeAnnouncementInfo&& o) : self(o.self) { memset(&o, 0, sizeof(NodeAnnouncementInfo)); } - NodeAnnouncementInfo(LDKNodeAnnouncementInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeAnnouncementInfo)); } - operator LDKNodeAnnouncementInfo() && { LDKNodeAnnouncementInfo res = self; memset(&self, 0, sizeof(LDKNodeAnnouncementInfo)); return res; } - ~NodeAnnouncementInfo() { NodeAnnouncementInfo_free(self); } - NodeAnnouncementInfo& operator=(NodeAnnouncementInfo&& o) { NodeAnnouncementInfo_free(self); self = o.self; memset(&o, 0, sizeof(NodeAnnouncementInfo)); return *this; } - LDKNodeAnnouncementInfo* operator &() { return &self; } - LDKNodeAnnouncementInfo* operator ->() { return &self; } - const LDKNodeAnnouncementInfo* operator &() const { return &self; } - const LDKNodeAnnouncementInfo* operator ->() const { return &self; } + ChannelMessageHandler(const ChannelMessageHandler&) = delete; + ChannelMessageHandler(ChannelMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMessageHandler)); } + ChannelMessageHandler(LDKChannelMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMessageHandler)); } + operator LDKChannelMessageHandler() && { LDKChannelMessageHandler res = self; memset(&self, 0, sizeof(LDKChannelMessageHandler)); return res; } + ~ChannelMessageHandler() { ChannelMessageHandler_free(self); } + ChannelMessageHandler& operator=(ChannelMessageHandler&& o) { ChannelMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMessageHandler)); return *this; } + LDKChannelMessageHandler* operator &() { return &self; } + LDKChannelMessageHandler* operator ->() { return &self; } + const LDKChannelMessageHandler* operator &() const { return &self; } + const LDKChannelMessageHandler* operator ->() const { return &self; } }; -class NodeInfo { +class RoutingMessageHandler { private: - LDKNodeInfo self; + LDKRoutingMessageHandler self; public: - NodeInfo(const NodeInfo&) = delete; - NodeInfo(NodeInfo&& o) : self(o.self) { memset(&o, 0, sizeof(NodeInfo)); } - NodeInfo(LDKNodeInfo&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKNodeInfo)); } - operator LDKNodeInfo() && { LDKNodeInfo res = self; memset(&self, 0, sizeof(LDKNodeInfo)); return res; } - ~NodeInfo() { NodeInfo_free(self); } - NodeInfo& operator=(NodeInfo&& o) { NodeInfo_free(self); self = o.self; memset(&o, 0, sizeof(NodeInfo)); return *this; } - LDKNodeInfo* operator &() { return &self; } - LDKNodeInfo* operator ->() { return &self; } - const LDKNodeInfo* operator &() const { return &self; } - const LDKNodeInfo* operator ->() const { return &self; } + RoutingMessageHandler(const RoutingMessageHandler&) = delete; + RoutingMessageHandler(RoutingMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(RoutingMessageHandler)); } + RoutingMessageHandler(LDKRoutingMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRoutingMessageHandler)); } + operator LDKRoutingMessageHandler() && { LDKRoutingMessageHandler res = self; memset(&self, 0, sizeof(LDKRoutingMessageHandler)); return res; } + ~RoutingMessageHandler() { RoutingMessageHandler_free(self); } + RoutingMessageHandler& operator=(RoutingMessageHandler&& o) { RoutingMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(RoutingMessageHandler)); return *this; } + LDKRoutingMessageHandler* operator &() { return &self; } + LDKRoutingMessageHandler* operator ->() { return &self; } + const LDKRoutingMessageHandler* operator &() const { return &self; } + const LDKRoutingMessageHandler* operator ->() const { return &self; } }; class CVec_SpendableOutputDescriptorZ { private: @@ -1571,20 +1571,20 @@ class CVec_SpendableOutputDescriptorZ { const LDKCVec_SpendableOutputDescriptorZ* operator &() const { return &self; } const LDKCVec_SpendableOutputDescriptorZ* operator ->() const { return &self; } }; -class CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { +class CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { private: - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ self; + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ self; public: - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(const CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&) = delete; - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } - operator LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() && { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); return res; } - ~CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() { CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(self); } - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ& operator=(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& o) { CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); return *this; } - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() { return &self; } - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() { return &self; } - const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() const { return &self; } - const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() const { return &self; } + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(const CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&) = delete; + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } + operator LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() && { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = self; memset(&self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); return res; } + ~CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() { CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(self); } + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ& operator=(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& o) { CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); return *this; } + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() { return &self; } + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() { return &self; } + const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() const { return &self; } + const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() const { return &self; } }; class CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { private: @@ -1601,35 +1601,140 @@ class CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { const LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* operator &() const { return &self; } const LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* operator ->() const { return &self; } }; -class CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { +class CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { private: - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ self; + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ self; public: - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(const CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&) = delete; - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } - operator LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() && { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = self; memset(&self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); return res; } - ~CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() { CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(self); } - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ& operator=(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& o) { CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); return *this; } - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() { return &self; } - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() { return &self; } - const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() const { return &self; } - const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() const { return &self; } + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(const CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&) = delete; + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } + operator LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() && { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); return res; } + ~CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() { CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(self); } + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ& operator=(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& o) { CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); return *this; } + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() { return &self; } + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() { return &self; } + const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() const { return &self; } + const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() const { return &self; } +}; +class CResult_AcceptChannelDecodeErrorZ { +private: + LDKCResult_AcceptChannelDecodeErrorZ self; +public: + CResult_AcceptChannelDecodeErrorZ(const CResult_AcceptChannelDecodeErrorZ&) = delete; + CResult_AcceptChannelDecodeErrorZ(CResult_AcceptChannelDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_AcceptChannelDecodeErrorZ)); } + CResult_AcceptChannelDecodeErrorZ(LDKCResult_AcceptChannelDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_AcceptChannelDecodeErrorZ)); } + operator LDKCResult_AcceptChannelDecodeErrorZ() && { LDKCResult_AcceptChannelDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_AcceptChannelDecodeErrorZ)); return res; } + ~CResult_AcceptChannelDecodeErrorZ() { CResult_AcceptChannelDecodeErrorZ_free(self); } + CResult_AcceptChannelDecodeErrorZ& operator=(CResult_AcceptChannelDecodeErrorZ&& o) { CResult_AcceptChannelDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_AcceptChannelDecodeErrorZ)); return *this; } + LDKCResult_AcceptChannelDecodeErrorZ* operator &() { return &self; } + LDKCResult_AcceptChannelDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_AcceptChannelDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_AcceptChannelDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_UnsignedChannelAnnouncementDecodeErrorZ { +private: + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ self; +public: + CResult_UnsignedChannelAnnouncementDecodeErrorZ(const CResult_UnsignedChannelAnnouncementDecodeErrorZ&) = delete; + CResult_UnsignedChannelAnnouncementDecodeErrorZ(CResult_UnsignedChannelAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedChannelAnnouncementDecodeErrorZ)); } + CResult_UnsignedChannelAnnouncementDecodeErrorZ(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ)); } + operator LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ() && { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ)); return res; } + ~CResult_UnsignedChannelAnnouncementDecodeErrorZ() { CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(self); } + CResult_UnsignedChannelAnnouncementDecodeErrorZ& operator=(CResult_UnsignedChannelAnnouncementDecodeErrorZ&& o) { CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedChannelAnnouncementDecodeErrorZ)); return *this; } + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator &() { return &self; } + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator ->() const { return &self; } +}; +class C2Tuple_BlockHashChannelManagerZ { +private: + LDKC2Tuple_BlockHashChannelManagerZ self; +public: + C2Tuple_BlockHashChannelManagerZ(const C2Tuple_BlockHashChannelManagerZ&) = delete; + C2Tuple_BlockHashChannelManagerZ(C2Tuple_BlockHashChannelManagerZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_BlockHashChannelManagerZ)); } + C2Tuple_BlockHashChannelManagerZ(LDKC2Tuple_BlockHashChannelManagerZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_BlockHashChannelManagerZ)); } + operator LDKC2Tuple_BlockHashChannelManagerZ() && { LDKC2Tuple_BlockHashChannelManagerZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_BlockHashChannelManagerZ)); return res; } + ~C2Tuple_BlockHashChannelManagerZ() { C2Tuple_BlockHashChannelManagerZ_free(self); } + C2Tuple_BlockHashChannelManagerZ& operator=(C2Tuple_BlockHashChannelManagerZ&& o) { C2Tuple_BlockHashChannelManagerZ_free(self); self = o.self; memset(&o, 0, sizeof(C2Tuple_BlockHashChannelManagerZ)); return *this; } + LDKC2Tuple_BlockHashChannelManagerZ* operator &() { return &self; } + LDKC2Tuple_BlockHashChannelManagerZ* operator ->() { return &self; } + const LDKC2Tuple_BlockHashChannelManagerZ* operator &() const { return &self; } + const LDKC2Tuple_BlockHashChannelManagerZ* operator ->() const { return &self; } +}; +class CResult_ChannelTransactionParametersDecodeErrorZ { +private: + LDKCResult_ChannelTransactionParametersDecodeErrorZ self; +public: + CResult_ChannelTransactionParametersDecodeErrorZ(const CResult_ChannelTransactionParametersDecodeErrorZ&) = delete; + CResult_ChannelTransactionParametersDecodeErrorZ(CResult_ChannelTransactionParametersDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelTransactionParametersDecodeErrorZ)); } + CResult_ChannelTransactionParametersDecodeErrorZ(LDKCResult_ChannelTransactionParametersDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ)); } + operator LDKCResult_ChannelTransactionParametersDecodeErrorZ() && { LDKCResult_ChannelTransactionParametersDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ)); return res; } + ~CResult_ChannelTransactionParametersDecodeErrorZ() { CResult_ChannelTransactionParametersDecodeErrorZ_free(self); } + CResult_ChannelTransactionParametersDecodeErrorZ& operator=(CResult_ChannelTransactionParametersDecodeErrorZ&& o) { CResult_ChannelTransactionParametersDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelTransactionParametersDecodeErrorZ)); return *this; } + LDKCResult_ChannelTransactionParametersDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelTransactionParametersDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelTransactionParametersDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelTransactionParametersDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_HTLCUpdateDecodeErrorZ { +private: + LDKCResult_HTLCUpdateDecodeErrorZ self; +public: + CResult_HTLCUpdateDecodeErrorZ(const CResult_HTLCUpdateDecodeErrorZ&) = delete; + CResult_HTLCUpdateDecodeErrorZ(CResult_HTLCUpdateDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_HTLCUpdateDecodeErrorZ)); } + CResult_HTLCUpdateDecodeErrorZ(LDKCResult_HTLCUpdateDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_HTLCUpdateDecodeErrorZ)); } + operator LDKCResult_HTLCUpdateDecodeErrorZ() && { LDKCResult_HTLCUpdateDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_HTLCUpdateDecodeErrorZ)); return res; } + ~CResult_HTLCUpdateDecodeErrorZ() { CResult_HTLCUpdateDecodeErrorZ_free(self); } + CResult_HTLCUpdateDecodeErrorZ& operator=(CResult_HTLCUpdateDecodeErrorZ&& o) { CResult_HTLCUpdateDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_HTLCUpdateDecodeErrorZ)); return *this; } + LDKCResult_HTLCUpdateDecodeErrorZ* operator &() { return &self; } + LDKCResult_HTLCUpdateDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_HTLCUpdateDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_HTLCUpdateDecodeErrorZ* operator ->() const { return &self; } +}; +class CVec_SignatureZ { +private: + LDKCVec_SignatureZ self; +public: + CVec_SignatureZ(const CVec_SignatureZ&) = delete; + CVec_SignatureZ(CVec_SignatureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_SignatureZ)); } + CVec_SignatureZ(LDKCVec_SignatureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_SignatureZ)); } + operator LDKCVec_SignatureZ() && { LDKCVec_SignatureZ res = self; memset(&self, 0, sizeof(LDKCVec_SignatureZ)); return res; } + ~CVec_SignatureZ() { CVec_SignatureZ_free(self); } + CVec_SignatureZ& operator=(CVec_SignatureZ&& o) { CVec_SignatureZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_SignatureZ)); return *this; } + LDKCVec_SignatureZ* operator &() { return &self; } + LDKCVec_SignatureZ* operator ->() { return &self; } + const LDKCVec_SignatureZ* operator &() const { return &self; } + const LDKCVec_SignatureZ* operator ->() const { return &self; } +}; +class CVec_u64Z { +private: + LDKCVec_u64Z self; +public: + CVec_u64Z(const CVec_u64Z&) = delete; + CVec_u64Z(CVec_u64Z&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_u64Z)); } + CVec_u64Z(LDKCVec_u64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_u64Z)); } + operator LDKCVec_u64Z() && { LDKCVec_u64Z res = self; memset(&self, 0, sizeof(LDKCVec_u64Z)); return res; } + ~CVec_u64Z() { CVec_u64Z_free(self); } + CVec_u64Z& operator=(CVec_u64Z&& o) { CVec_u64Z_free(self); self = o.self; memset(&o, 0, sizeof(CVec_u64Z)); return *this; } + LDKCVec_u64Z* operator &() { return &self; } + LDKCVec_u64Z* operator ->() { return &self; } + const LDKCVec_u64Z* operator &() const { return &self; } + const LDKCVec_u64Z* operator ->() const { return &self; } }; -class C2Tuple_BlockHashChannelManagerZ { +class CResult_ChannelInfoDecodeErrorZ { private: - LDKC2Tuple_BlockHashChannelManagerZ self; + LDKCResult_ChannelInfoDecodeErrorZ self; public: - C2Tuple_BlockHashChannelManagerZ(const C2Tuple_BlockHashChannelManagerZ&) = delete; - C2Tuple_BlockHashChannelManagerZ(C2Tuple_BlockHashChannelManagerZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_BlockHashChannelManagerZ)); } - C2Tuple_BlockHashChannelManagerZ(LDKC2Tuple_BlockHashChannelManagerZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_BlockHashChannelManagerZ)); } - operator LDKC2Tuple_BlockHashChannelManagerZ() && { LDKC2Tuple_BlockHashChannelManagerZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_BlockHashChannelManagerZ)); return res; } - ~C2Tuple_BlockHashChannelManagerZ() { C2Tuple_BlockHashChannelManagerZ_free(self); } - C2Tuple_BlockHashChannelManagerZ& operator=(C2Tuple_BlockHashChannelManagerZ&& o) { C2Tuple_BlockHashChannelManagerZ_free(self); self = o.self; memset(&o, 0, sizeof(C2Tuple_BlockHashChannelManagerZ)); return *this; } - LDKC2Tuple_BlockHashChannelManagerZ* operator &() { return &self; } - LDKC2Tuple_BlockHashChannelManagerZ* operator ->() { return &self; } - const LDKC2Tuple_BlockHashChannelManagerZ* operator &() const { return &self; } - const LDKC2Tuple_BlockHashChannelManagerZ* operator ->() const { return &self; } + CResult_ChannelInfoDecodeErrorZ(const CResult_ChannelInfoDecodeErrorZ&) = delete; + CResult_ChannelInfoDecodeErrorZ(CResult_ChannelInfoDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelInfoDecodeErrorZ)); } + CResult_ChannelInfoDecodeErrorZ(LDKCResult_ChannelInfoDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelInfoDecodeErrorZ)); } + operator LDKCResult_ChannelInfoDecodeErrorZ() && { LDKCResult_ChannelInfoDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelInfoDecodeErrorZ)); return res; } + ~CResult_ChannelInfoDecodeErrorZ() { CResult_ChannelInfoDecodeErrorZ_free(self); } + CResult_ChannelInfoDecodeErrorZ& operator=(CResult_ChannelInfoDecodeErrorZ&& o) { CResult_ChannelInfoDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelInfoDecodeErrorZ)); return *this; } + LDKCResult_ChannelInfoDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelInfoDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelInfoDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelInfoDecodeErrorZ* operator ->() const { return &self; } }; class CVec_C2Tuple_u32TxOutZZ { private: @@ -1646,21 +1751,6 @@ class CVec_C2Tuple_u32TxOutZZ { const LDKCVec_C2Tuple_u32TxOutZZ* operator &() const { return &self; } const LDKCVec_C2Tuple_u32TxOutZZ* operator ->() const { return &self; } }; -class CVec_SignatureZ { -private: - LDKCVec_SignatureZ self; -public: - CVec_SignatureZ(const CVec_SignatureZ&) = delete; - CVec_SignatureZ(CVec_SignatureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_SignatureZ)); } - CVec_SignatureZ(LDKCVec_SignatureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_SignatureZ)); } - operator LDKCVec_SignatureZ() && { LDKCVec_SignatureZ res = self; memset(&self, 0, sizeof(LDKCVec_SignatureZ)); return res; } - ~CVec_SignatureZ() { CVec_SignatureZ_free(self); } - CVec_SignatureZ& operator=(CVec_SignatureZ&& o) { CVec_SignatureZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_SignatureZ)); return *this; } - LDKCVec_SignatureZ* operator &() { return &self; } - LDKCVec_SignatureZ* operator ->() { return &self; } - const LDKCVec_SignatureZ* operator &() const { return &self; } - const LDKCVec_SignatureZ* operator ->() const { return &self; } -}; class C2Tuple_SignatureCVec_SignatureZZ { private: LDKC2Tuple_SignatureCVec_SignatureZZ self; @@ -1676,35 +1766,50 @@ class C2Tuple_SignatureCVec_SignatureZZ { const LDKC2Tuple_SignatureCVec_SignatureZZ* operator &() const { return &self; } const LDKC2Tuple_SignatureCVec_SignatureZZ* operator ->() const { return &self; } }; -class CVec_u64Z { +class CResult_FundingCreatedDecodeErrorZ { private: - LDKCVec_u64Z self; + LDKCResult_FundingCreatedDecodeErrorZ self; public: - CVec_u64Z(const CVec_u64Z&) = delete; - CVec_u64Z(CVec_u64Z&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_u64Z)); } - CVec_u64Z(LDKCVec_u64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_u64Z)); } - operator LDKCVec_u64Z() && { LDKCVec_u64Z res = self; memset(&self, 0, sizeof(LDKCVec_u64Z)); return res; } - ~CVec_u64Z() { CVec_u64Z_free(self); } - CVec_u64Z& operator=(CVec_u64Z&& o) { CVec_u64Z_free(self); self = o.self; memset(&o, 0, sizeof(CVec_u64Z)); return *this; } - LDKCVec_u64Z* operator &() { return &self; } - LDKCVec_u64Z* operator ->() { return &self; } - const LDKCVec_u64Z* operator &() const { return &self; } - const LDKCVec_u64Z* operator ->() const { return &self; } + CResult_FundingCreatedDecodeErrorZ(const CResult_FundingCreatedDecodeErrorZ&) = delete; + CResult_FundingCreatedDecodeErrorZ(CResult_FundingCreatedDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_FundingCreatedDecodeErrorZ)); } + CResult_FundingCreatedDecodeErrorZ(LDKCResult_FundingCreatedDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_FundingCreatedDecodeErrorZ)); } + operator LDKCResult_FundingCreatedDecodeErrorZ() && { LDKCResult_FundingCreatedDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_FundingCreatedDecodeErrorZ)); return res; } + ~CResult_FundingCreatedDecodeErrorZ() { CResult_FundingCreatedDecodeErrorZ_free(self); } + CResult_FundingCreatedDecodeErrorZ& operator=(CResult_FundingCreatedDecodeErrorZ&& o) { CResult_FundingCreatedDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_FundingCreatedDecodeErrorZ)); return *this; } + LDKCResult_FundingCreatedDecodeErrorZ* operator &() { return &self; } + LDKCResult_FundingCreatedDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_FundingCreatedDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_FundingCreatedDecodeErrorZ* operator ->() const { return &self; } }; -class CResult_GossipTimestampFilterDecodeErrorZ { +class CResult_ChannelAnnouncementDecodeErrorZ { private: - LDKCResult_GossipTimestampFilterDecodeErrorZ self; + LDKCResult_ChannelAnnouncementDecodeErrorZ self; public: - CResult_GossipTimestampFilterDecodeErrorZ(const CResult_GossipTimestampFilterDecodeErrorZ&) = delete; - CResult_GossipTimestampFilterDecodeErrorZ(CResult_GossipTimestampFilterDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); } - CResult_GossipTimestampFilterDecodeErrorZ(LDKCResult_GossipTimestampFilterDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); } - operator LDKCResult_GossipTimestampFilterDecodeErrorZ() && { LDKCResult_GossipTimestampFilterDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); return res; } - ~CResult_GossipTimestampFilterDecodeErrorZ() { CResult_GossipTimestampFilterDecodeErrorZ_free(self); } - CResult_GossipTimestampFilterDecodeErrorZ& operator=(CResult_GossipTimestampFilterDecodeErrorZ&& o) { CResult_GossipTimestampFilterDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); return *this; } - LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() { return &self; } - LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() const { return &self; } + CResult_ChannelAnnouncementDecodeErrorZ(const CResult_ChannelAnnouncementDecodeErrorZ&) = delete; + CResult_ChannelAnnouncementDecodeErrorZ(CResult_ChannelAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelAnnouncementDecodeErrorZ)); } + CResult_ChannelAnnouncementDecodeErrorZ(LDKCResult_ChannelAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ)); } + operator LDKCResult_ChannelAnnouncementDecodeErrorZ() && { LDKCResult_ChannelAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ)); return res; } + ~CResult_ChannelAnnouncementDecodeErrorZ() { CResult_ChannelAnnouncementDecodeErrorZ_free(self); } + CResult_ChannelAnnouncementDecodeErrorZ& operator=(CResult_ChannelAnnouncementDecodeErrorZ&& o) { CResult_ChannelAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelAnnouncementDecodeErrorZ)); return *this; } + LDKCResult_ChannelAnnouncementDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelAnnouncementDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelAnnouncementDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelAnnouncementDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_CVec_u8ZPeerHandleErrorZ { +private: + LDKCResult_CVec_u8ZPeerHandleErrorZ self; +public: + CResult_CVec_u8ZPeerHandleErrorZ(const CResult_CVec_u8ZPeerHandleErrorZ&) = delete; + CResult_CVec_u8ZPeerHandleErrorZ(CResult_CVec_u8ZPeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CVec_u8ZPeerHandleErrorZ)); } + CResult_CVec_u8ZPeerHandleErrorZ(LDKCResult_CVec_u8ZPeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); } + operator LDKCResult_CVec_u8ZPeerHandleErrorZ() && { LDKCResult_CVec_u8ZPeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); return res; } + ~CResult_CVec_u8ZPeerHandleErrorZ() { CResult_CVec_u8ZPeerHandleErrorZ_free(self); } + CResult_CVec_u8ZPeerHandleErrorZ& operator=(CResult_CVec_u8ZPeerHandleErrorZ&& o) { CResult_CVec_u8ZPeerHandleErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CVec_u8ZPeerHandleErrorZ)); return *this; } + LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() { return &self; } + LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() { return &self; } + const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() const { return &self; } + const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() const { return &self; } }; class CResult_ChannelMonitorUpdateDecodeErrorZ { private: @@ -1736,20 +1841,20 @@ class CResult_ReplyChannelRangeDecodeErrorZ { const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator &() const { return &self; } const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator ->() const { return &self; } }; -class CResult_CVec_u8ZPeerHandleErrorZ { +class CResult_GossipTimestampFilterDecodeErrorZ { private: - LDKCResult_CVec_u8ZPeerHandleErrorZ self; + LDKCResult_GossipTimestampFilterDecodeErrorZ self; public: - CResult_CVec_u8ZPeerHandleErrorZ(const CResult_CVec_u8ZPeerHandleErrorZ&) = delete; - CResult_CVec_u8ZPeerHandleErrorZ(CResult_CVec_u8ZPeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CVec_u8ZPeerHandleErrorZ)); } - CResult_CVec_u8ZPeerHandleErrorZ(LDKCResult_CVec_u8ZPeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); } - operator LDKCResult_CVec_u8ZPeerHandleErrorZ() && { LDKCResult_CVec_u8ZPeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); return res; } - ~CResult_CVec_u8ZPeerHandleErrorZ() { CResult_CVec_u8ZPeerHandleErrorZ_free(self); } - CResult_CVec_u8ZPeerHandleErrorZ& operator=(CResult_CVec_u8ZPeerHandleErrorZ&& o) { CResult_CVec_u8ZPeerHandleErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CVec_u8ZPeerHandleErrorZ)); return *this; } - LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() { return &self; } - LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() { return &self; } - const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() const { return &self; } - const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() const { return &self; } + CResult_GossipTimestampFilterDecodeErrorZ(const CResult_GossipTimestampFilterDecodeErrorZ&) = delete; + CResult_GossipTimestampFilterDecodeErrorZ(CResult_GossipTimestampFilterDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); } + CResult_GossipTimestampFilterDecodeErrorZ(LDKCResult_GossipTimestampFilterDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); } + operator LDKCResult_GossipTimestampFilterDecodeErrorZ() && { LDKCResult_GossipTimestampFilterDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); return res; } + ~CResult_GossipTimestampFilterDecodeErrorZ() { CResult_GossipTimestampFilterDecodeErrorZ_free(self); } + CResult_GossipTimestampFilterDecodeErrorZ& operator=(CResult_GossipTimestampFilterDecodeErrorZ&& o) { CResult_GossipTimestampFilterDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); return *this; } + LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() { return &self; } + LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() const { return &self; } }; class CResult_TxOutAccessErrorZ { private: @@ -1766,36 +1871,6 @@ class CResult_TxOutAccessErrorZ { const LDKCResult_TxOutAccessErrorZ* operator &() const { return &self; } const LDKCResult_TxOutAccessErrorZ* operator ->() const { return &self; } }; -class CResult_UnsignedNodeAnnouncementDecodeErrorZ { -private: - LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ self; -public: - CResult_UnsignedNodeAnnouncementDecodeErrorZ(const CResult_UnsignedNodeAnnouncementDecodeErrorZ&) = delete; - CResult_UnsignedNodeAnnouncementDecodeErrorZ(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); } - CResult_UnsignedNodeAnnouncementDecodeErrorZ(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); } - operator LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ() && { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); return res; } - ~CResult_UnsignedNodeAnnouncementDecodeErrorZ() { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); } - CResult_UnsignedNodeAnnouncementDecodeErrorZ& operator=(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); return *this; } - LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() { return &self; } - LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() const { return &self; } -}; -class CResult_TxCreationKeysSecpErrorZ { -private: - LDKCResult_TxCreationKeysSecpErrorZ self; -public: - CResult_TxCreationKeysSecpErrorZ(const CResult_TxCreationKeysSecpErrorZ&) = delete; - CResult_TxCreationKeysSecpErrorZ(CResult_TxCreationKeysSecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TxCreationKeysSecpErrorZ)); } - CResult_TxCreationKeysSecpErrorZ(LDKCResult_TxCreationKeysSecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); } - operator LDKCResult_TxCreationKeysSecpErrorZ() && { LDKCResult_TxCreationKeysSecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); return res; } - ~CResult_TxCreationKeysSecpErrorZ() { CResult_TxCreationKeysSecpErrorZ_free(self); } - CResult_TxCreationKeysSecpErrorZ& operator=(CResult_TxCreationKeysSecpErrorZ&& o) { CResult_TxCreationKeysSecpErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_TxCreationKeysSecpErrorZ)); return *this; } - LDKCResult_TxCreationKeysSecpErrorZ* operator &() { return &self; } - LDKCResult_TxCreationKeysSecpErrorZ* operator ->() { return &self; } - const LDKCResult_TxCreationKeysSecpErrorZ* operator &() const { return &self; } - const LDKCResult_TxCreationKeysSecpErrorZ* operator ->() const { return &self; } -}; class CVec_RouteHintZ { private: LDKCVec_RouteHintZ self; @@ -1811,6 +1886,21 @@ class CVec_RouteHintZ { const LDKCVec_RouteHintZ* operator &() const { return &self; } const LDKCVec_RouteHintZ* operator ->() const { return &self; } }; +class CResult_UnsignedNodeAnnouncementDecodeErrorZ { +private: + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ self; +public: + CResult_UnsignedNodeAnnouncementDecodeErrorZ(const CResult_UnsignedNodeAnnouncementDecodeErrorZ&) = delete; + CResult_UnsignedNodeAnnouncementDecodeErrorZ(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); } + CResult_UnsignedNodeAnnouncementDecodeErrorZ(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); } + operator LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ() && { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); return res; } + ~CResult_UnsignedNodeAnnouncementDecodeErrorZ() { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); } + CResult_UnsignedNodeAnnouncementDecodeErrorZ& operator=(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); return *this; } + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() { return &self; } + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_ChannelReestablishDecodeErrorZ { private: LDKCResult_ChannelReestablishDecodeErrorZ self; @@ -1841,20 +1931,50 @@ class CVec_CVec_RouteHopZZ { const LDKCVec_CVec_RouteHopZZ* operator &() const { return &self; } const LDKCVec_CVec_RouteHopZZ* operator ->() const { return &self; } }; -class CVec_UpdateAddHTLCZ { +class CResult_TrustedCommitmentTransactionNoneZ { private: - LDKCVec_UpdateAddHTLCZ self; + LDKCResult_TrustedCommitmentTransactionNoneZ self; public: - CVec_UpdateAddHTLCZ(const CVec_UpdateAddHTLCZ&) = delete; - CVec_UpdateAddHTLCZ(CVec_UpdateAddHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateAddHTLCZ)); } - CVec_UpdateAddHTLCZ(LDKCVec_UpdateAddHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); } - operator LDKCVec_UpdateAddHTLCZ() && { LDKCVec_UpdateAddHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); return res; } - ~CVec_UpdateAddHTLCZ() { CVec_UpdateAddHTLCZ_free(self); } - CVec_UpdateAddHTLCZ& operator=(CVec_UpdateAddHTLCZ&& o) { CVec_UpdateAddHTLCZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_UpdateAddHTLCZ)); return *this; } - LDKCVec_UpdateAddHTLCZ* operator &() { return &self; } - LDKCVec_UpdateAddHTLCZ* operator ->() { return &self; } - const LDKCVec_UpdateAddHTLCZ* operator &() const { return &self; } - const LDKCVec_UpdateAddHTLCZ* operator ->() const { return &self; } + CResult_TrustedCommitmentTransactionNoneZ(const CResult_TrustedCommitmentTransactionNoneZ&) = delete; + CResult_TrustedCommitmentTransactionNoneZ(CResult_TrustedCommitmentTransactionNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TrustedCommitmentTransactionNoneZ)); } + CResult_TrustedCommitmentTransactionNoneZ(LDKCResult_TrustedCommitmentTransactionNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ)); } + operator LDKCResult_TrustedCommitmentTransactionNoneZ() && { LDKCResult_TrustedCommitmentTransactionNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ)); return res; } + ~CResult_TrustedCommitmentTransactionNoneZ() { CResult_TrustedCommitmentTransactionNoneZ_free(self); } + CResult_TrustedCommitmentTransactionNoneZ& operator=(CResult_TrustedCommitmentTransactionNoneZ&& o) { CResult_TrustedCommitmentTransactionNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_TrustedCommitmentTransactionNoneZ)); return *this; } + LDKCResult_TrustedCommitmentTransactionNoneZ* operator &() { return &self; } + LDKCResult_TrustedCommitmentTransactionNoneZ* operator ->() { return &self; } + const LDKCResult_TrustedCommitmentTransactionNoneZ* operator &() const { return &self; } + const LDKCResult_TrustedCommitmentTransactionNoneZ* operator ->() const { return &self; } +}; +class CResult_NonePeerHandleErrorZ { +private: + LDKCResult_NonePeerHandleErrorZ self; +public: + CResult_NonePeerHandleErrorZ(const CResult_NonePeerHandleErrorZ&) = delete; + CResult_NonePeerHandleErrorZ(CResult_NonePeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePeerHandleErrorZ)); } + CResult_NonePeerHandleErrorZ(LDKCResult_NonePeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); } + operator LDKCResult_NonePeerHandleErrorZ() && { LDKCResult_NonePeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); return res; } + ~CResult_NonePeerHandleErrorZ() { CResult_NonePeerHandleErrorZ_free(self); } + CResult_NonePeerHandleErrorZ& operator=(CResult_NonePeerHandleErrorZ&& o) { CResult_NonePeerHandleErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NonePeerHandleErrorZ)); return *this; } + LDKCResult_NonePeerHandleErrorZ* operator &() { return &self; } + LDKCResult_NonePeerHandleErrorZ* operator ->() { return &self; } + const LDKCResult_NonePeerHandleErrorZ* operator &() const { return &self; } + const LDKCResult_NonePeerHandleErrorZ* operator ->() const { return &self; } +}; +class CResult_InitFeaturesDecodeErrorZ { +private: + LDKCResult_InitFeaturesDecodeErrorZ self; +public: + CResult_InitFeaturesDecodeErrorZ(const CResult_InitFeaturesDecodeErrorZ&) = delete; + CResult_InitFeaturesDecodeErrorZ(CResult_InitFeaturesDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_InitFeaturesDecodeErrorZ)); } + CResult_InitFeaturesDecodeErrorZ(LDKCResult_InitFeaturesDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_InitFeaturesDecodeErrorZ)); } + operator LDKCResult_InitFeaturesDecodeErrorZ() && { LDKCResult_InitFeaturesDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_InitFeaturesDecodeErrorZ)); return res; } + ~CResult_InitFeaturesDecodeErrorZ() { CResult_InitFeaturesDecodeErrorZ_free(self); } + CResult_InitFeaturesDecodeErrorZ& operator=(CResult_InitFeaturesDecodeErrorZ&& o) { CResult_InitFeaturesDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_InitFeaturesDecodeErrorZ)); return *this; } + LDKCResult_InitFeaturesDecodeErrorZ* operator &() { return &self; } + LDKCResult_InitFeaturesDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_InitFeaturesDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_InitFeaturesDecodeErrorZ* operator ->() const { return &self; } }; class CResult_NoneLightningErrorZ { private: @@ -1871,35 +1991,35 @@ class CResult_NoneLightningErrorZ { const LDKCResult_NoneLightningErrorZ* operator &() const { return &self; } const LDKCResult_NoneLightningErrorZ* operator ->() const { return &self; } }; -class CResult_NonePeerHandleErrorZ { +class CVec_UpdateAddHTLCZ { private: - LDKCResult_NonePeerHandleErrorZ self; + LDKCVec_UpdateAddHTLCZ self; public: - CResult_NonePeerHandleErrorZ(const CResult_NonePeerHandleErrorZ&) = delete; - CResult_NonePeerHandleErrorZ(CResult_NonePeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePeerHandleErrorZ)); } - CResult_NonePeerHandleErrorZ(LDKCResult_NonePeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); } - operator LDKCResult_NonePeerHandleErrorZ() && { LDKCResult_NonePeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); return res; } - ~CResult_NonePeerHandleErrorZ() { CResult_NonePeerHandleErrorZ_free(self); } - CResult_NonePeerHandleErrorZ& operator=(CResult_NonePeerHandleErrorZ&& o) { CResult_NonePeerHandleErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NonePeerHandleErrorZ)); return *this; } - LDKCResult_NonePeerHandleErrorZ* operator &() { return &self; } - LDKCResult_NonePeerHandleErrorZ* operator ->() { return &self; } - const LDKCResult_NonePeerHandleErrorZ* operator &() const { return &self; } - const LDKCResult_NonePeerHandleErrorZ* operator ->() const { return &self; } + CVec_UpdateAddHTLCZ(const CVec_UpdateAddHTLCZ&) = delete; + CVec_UpdateAddHTLCZ(CVec_UpdateAddHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateAddHTLCZ)); } + CVec_UpdateAddHTLCZ(LDKCVec_UpdateAddHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); } + operator LDKCVec_UpdateAddHTLCZ() && { LDKCVec_UpdateAddHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); return res; } + ~CVec_UpdateAddHTLCZ() { CVec_UpdateAddHTLCZ_free(self); } + CVec_UpdateAddHTLCZ& operator=(CVec_UpdateAddHTLCZ&& o) { CVec_UpdateAddHTLCZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_UpdateAddHTLCZ)); return *this; } + LDKCVec_UpdateAddHTLCZ* operator &() { return &self; } + LDKCVec_UpdateAddHTLCZ* operator ->() { return &self; } + const LDKCVec_UpdateAddHTLCZ* operator &() const { return &self; } + const LDKCVec_UpdateAddHTLCZ* operator ->() const { return &self; } }; -class CResult_TrustedCommitmentTransactionNoneZ { +class CResult_CommitmentSignedDecodeErrorZ { private: - LDKCResult_TrustedCommitmentTransactionNoneZ self; + LDKCResult_CommitmentSignedDecodeErrorZ self; public: - CResult_TrustedCommitmentTransactionNoneZ(const CResult_TrustedCommitmentTransactionNoneZ&) = delete; - CResult_TrustedCommitmentTransactionNoneZ(CResult_TrustedCommitmentTransactionNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TrustedCommitmentTransactionNoneZ)); } - CResult_TrustedCommitmentTransactionNoneZ(LDKCResult_TrustedCommitmentTransactionNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ)); } - operator LDKCResult_TrustedCommitmentTransactionNoneZ() && { LDKCResult_TrustedCommitmentTransactionNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ)); return res; } - ~CResult_TrustedCommitmentTransactionNoneZ() { CResult_TrustedCommitmentTransactionNoneZ_free(self); } - CResult_TrustedCommitmentTransactionNoneZ& operator=(CResult_TrustedCommitmentTransactionNoneZ&& o) { CResult_TrustedCommitmentTransactionNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_TrustedCommitmentTransactionNoneZ)); return *this; } - LDKCResult_TrustedCommitmentTransactionNoneZ* operator &() { return &self; } - LDKCResult_TrustedCommitmentTransactionNoneZ* operator ->() { return &self; } - const LDKCResult_TrustedCommitmentTransactionNoneZ* operator &() const { return &self; } - const LDKCResult_TrustedCommitmentTransactionNoneZ* operator ->() const { return &self; } + CResult_CommitmentSignedDecodeErrorZ(const CResult_CommitmentSignedDecodeErrorZ&) = delete; + CResult_CommitmentSignedDecodeErrorZ(CResult_CommitmentSignedDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CommitmentSignedDecodeErrorZ)); } + CResult_CommitmentSignedDecodeErrorZ(LDKCResult_CommitmentSignedDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CommitmentSignedDecodeErrorZ)); } + operator LDKCResult_CommitmentSignedDecodeErrorZ() && { LDKCResult_CommitmentSignedDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CommitmentSignedDecodeErrorZ)); return res; } + ~CResult_CommitmentSignedDecodeErrorZ() { CResult_CommitmentSignedDecodeErrorZ_free(self); } + CResult_CommitmentSignedDecodeErrorZ& operator=(CResult_CommitmentSignedDecodeErrorZ&& o) { CResult_CommitmentSignedDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CommitmentSignedDecodeErrorZ)); return *this; } + LDKCResult_CommitmentSignedDecodeErrorZ* operator &() { return &self; } + LDKCResult_CommitmentSignedDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_CommitmentSignedDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_CommitmentSignedDecodeErrorZ* operator ->() const { return &self; } }; class CResult_CVec_SignatureZNoneZ { private: @@ -1916,6 +2036,21 @@ class CResult_CVec_SignatureZNoneZ { const LDKCResult_CVec_SignatureZNoneZ* operator &() const { return &self; } const LDKCResult_CVec_SignatureZNoneZ* operator ->() const { return &self; } }; +class CResult_CommitmentTransactionDecodeErrorZ { +private: + LDKCResult_CommitmentTransactionDecodeErrorZ self; +public: + CResult_CommitmentTransactionDecodeErrorZ(const CResult_CommitmentTransactionDecodeErrorZ&) = delete; + CResult_CommitmentTransactionDecodeErrorZ(CResult_CommitmentTransactionDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CommitmentTransactionDecodeErrorZ)); } + CResult_CommitmentTransactionDecodeErrorZ(LDKCResult_CommitmentTransactionDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ)); } + operator LDKCResult_CommitmentTransactionDecodeErrorZ() && { LDKCResult_CommitmentTransactionDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ)); return res; } + ~CResult_CommitmentTransactionDecodeErrorZ() { CResult_CommitmentTransactionDecodeErrorZ_free(self); } + CResult_CommitmentTransactionDecodeErrorZ& operator=(CResult_CommitmentTransactionDecodeErrorZ&& o) { CResult_CommitmentTransactionDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CommitmentTransactionDecodeErrorZ)); return *this; } + LDKCResult_CommitmentTransactionDecodeErrorZ* operator &() { return &self; } + LDKCResult_CommitmentTransactionDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_CommitmentTransactionDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_CommitmentTransactionDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_PingDecodeErrorZ { private: LDKCResult_PingDecodeErrorZ self; @@ -1961,6 +2096,36 @@ class CResult_ErrorMessageDecodeErrorZ { const LDKCResult_ErrorMessageDecodeErrorZ* operator &() const { return &self; } const LDKCResult_ErrorMessageDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_OpenChannelDecodeErrorZ { +private: + LDKCResult_OpenChannelDecodeErrorZ self; +public: + CResult_OpenChannelDecodeErrorZ(const CResult_OpenChannelDecodeErrorZ&) = delete; + CResult_OpenChannelDecodeErrorZ(CResult_OpenChannelDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_OpenChannelDecodeErrorZ)); } + CResult_OpenChannelDecodeErrorZ(LDKCResult_OpenChannelDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_OpenChannelDecodeErrorZ)); } + operator LDKCResult_OpenChannelDecodeErrorZ() && { LDKCResult_OpenChannelDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_OpenChannelDecodeErrorZ)); return res; } + ~CResult_OpenChannelDecodeErrorZ() { CResult_OpenChannelDecodeErrorZ_free(self); } + CResult_OpenChannelDecodeErrorZ& operator=(CResult_OpenChannelDecodeErrorZ&& o) { CResult_OpenChannelDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_OpenChannelDecodeErrorZ)); return *this; } + LDKCResult_OpenChannelDecodeErrorZ* operator &() { return &self; } + LDKCResult_OpenChannelDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_OpenChannelDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_OpenChannelDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_UpdateAddHTLCDecodeErrorZ { +private: + LDKCResult_UpdateAddHTLCDecodeErrorZ self; +public: + CResult_UpdateAddHTLCDecodeErrorZ(const CResult_UpdateAddHTLCDecodeErrorZ&) = delete; + CResult_UpdateAddHTLCDecodeErrorZ(CResult_UpdateAddHTLCDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UpdateAddHTLCDecodeErrorZ)); } + CResult_UpdateAddHTLCDecodeErrorZ(LDKCResult_UpdateAddHTLCDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ)); } + operator LDKCResult_UpdateAddHTLCDecodeErrorZ() && { LDKCResult_UpdateAddHTLCDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ)); return res; } + ~CResult_UpdateAddHTLCDecodeErrorZ() { CResult_UpdateAddHTLCDecodeErrorZ_free(self); } + CResult_UpdateAddHTLCDecodeErrorZ& operator=(CResult_UpdateAddHTLCDecodeErrorZ&& o) { CResult_UpdateAddHTLCDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UpdateAddHTLCDecodeErrorZ)); return *this; } + LDKCResult_UpdateAddHTLCDecodeErrorZ* operator &() { return &self; } + LDKCResult_UpdateAddHTLCDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UpdateAddHTLCDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UpdateAddHTLCDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_QueryShortChannelIdsDecodeErrorZ { private: LDKCResult_QueryShortChannelIdsDecodeErrorZ self; @@ -1976,6 +2141,36 @@ class CResult_QueryShortChannelIdsDecodeErrorZ { const LDKCResult_QueryShortChannelIdsDecodeErrorZ* operator &() const { return &self; } const LDKCResult_QueryShortChannelIdsDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_SecretKeyErrorZ { +private: + LDKCResult_SecretKeyErrorZ self; +public: + CResult_SecretKeyErrorZ(const CResult_SecretKeyErrorZ&) = delete; + CResult_SecretKeyErrorZ(CResult_SecretKeyErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SecretKeyErrorZ)); } + CResult_SecretKeyErrorZ(LDKCResult_SecretKeyErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SecretKeyErrorZ)); } + operator LDKCResult_SecretKeyErrorZ() && { LDKCResult_SecretKeyErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_SecretKeyErrorZ)); return res; } + ~CResult_SecretKeyErrorZ() { CResult_SecretKeyErrorZ_free(self); } + CResult_SecretKeyErrorZ& operator=(CResult_SecretKeyErrorZ&& o) { CResult_SecretKeyErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_SecretKeyErrorZ)); return *this; } + LDKCResult_SecretKeyErrorZ* operator &() { return &self; } + LDKCResult_SecretKeyErrorZ* operator ->() { return &self; } + const LDKCResult_SecretKeyErrorZ* operator &() const { return &self; } + const LDKCResult_SecretKeyErrorZ* operator ->() const { return &self; } +}; +class CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { +private: + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ self; +public: + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ(const CResult_CounterpartyChannelTransactionParametersDecodeErrorZ&) = delete; + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ(CResult_CounterpartyChannelTransactionParametersDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CounterpartyChannelTransactionParametersDecodeErrorZ)); } + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ)); } + operator LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ() && { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ)); return res; } + ~CResult_CounterpartyChannelTransactionParametersDecodeErrorZ() { CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(self); } + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ& operator=(CResult_CounterpartyChannelTransactionParametersDecodeErrorZ&& o) { CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CounterpartyChannelTransactionParametersDecodeErrorZ)); return *this; } + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* operator &() { return &self; } + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_NoneAPIErrorZ { private: LDKCResult_NoneAPIErrorZ self; @@ -1991,35 +2186,80 @@ class CResult_NoneAPIErrorZ { const LDKCResult_NoneAPIErrorZ* operator &() const { return &self; } const LDKCResult_NoneAPIErrorZ* operator ->() const { return &self; } }; -class CResult_QueryChannelRangeDecodeErrorZ { +class CVec_NetAddressZ { private: - LDKCResult_QueryChannelRangeDecodeErrorZ self; + LDKCVec_NetAddressZ self; public: - CResult_QueryChannelRangeDecodeErrorZ(const CResult_QueryChannelRangeDecodeErrorZ&) = delete; - CResult_QueryChannelRangeDecodeErrorZ(CResult_QueryChannelRangeDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_QueryChannelRangeDecodeErrorZ)); } - CResult_QueryChannelRangeDecodeErrorZ(LDKCResult_QueryChannelRangeDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ)); } - operator LDKCResult_QueryChannelRangeDecodeErrorZ() && { LDKCResult_QueryChannelRangeDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ)); return res; } - ~CResult_QueryChannelRangeDecodeErrorZ() { CResult_QueryChannelRangeDecodeErrorZ_free(self); } - CResult_QueryChannelRangeDecodeErrorZ& operator=(CResult_QueryChannelRangeDecodeErrorZ&& o) { CResult_QueryChannelRangeDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_QueryChannelRangeDecodeErrorZ)); return *this; } - LDKCResult_QueryChannelRangeDecodeErrorZ* operator &() { return &self; } - LDKCResult_QueryChannelRangeDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_QueryChannelRangeDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_QueryChannelRangeDecodeErrorZ* operator ->() const { return &self; } + CVec_NetAddressZ(const CVec_NetAddressZ&) = delete; + CVec_NetAddressZ(CVec_NetAddressZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_NetAddressZ)); } + CVec_NetAddressZ(LDKCVec_NetAddressZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_NetAddressZ)); } + operator LDKCVec_NetAddressZ() && { LDKCVec_NetAddressZ res = self; memset(&self, 0, sizeof(LDKCVec_NetAddressZ)); return res; } + ~CVec_NetAddressZ() { CVec_NetAddressZ_free(self); } + CVec_NetAddressZ& operator=(CVec_NetAddressZ&& o) { CVec_NetAddressZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_NetAddressZ)); return *this; } + LDKCVec_NetAddressZ* operator &() { return &self; } + LDKCVec_NetAddressZ* operator ->() { return &self; } + const LDKCVec_NetAddressZ* operator &() const { return &self; } + const LDKCVec_NetAddressZ* operator ->() const { return &self; } +}; +class CVec_TransactionZ { +private: + LDKCVec_TransactionZ self; +public: + CVec_TransactionZ(const CVec_TransactionZ&) = delete; + CVec_TransactionZ(CVec_TransactionZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_TransactionZ)); } + CVec_TransactionZ(LDKCVec_TransactionZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_TransactionZ)); } + operator LDKCVec_TransactionZ() && { LDKCVec_TransactionZ res = self; memset(&self, 0, sizeof(LDKCVec_TransactionZ)); return res; } + ~CVec_TransactionZ() { CVec_TransactionZ_free(self); } + CVec_TransactionZ& operator=(CVec_TransactionZ&& o) { CVec_TransactionZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_TransactionZ)); return *this; } + LDKCVec_TransactionZ* operator &() { return &self; } + LDKCVec_TransactionZ* operator ->() { return &self; } + const LDKCVec_TransactionZ* operator &() const { return &self; } + const LDKCVec_TransactionZ* operator ->() const { return &self; } }; -class CVec_NetAddressZ { +class CResult_TxCreationKeysDecodeErrorZ { private: - LDKCVec_NetAddressZ self; + LDKCResult_TxCreationKeysDecodeErrorZ self; public: - CVec_NetAddressZ(const CVec_NetAddressZ&) = delete; - CVec_NetAddressZ(CVec_NetAddressZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_NetAddressZ)); } - CVec_NetAddressZ(LDKCVec_NetAddressZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_NetAddressZ)); } - operator LDKCVec_NetAddressZ() && { LDKCVec_NetAddressZ res = self; memset(&self, 0, sizeof(LDKCVec_NetAddressZ)); return res; } - ~CVec_NetAddressZ() { CVec_NetAddressZ_free(self); } - CVec_NetAddressZ& operator=(CVec_NetAddressZ&& o) { CVec_NetAddressZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_NetAddressZ)); return *this; } - LDKCVec_NetAddressZ* operator &() { return &self; } - LDKCVec_NetAddressZ* operator ->() { return &self; } - const LDKCVec_NetAddressZ* operator &() const { return &self; } - const LDKCVec_NetAddressZ* operator ->() const { return &self; } + CResult_TxCreationKeysDecodeErrorZ(const CResult_TxCreationKeysDecodeErrorZ&) = delete; + CResult_TxCreationKeysDecodeErrorZ(CResult_TxCreationKeysDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TxCreationKeysDecodeErrorZ)); } + CResult_TxCreationKeysDecodeErrorZ(LDKCResult_TxCreationKeysDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TxCreationKeysDecodeErrorZ)); } + operator LDKCResult_TxCreationKeysDecodeErrorZ() && { LDKCResult_TxCreationKeysDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_TxCreationKeysDecodeErrorZ)); return res; } + ~CResult_TxCreationKeysDecodeErrorZ() { CResult_TxCreationKeysDecodeErrorZ_free(self); } + CResult_TxCreationKeysDecodeErrorZ& operator=(CResult_TxCreationKeysDecodeErrorZ&& o) { CResult_TxCreationKeysDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_TxCreationKeysDecodeErrorZ)); return *this; } + LDKCResult_TxCreationKeysDecodeErrorZ* operator &() { return &self; } + LDKCResult_TxCreationKeysDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_TxCreationKeysDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_TxCreationKeysDecodeErrorZ* operator ->() const { return &self; } +}; +class CVec_PublicKeyZ { +private: + LDKCVec_PublicKeyZ self; +public: + CVec_PublicKeyZ(const CVec_PublicKeyZ&) = delete; + CVec_PublicKeyZ(CVec_PublicKeyZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_PublicKeyZ)); } + CVec_PublicKeyZ(LDKCVec_PublicKeyZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_PublicKeyZ)); } + operator LDKCVec_PublicKeyZ() && { LDKCVec_PublicKeyZ res = self; memset(&self, 0, sizeof(LDKCVec_PublicKeyZ)); return res; } + ~CVec_PublicKeyZ() { CVec_PublicKeyZ_free(self); } + CVec_PublicKeyZ& operator=(CVec_PublicKeyZ&& o) { CVec_PublicKeyZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_PublicKeyZ)); return *this; } + LDKCVec_PublicKeyZ* operator &() { return &self; } + LDKCVec_PublicKeyZ* operator ->() { return &self; } + const LDKCVec_PublicKeyZ* operator &() const { return &self; } + const LDKCVec_PublicKeyZ* operator ->() const { return &self; } +}; +class CResult_ChannelFeaturesDecodeErrorZ { +private: + LDKCResult_ChannelFeaturesDecodeErrorZ self; +public: + CResult_ChannelFeaturesDecodeErrorZ(const CResult_ChannelFeaturesDecodeErrorZ&) = delete; + CResult_ChannelFeaturesDecodeErrorZ(CResult_ChannelFeaturesDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelFeaturesDecodeErrorZ)); } + CResult_ChannelFeaturesDecodeErrorZ(LDKCResult_ChannelFeaturesDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ)); } + operator LDKCResult_ChannelFeaturesDecodeErrorZ() && { LDKCResult_ChannelFeaturesDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ)); return res; } + ~CResult_ChannelFeaturesDecodeErrorZ() { CResult_ChannelFeaturesDecodeErrorZ_free(self); } + CResult_ChannelFeaturesDecodeErrorZ& operator=(CResult_ChannelFeaturesDecodeErrorZ&& o) { CResult_ChannelFeaturesDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelFeaturesDecodeErrorZ)); return *this; } + LDKCResult_ChannelFeaturesDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelFeaturesDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelFeaturesDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelFeaturesDecodeErrorZ* operator ->() const { return &self; } }; class C2Tuple_usizeTransactionZ { private: @@ -2051,21 +2291,6 @@ class CVec_C2Tuple_usizeTransactionZZ { const LDKCVec_C2Tuple_usizeTransactionZZ* operator &() const { return &self; } const LDKCVec_C2Tuple_usizeTransactionZZ* operator ->() const { return &self; } }; -class CVec_TransactionZ { -private: - LDKCVec_TransactionZ self; -public: - CVec_TransactionZ(const CVec_TransactionZ&) = delete; - CVec_TransactionZ(CVec_TransactionZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_TransactionZ)); } - CVec_TransactionZ(LDKCVec_TransactionZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_TransactionZ)); } - operator LDKCVec_TransactionZ() && { LDKCVec_TransactionZ res = self; memset(&self, 0, sizeof(LDKCVec_TransactionZ)); return res; } - ~CVec_TransactionZ() { CVec_TransactionZ_free(self); } - CVec_TransactionZ& operator=(CVec_TransactionZ&& o) { CVec_TransactionZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_TransactionZ)); return *this; } - LDKCVec_TransactionZ* operator &() { return &self; } - LDKCVec_TransactionZ* operator ->() { return &self; } - const LDKCVec_TransactionZ* operator &() const { return &self; } - const LDKCVec_TransactionZ* operator ->() const { return &self; } -}; class CVec_ChannelMonitorZ { private: LDKCVec_ChannelMonitorZ self; @@ -2081,20 +2306,50 @@ class CVec_ChannelMonitorZ { const LDKCVec_ChannelMonitorZ* operator &() const { return &self; } const LDKCVec_ChannelMonitorZ* operator ->() const { return &self; } }; -class CVec_PublicKeyZ { -private: - LDKCVec_PublicKeyZ self; -public: - CVec_PublicKeyZ(const CVec_PublicKeyZ&) = delete; - CVec_PublicKeyZ(CVec_PublicKeyZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_PublicKeyZ)); } - CVec_PublicKeyZ(LDKCVec_PublicKeyZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_PublicKeyZ)); } - operator LDKCVec_PublicKeyZ() && { LDKCVec_PublicKeyZ res = self; memset(&self, 0, sizeof(LDKCVec_PublicKeyZ)); return res; } - ~CVec_PublicKeyZ() { CVec_PublicKeyZ_free(self); } - CVec_PublicKeyZ& operator=(CVec_PublicKeyZ&& o) { CVec_PublicKeyZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_PublicKeyZ)); return *this; } - LDKCVec_PublicKeyZ* operator &() { return &self; } - LDKCVec_PublicKeyZ* operator ->() { return &self; } - const LDKCVec_PublicKeyZ* operator &() const { return &self; } - const LDKCVec_PublicKeyZ* operator ->() const { return &self; } +class CResult_UpdateFeeDecodeErrorZ { +private: + LDKCResult_UpdateFeeDecodeErrorZ self; +public: + CResult_UpdateFeeDecodeErrorZ(const CResult_UpdateFeeDecodeErrorZ&) = delete; + CResult_UpdateFeeDecodeErrorZ(CResult_UpdateFeeDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UpdateFeeDecodeErrorZ)); } + CResult_UpdateFeeDecodeErrorZ(LDKCResult_UpdateFeeDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UpdateFeeDecodeErrorZ)); } + operator LDKCResult_UpdateFeeDecodeErrorZ() && { LDKCResult_UpdateFeeDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UpdateFeeDecodeErrorZ)); return res; } + ~CResult_UpdateFeeDecodeErrorZ() { CResult_UpdateFeeDecodeErrorZ_free(self); } + CResult_UpdateFeeDecodeErrorZ& operator=(CResult_UpdateFeeDecodeErrorZ&& o) { CResult_UpdateFeeDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UpdateFeeDecodeErrorZ)); return *this; } + LDKCResult_UpdateFeeDecodeErrorZ* operator &() { return &self; } + LDKCResult_UpdateFeeDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UpdateFeeDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UpdateFeeDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_DirectionalChannelInfoDecodeErrorZ { +private: + LDKCResult_DirectionalChannelInfoDecodeErrorZ self; +public: + CResult_DirectionalChannelInfoDecodeErrorZ(const CResult_DirectionalChannelInfoDecodeErrorZ&) = delete; + CResult_DirectionalChannelInfoDecodeErrorZ(CResult_DirectionalChannelInfoDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_DirectionalChannelInfoDecodeErrorZ)); } + CResult_DirectionalChannelInfoDecodeErrorZ(LDKCResult_DirectionalChannelInfoDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ)); } + operator LDKCResult_DirectionalChannelInfoDecodeErrorZ() && { LDKCResult_DirectionalChannelInfoDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ)); return res; } + ~CResult_DirectionalChannelInfoDecodeErrorZ() { CResult_DirectionalChannelInfoDecodeErrorZ_free(self); } + CResult_DirectionalChannelInfoDecodeErrorZ& operator=(CResult_DirectionalChannelInfoDecodeErrorZ&& o) { CResult_DirectionalChannelInfoDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_DirectionalChannelInfoDecodeErrorZ)); return *this; } + LDKCResult_DirectionalChannelInfoDecodeErrorZ* operator &() { return &self; } + LDKCResult_DirectionalChannelInfoDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_DirectionalChannelInfoDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_DirectionalChannelInfoDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_NodeAnnouncementDecodeErrorZ { +private: + LDKCResult_NodeAnnouncementDecodeErrorZ self; +public: + CResult_NodeAnnouncementDecodeErrorZ(const CResult_NodeAnnouncementDecodeErrorZ&) = delete; + CResult_NodeAnnouncementDecodeErrorZ(CResult_NodeAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NodeAnnouncementDecodeErrorZ)); } + CResult_NodeAnnouncementDecodeErrorZ(LDKCResult_NodeAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ)); } + operator LDKCResult_NodeAnnouncementDecodeErrorZ() && { LDKCResult_NodeAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ)); return res; } + ~CResult_NodeAnnouncementDecodeErrorZ() { CResult_NodeAnnouncementDecodeErrorZ_free(self); } + CResult_NodeAnnouncementDecodeErrorZ& operator=(CResult_NodeAnnouncementDecodeErrorZ&& o) { CResult_NodeAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NodeAnnouncementDecodeErrorZ)); return *this; } + LDKCResult_NodeAnnouncementDecodeErrorZ* operator &() { return &self; } + LDKCResult_NodeAnnouncementDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_NodeAnnouncementDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_NodeAnnouncementDecodeErrorZ* operator ->() const { return &self; } }; class C2Tuple_u32TxOutZ { private: @@ -2111,6 +2366,36 @@ class C2Tuple_u32TxOutZ { const LDKC2Tuple_u32TxOutZ* operator &() const { return &self; } const LDKC2Tuple_u32TxOutZ* operator ->() const { return &self; } }; +class CResult_QueryChannelRangeDecodeErrorZ { +private: + LDKCResult_QueryChannelRangeDecodeErrorZ self; +public: + CResult_QueryChannelRangeDecodeErrorZ(const CResult_QueryChannelRangeDecodeErrorZ&) = delete; + CResult_QueryChannelRangeDecodeErrorZ(CResult_QueryChannelRangeDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_QueryChannelRangeDecodeErrorZ)); } + CResult_QueryChannelRangeDecodeErrorZ(LDKCResult_QueryChannelRangeDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ)); } + operator LDKCResult_QueryChannelRangeDecodeErrorZ() && { LDKCResult_QueryChannelRangeDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ)); return res; } + ~CResult_QueryChannelRangeDecodeErrorZ() { CResult_QueryChannelRangeDecodeErrorZ_free(self); } + CResult_QueryChannelRangeDecodeErrorZ& operator=(CResult_QueryChannelRangeDecodeErrorZ&& o) { CResult_QueryChannelRangeDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_QueryChannelRangeDecodeErrorZ)); return *this; } + LDKCResult_QueryChannelRangeDecodeErrorZ* operator &() { return &self; } + LDKCResult_QueryChannelRangeDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_QueryChannelRangeDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_QueryChannelRangeDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_HTLCOutputInCommitmentDecodeErrorZ { +private: + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ self; +public: + CResult_HTLCOutputInCommitmentDecodeErrorZ(const CResult_HTLCOutputInCommitmentDecodeErrorZ&) = delete; + CResult_HTLCOutputInCommitmentDecodeErrorZ(CResult_HTLCOutputInCommitmentDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_HTLCOutputInCommitmentDecodeErrorZ)); } + CResult_HTLCOutputInCommitmentDecodeErrorZ(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ)); } + operator LDKCResult_HTLCOutputInCommitmentDecodeErrorZ() && { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ)); return res; } + ~CResult_HTLCOutputInCommitmentDecodeErrorZ() { CResult_HTLCOutputInCommitmentDecodeErrorZ_free(self); } + CResult_HTLCOutputInCommitmentDecodeErrorZ& operator=(CResult_HTLCOutputInCommitmentDecodeErrorZ&& o) { CResult_HTLCOutputInCommitmentDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_HTLCOutputInCommitmentDecodeErrorZ)); return *this; } + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* operator &() { return &self; } + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_boolLightningErrorZ { private: LDKCResult_boolLightningErrorZ self; @@ -2126,6 +2411,21 @@ class CResult_boolLightningErrorZ { const LDKCResult_boolLightningErrorZ* operator &() const { return &self; } const LDKCResult_boolLightningErrorZ* operator ->() const { return &self; } }; +class CResult_TxCreationKeysErrorZ { +private: + LDKCResult_TxCreationKeysErrorZ self; +public: + CResult_TxCreationKeysErrorZ(const CResult_TxCreationKeysErrorZ&) = delete; + CResult_TxCreationKeysErrorZ(CResult_TxCreationKeysErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TxCreationKeysErrorZ)); } + CResult_TxCreationKeysErrorZ(LDKCResult_TxCreationKeysErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TxCreationKeysErrorZ)); } + operator LDKCResult_TxCreationKeysErrorZ() && { LDKCResult_TxCreationKeysErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_TxCreationKeysErrorZ)); return res; } + ~CResult_TxCreationKeysErrorZ() { CResult_TxCreationKeysErrorZ_free(self); } + CResult_TxCreationKeysErrorZ& operator=(CResult_TxCreationKeysErrorZ&& o) { CResult_TxCreationKeysErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_TxCreationKeysErrorZ)); return *this; } + LDKCResult_TxCreationKeysErrorZ* operator &() { return &self; } + LDKCResult_TxCreationKeysErrorZ* operator ->() { return &self; } + const LDKCResult_TxCreationKeysErrorZ* operator &() const { return &self; } + const LDKCResult_TxCreationKeysErrorZ* operator ->() const { return &self; } +}; class C2Tuple_BlockHashChannelMonitorZ { private: LDKC2Tuple_BlockHashChannelMonitorZ self; @@ -2141,20 +2441,20 @@ class C2Tuple_BlockHashChannelMonitorZ { const LDKC2Tuple_BlockHashChannelMonitorZ* operator &() const { return &self; } const LDKC2Tuple_BlockHashChannelMonitorZ* operator ->() const { return &self; } }; -class CResult_SecretKeySecpErrorZ { +class CResult_ChannelConfigDecodeErrorZ { private: - LDKCResult_SecretKeySecpErrorZ self; + LDKCResult_ChannelConfigDecodeErrorZ self; public: - CResult_SecretKeySecpErrorZ(const CResult_SecretKeySecpErrorZ&) = delete; - CResult_SecretKeySecpErrorZ(CResult_SecretKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SecretKeySecpErrorZ)); } - CResult_SecretKeySecpErrorZ(LDKCResult_SecretKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); } - operator LDKCResult_SecretKeySecpErrorZ() && { LDKCResult_SecretKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); return res; } - ~CResult_SecretKeySecpErrorZ() { CResult_SecretKeySecpErrorZ_free(self); } - CResult_SecretKeySecpErrorZ& operator=(CResult_SecretKeySecpErrorZ&& o) { CResult_SecretKeySecpErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_SecretKeySecpErrorZ)); return *this; } - LDKCResult_SecretKeySecpErrorZ* operator &() { return &self; } - LDKCResult_SecretKeySecpErrorZ* operator ->() { return &self; } - const LDKCResult_SecretKeySecpErrorZ* operator &() const { return &self; } - const LDKCResult_SecretKeySecpErrorZ* operator ->() const { return &self; } + CResult_ChannelConfigDecodeErrorZ(const CResult_ChannelConfigDecodeErrorZ&) = delete; + CResult_ChannelConfigDecodeErrorZ(CResult_ChannelConfigDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelConfigDecodeErrorZ)); } + CResult_ChannelConfigDecodeErrorZ(LDKCResult_ChannelConfigDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelConfigDecodeErrorZ)); } + operator LDKCResult_ChannelConfigDecodeErrorZ() && { LDKCResult_ChannelConfigDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelConfigDecodeErrorZ)); return res; } + ~CResult_ChannelConfigDecodeErrorZ() { CResult_ChannelConfigDecodeErrorZ_free(self); } + CResult_ChannelConfigDecodeErrorZ& operator=(CResult_ChannelConfigDecodeErrorZ&& o) { CResult_ChannelConfigDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelConfigDecodeErrorZ)); return *this; } + LDKCResult_ChannelConfigDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelConfigDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelConfigDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelConfigDecodeErrorZ* operator ->() const { return &self; } }; class CResult_NodeAnnouncementInfoDecodeErrorZ { private: @@ -2216,20 +2516,50 @@ class CVec_UpdateFailMalformedHTLCZ { const LDKCVec_UpdateFailMalformedHTLCZ* operator &() const { return &self; } const LDKCVec_UpdateFailMalformedHTLCZ* operator ->() const { return &self; } }; -class CResult_UnsignedChannelUpdateDecodeErrorZ { -private: - LDKCResult_UnsignedChannelUpdateDecodeErrorZ self; -public: - CResult_UnsignedChannelUpdateDecodeErrorZ(const CResult_UnsignedChannelUpdateDecodeErrorZ&) = delete; - CResult_UnsignedChannelUpdateDecodeErrorZ(CResult_UnsignedChannelUpdateDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedChannelUpdateDecodeErrorZ)); } - CResult_UnsignedChannelUpdateDecodeErrorZ(LDKCResult_UnsignedChannelUpdateDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ)); } - operator LDKCResult_UnsignedChannelUpdateDecodeErrorZ() && { LDKCResult_UnsignedChannelUpdateDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ)); return res; } - ~CResult_UnsignedChannelUpdateDecodeErrorZ() { CResult_UnsignedChannelUpdateDecodeErrorZ_free(self); } - CResult_UnsignedChannelUpdateDecodeErrorZ& operator=(CResult_UnsignedChannelUpdateDecodeErrorZ&& o) { CResult_UnsignedChannelUpdateDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedChannelUpdateDecodeErrorZ)); return *this; } - LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator &() { return &self; } - LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator ->() const { return &self; } +class CResult_FundingSignedDecodeErrorZ { +private: + LDKCResult_FundingSignedDecodeErrorZ self; +public: + CResult_FundingSignedDecodeErrorZ(const CResult_FundingSignedDecodeErrorZ&) = delete; + CResult_FundingSignedDecodeErrorZ(CResult_FundingSignedDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_FundingSignedDecodeErrorZ)); } + CResult_FundingSignedDecodeErrorZ(LDKCResult_FundingSignedDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_FundingSignedDecodeErrorZ)); } + operator LDKCResult_FundingSignedDecodeErrorZ() && { LDKCResult_FundingSignedDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_FundingSignedDecodeErrorZ)); return res; } + ~CResult_FundingSignedDecodeErrorZ() { CResult_FundingSignedDecodeErrorZ_free(self); } + CResult_FundingSignedDecodeErrorZ& operator=(CResult_FundingSignedDecodeErrorZ&& o) { CResult_FundingSignedDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_FundingSignedDecodeErrorZ)); return *this; } + LDKCResult_FundingSignedDecodeErrorZ* operator &() { return &self; } + LDKCResult_FundingSignedDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_FundingSignedDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_FundingSignedDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_RevokeAndACKDecodeErrorZ { +private: + LDKCResult_RevokeAndACKDecodeErrorZ self; +public: + CResult_RevokeAndACKDecodeErrorZ(const CResult_RevokeAndACKDecodeErrorZ&) = delete; + CResult_RevokeAndACKDecodeErrorZ(CResult_RevokeAndACKDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RevokeAndACKDecodeErrorZ)); } + CResult_RevokeAndACKDecodeErrorZ(LDKCResult_RevokeAndACKDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RevokeAndACKDecodeErrorZ)); } + operator LDKCResult_RevokeAndACKDecodeErrorZ() && { LDKCResult_RevokeAndACKDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RevokeAndACKDecodeErrorZ)); return res; } + ~CResult_RevokeAndACKDecodeErrorZ() { CResult_RevokeAndACKDecodeErrorZ_free(self); } + CResult_RevokeAndACKDecodeErrorZ& operator=(CResult_RevokeAndACKDecodeErrorZ&& o) { CResult_RevokeAndACKDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_RevokeAndACKDecodeErrorZ)); return *this; } + LDKCResult_RevokeAndACKDecodeErrorZ* operator &() { return &self; } + LDKCResult_RevokeAndACKDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_RevokeAndACKDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_RevokeAndACKDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_ShutdownDecodeErrorZ { +private: + LDKCResult_ShutdownDecodeErrorZ self; +public: + CResult_ShutdownDecodeErrorZ(const CResult_ShutdownDecodeErrorZ&) = delete; + CResult_ShutdownDecodeErrorZ(CResult_ShutdownDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ShutdownDecodeErrorZ)); } + CResult_ShutdownDecodeErrorZ(LDKCResult_ShutdownDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ShutdownDecodeErrorZ)); } + operator LDKCResult_ShutdownDecodeErrorZ() && { LDKCResult_ShutdownDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ShutdownDecodeErrorZ)); return res; } + ~CResult_ShutdownDecodeErrorZ() { CResult_ShutdownDecodeErrorZ_free(self); } + CResult_ShutdownDecodeErrorZ& operator=(CResult_ShutdownDecodeErrorZ&& o) { CResult_ShutdownDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ShutdownDecodeErrorZ)); return *this; } + LDKCResult_ShutdownDecodeErrorZ* operator &() { return &self; } + LDKCResult_ShutdownDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ShutdownDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ShutdownDecodeErrorZ* operator ->() const { return &self; } }; class CVec_EventZ { private: @@ -2261,6 +2591,21 @@ class CResult_NetworkGraphDecodeErrorZ { const LDKCResult_NetworkGraphDecodeErrorZ* operator &() const { return &self; } const LDKCResult_NetworkGraphDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_UpdateFailHTLCDecodeErrorZ { +private: + LDKCResult_UpdateFailHTLCDecodeErrorZ self; +public: + CResult_UpdateFailHTLCDecodeErrorZ(const CResult_UpdateFailHTLCDecodeErrorZ&) = delete; + CResult_UpdateFailHTLCDecodeErrorZ(CResult_UpdateFailHTLCDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UpdateFailHTLCDecodeErrorZ)); } + CResult_UpdateFailHTLCDecodeErrorZ(LDKCResult_UpdateFailHTLCDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ)); } + operator LDKCResult_UpdateFailHTLCDecodeErrorZ() && { LDKCResult_UpdateFailHTLCDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ)); return res; } + ~CResult_UpdateFailHTLCDecodeErrorZ() { CResult_UpdateFailHTLCDecodeErrorZ_free(self); } + CResult_UpdateFailHTLCDecodeErrorZ& operator=(CResult_UpdateFailHTLCDecodeErrorZ&& o) { CResult_UpdateFailHTLCDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UpdateFailHTLCDecodeErrorZ)); return *this; } + LDKCResult_UpdateFailHTLCDecodeErrorZ* operator &() { return &self; } + LDKCResult_UpdateFailHTLCDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UpdateFailHTLCDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UpdateFailHTLCDecodeErrorZ* operator ->() const { return &self; } +}; class CVec_MonitorEventZ { private: LDKCVec_MonitorEventZ self; @@ -2276,21 +2621,6 @@ class CVec_MonitorEventZ { const LDKCVec_MonitorEventZ* operator &() const { return &self; } const LDKCVec_MonitorEventZ* operator ->() const { return &self; } }; -class CResult_ChanKeySignerDecodeErrorZ { -private: - LDKCResult_ChanKeySignerDecodeErrorZ self; -public: - CResult_ChanKeySignerDecodeErrorZ(const CResult_ChanKeySignerDecodeErrorZ&) = delete; - CResult_ChanKeySignerDecodeErrorZ(CResult_ChanKeySignerDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChanKeySignerDecodeErrorZ)); } - CResult_ChanKeySignerDecodeErrorZ(LDKCResult_ChanKeySignerDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChanKeySignerDecodeErrorZ)); } - operator LDKCResult_ChanKeySignerDecodeErrorZ() && { LDKCResult_ChanKeySignerDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChanKeySignerDecodeErrorZ)); return res; } - ~CResult_ChanKeySignerDecodeErrorZ() { CResult_ChanKeySignerDecodeErrorZ_free(self); } - CResult_ChanKeySignerDecodeErrorZ& operator=(CResult_ChanKeySignerDecodeErrorZ&& o) { CResult_ChanKeySignerDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChanKeySignerDecodeErrorZ)); return *this; } - LDKCResult_ChanKeySignerDecodeErrorZ* operator &() { return &self; } - LDKCResult_ChanKeySignerDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_ChanKeySignerDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_ChanKeySignerDecodeErrorZ* operator ->() const { return &self; } -}; class CVec_RouteHopZ { private: LDKCVec_RouteHopZ self; @@ -2306,6 +2636,21 @@ class CVec_RouteHopZ { const LDKCVec_RouteHopZ* operator &() const { return &self; } const LDKCVec_RouteHopZ* operator ->() const { return &self; } }; +class CResult_UnsignedChannelUpdateDecodeErrorZ { +private: + LDKCResult_UnsignedChannelUpdateDecodeErrorZ self; +public: + CResult_UnsignedChannelUpdateDecodeErrorZ(const CResult_UnsignedChannelUpdateDecodeErrorZ&) = delete; + CResult_UnsignedChannelUpdateDecodeErrorZ(CResult_UnsignedChannelUpdateDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedChannelUpdateDecodeErrorZ)); } + CResult_UnsignedChannelUpdateDecodeErrorZ(LDKCResult_UnsignedChannelUpdateDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ)); } + operator LDKCResult_UnsignedChannelUpdateDecodeErrorZ() && { LDKCResult_UnsignedChannelUpdateDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ)); return res; } + ~CResult_UnsignedChannelUpdateDecodeErrorZ() { CResult_UnsignedChannelUpdateDecodeErrorZ_free(self); } + CResult_UnsignedChannelUpdateDecodeErrorZ& operator=(CResult_UnsignedChannelUpdateDecodeErrorZ&& o) { CResult_UnsignedChannelUpdateDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedChannelUpdateDecodeErrorZ)); return *this; } + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator &() { return &self; } + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UnsignedChannelUpdateDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_NoneChannelMonitorUpdateErrZ { private: LDKCResult_NoneChannelMonitorUpdateErrZ self; @@ -2321,21 +2666,6 @@ class CResult_NoneChannelMonitorUpdateErrZ { const LDKCResult_NoneChannelMonitorUpdateErrZ* operator &() const { return &self; } const LDKCResult_NoneChannelMonitorUpdateErrZ* operator ->() const { return &self; } }; -class CResult_NonePaymentSendFailureZ { -private: - LDKCResult_NonePaymentSendFailureZ self; -public: - CResult_NonePaymentSendFailureZ(const CResult_NonePaymentSendFailureZ&) = delete; - CResult_NonePaymentSendFailureZ(CResult_NonePaymentSendFailureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePaymentSendFailureZ)); } - CResult_NonePaymentSendFailureZ(LDKCResult_NonePaymentSendFailureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); } - operator LDKCResult_NonePaymentSendFailureZ() && { LDKCResult_NonePaymentSendFailureZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); return res; } - ~CResult_NonePaymentSendFailureZ() { CResult_NonePaymentSendFailureZ_free(self); } - CResult_NonePaymentSendFailureZ& operator=(CResult_NonePaymentSendFailureZ&& o) { CResult_NonePaymentSendFailureZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NonePaymentSendFailureZ)); return *this; } - LDKCResult_NonePaymentSendFailureZ* operator &() { return &self; } - LDKCResult_NonePaymentSendFailureZ* operator ->() { return &self; } - const LDKCResult_NonePaymentSendFailureZ* operator &() const { return &self; } - const LDKCResult_NonePaymentSendFailureZ* operator ->() const { return &self; } -}; class CResult_NodeInfoDecodeErrorZ { private: LDKCResult_NodeInfoDecodeErrorZ self; @@ -2351,6 +2681,21 @@ class CResult_NodeInfoDecodeErrorZ { const LDKCResult_NodeInfoDecodeErrorZ* operator &() const { return &self; } const LDKCResult_NodeInfoDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_NonePaymentSendFailureZ { +private: + LDKCResult_NonePaymentSendFailureZ self; +public: + CResult_NonePaymentSendFailureZ(const CResult_NonePaymentSendFailureZ&) = delete; + CResult_NonePaymentSendFailureZ(CResult_NonePaymentSendFailureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePaymentSendFailureZ)); } + CResult_NonePaymentSendFailureZ(LDKCResult_NonePaymentSendFailureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); } + operator LDKCResult_NonePaymentSendFailureZ() && { LDKCResult_NonePaymentSendFailureZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); return res; } + ~CResult_NonePaymentSendFailureZ() { CResult_NonePaymentSendFailureZ_free(self); } + CResult_NonePaymentSendFailureZ& operator=(CResult_NonePaymentSendFailureZ&& o) { CResult_NonePaymentSendFailureZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NonePaymentSendFailureZ)); return *this; } + LDKCResult_NonePaymentSendFailureZ* operator &() { return &self; } + LDKCResult_NonePaymentSendFailureZ* operator ->() { return &self; } + const LDKCResult_NonePaymentSendFailureZ* operator &() const { return &self; } + const LDKCResult_NonePaymentSendFailureZ* operator ->() const { return &self; } +}; class CVec_u8Z { private: LDKCVec_u8Z self; @@ -2366,35 +2711,35 @@ class CVec_u8Z { const LDKCVec_u8Z* operator &() const { return &self; } const LDKCVec_u8Z* operator ->() const { return &self; } }; -class CResult_PublicKeySecpErrorZ { +class CResult_PublicKeyErrorZ { private: - LDKCResult_PublicKeySecpErrorZ self; + LDKCResult_PublicKeyErrorZ self; public: - CResult_PublicKeySecpErrorZ(const CResult_PublicKeySecpErrorZ&) = delete; - CResult_PublicKeySecpErrorZ(CResult_PublicKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PublicKeySecpErrorZ)); } - CResult_PublicKeySecpErrorZ(LDKCResult_PublicKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); } - operator LDKCResult_PublicKeySecpErrorZ() && { LDKCResult_PublicKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); return res; } - ~CResult_PublicKeySecpErrorZ() { CResult_PublicKeySecpErrorZ_free(self); } - CResult_PublicKeySecpErrorZ& operator=(CResult_PublicKeySecpErrorZ&& o) { CResult_PublicKeySecpErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PublicKeySecpErrorZ)); return *this; } - LDKCResult_PublicKeySecpErrorZ* operator &() { return &self; } - LDKCResult_PublicKeySecpErrorZ* operator ->() { return &self; } - const LDKCResult_PublicKeySecpErrorZ* operator &() const { return &self; } - const LDKCResult_PublicKeySecpErrorZ* operator ->() const { return &self; } + CResult_PublicKeyErrorZ(const CResult_PublicKeyErrorZ&) = delete; + CResult_PublicKeyErrorZ(CResult_PublicKeyErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PublicKeyErrorZ)); } + CResult_PublicKeyErrorZ(LDKCResult_PublicKeyErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PublicKeyErrorZ)); } + operator LDKCResult_PublicKeyErrorZ() && { LDKCResult_PublicKeyErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PublicKeyErrorZ)); return res; } + ~CResult_PublicKeyErrorZ() { CResult_PublicKeyErrorZ_free(self); } + CResult_PublicKeyErrorZ& operator=(CResult_PublicKeyErrorZ&& o) { CResult_PublicKeyErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PublicKeyErrorZ)); return *this; } + LDKCResult_PublicKeyErrorZ* operator &() { return &self; } + LDKCResult_PublicKeyErrorZ* operator ->() { return &self; } + const LDKCResult_PublicKeyErrorZ* operator &() const { return &self; } + const LDKCResult_PublicKeyErrorZ* operator ->() const { return &self; } }; -class CResult_RouteLightningErrorZ { +class CResult_ChannelPublicKeysDecodeErrorZ { private: - LDKCResult_RouteLightningErrorZ self; + LDKCResult_ChannelPublicKeysDecodeErrorZ self; public: - CResult_RouteLightningErrorZ(const CResult_RouteLightningErrorZ&) = delete; - CResult_RouteLightningErrorZ(CResult_RouteLightningErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RouteLightningErrorZ)); } - CResult_RouteLightningErrorZ(LDKCResult_RouteLightningErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); } - operator LDKCResult_RouteLightningErrorZ() && { LDKCResult_RouteLightningErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); return res; } - ~CResult_RouteLightningErrorZ() { CResult_RouteLightningErrorZ_free(self); } - CResult_RouteLightningErrorZ& operator=(CResult_RouteLightningErrorZ&& o) { CResult_RouteLightningErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_RouteLightningErrorZ)); return *this; } - LDKCResult_RouteLightningErrorZ* operator &() { return &self; } - LDKCResult_RouteLightningErrorZ* operator ->() { return &self; } - const LDKCResult_RouteLightningErrorZ* operator &() const { return &self; } - const LDKCResult_RouteLightningErrorZ* operator ->() const { return &self; } + CResult_ChannelPublicKeysDecodeErrorZ(const CResult_ChannelPublicKeysDecodeErrorZ&) = delete; + CResult_ChannelPublicKeysDecodeErrorZ(CResult_ChannelPublicKeysDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelPublicKeysDecodeErrorZ)); } + CResult_ChannelPublicKeysDecodeErrorZ(LDKCResult_ChannelPublicKeysDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ)); } + operator LDKCResult_ChannelPublicKeysDecodeErrorZ() && { LDKCResult_ChannelPublicKeysDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ)); return res; } + ~CResult_ChannelPublicKeysDecodeErrorZ() { CResult_ChannelPublicKeysDecodeErrorZ_free(self); } + CResult_ChannelPublicKeysDecodeErrorZ& operator=(CResult_ChannelPublicKeysDecodeErrorZ&& o) { CResult_ChannelPublicKeysDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelPublicKeysDecodeErrorZ)); return *this; } + LDKCResult_ChannelPublicKeysDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelPublicKeysDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelPublicKeysDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelPublicKeysDecodeErrorZ* operator ->() const { return &self; } }; class C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { private: @@ -2411,6 +2756,21 @@ class C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator &() const { return &self; } const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator ->() const { return &self; } }; +class CResult_RouteLightningErrorZ { +private: + LDKCResult_RouteLightningErrorZ self; +public: + CResult_RouteLightningErrorZ(const CResult_RouteLightningErrorZ&) = delete; + CResult_RouteLightningErrorZ(CResult_RouteLightningErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RouteLightningErrorZ)); } + CResult_RouteLightningErrorZ(LDKCResult_RouteLightningErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); } + operator LDKCResult_RouteLightningErrorZ() && { LDKCResult_RouteLightningErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); return res; } + ~CResult_RouteLightningErrorZ() { CResult_RouteLightningErrorZ_free(self); } + CResult_RouteLightningErrorZ& operator=(CResult_RouteLightningErrorZ&& o) { CResult_RouteLightningErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_RouteLightningErrorZ)); return *this; } + LDKCResult_RouteLightningErrorZ* operator &() { return &self; } + LDKCResult_RouteLightningErrorZ* operator ->() { return &self; } + const LDKCResult_RouteLightningErrorZ* operator &() const { return &self; } + const LDKCResult_RouteLightningErrorZ* operator ->() const { return &self; } +}; class CResult_boolPeerHandleErrorZ { private: LDKCResult_boolPeerHandleErrorZ self; @@ -2426,6 +2786,51 @@ class CResult_boolPeerHandleErrorZ { const LDKCResult_boolPeerHandleErrorZ* operator &() const { return &self; } const LDKCResult_boolPeerHandleErrorZ* operator ->() const { return &self; } }; +class CResult_ClosingSignedDecodeErrorZ { +private: + LDKCResult_ClosingSignedDecodeErrorZ self; +public: + CResult_ClosingSignedDecodeErrorZ(const CResult_ClosingSignedDecodeErrorZ&) = delete; + CResult_ClosingSignedDecodeErrorZ(CResult_ClosingSignedDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ClosingSignedDecodeErrorZ)); } + CResult_ClosingSignedDecodeErrorZ(LDKCResult_ClosingSignedDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ClosingSignedDecodeErrorZ)); } + operator LDKCResult_ClosingSignedDecodeErrorZ() && { LDKCResult_ClosingSignedDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ClosingSignedDecodeErrorZ)); return res; } + ~CResult_ClosingSignedDecodeErrorZ() { CResult_ClosingSignedDecodeErrorZ_free(self); } + CResult_ClosingSignedDecodeErrorZ& operator=(CResult_ClosingSignedDecodeErrorZ&& o) { CResult_ClosingSignedDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ClosingSignedDecodeErrorZ)); return *this; } + LDKCResult_ClosingSignedDecodeErrorZ* operator &() { return &self; } + LDKCResult_ClosingSignedDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ClosingSignedDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ClosingSignedDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_ChannelUpdateDecodeErrorZ { +private: + LDKCResult_ChannelUpdateDecodeErrorZ self; +public: + CResult_ChannelUpdateDecodeErrorZ(const CResult_ChannelUpdateDecodeErrorZ&) = delete; + CResult_ChannelUpdateDecodeErrorZ(CResult_ChannelUpdateDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelUpdateDecodeErrorZ)); } + CResult_ChannelUpdateDecodeErrorZ(LDKCResult_ChannelUpdateDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelUpdateDecodeErrorZ)); } + operator LDKCResult_ChannelUpdateDecodeErrorZ() && { LDKCResult_ChannelUpdateDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelUpdateDecodeErrorZ)); return res; } + ~CResult_ChannelUpdateDecodeErrorZ() { CResult_ChannelUpdateDecodeErrorZ_free(self); } + CResult_ChannelUpdateDecodeErrorZ& operator=(CResult_ChannelUpdateDecodeErrorZ&& o) { CResult_ChannelUpdateDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelUpdateDecodeErrorZ)); return *this; } + LDKCResult_ChannelUpdateDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelUpdateDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelUpdateDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelUpdateDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_HolderCommitmentTransactionDecodeErrorZ { +private: + LDKCResult_HolderCommitmentTransactionDecodeErrorZ self; +public: + CResult_HolderCommitmentTransactionDecodeErrorZ(const CResult_HolderCommitmentTransactionDecodeErrorZ&) = delete; + CResult_HolderCommitmentTransactionDecodeErrorZ(CResult_HolderCommitmentTransactionDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_HolderCommitmentTransactionDecodeErrorZ)); } + CResult_HolderCommitmentTransactionDecodeErrorZ(LDKCResult_HolderCommitmentTransactionDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ)); } + operator LDKCResult_HolderCommitmentTransactionDecodeErrorZ() && { LDKCResult_HolderCommitmentTransactionDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ)); return res; } + ~CResult_HolderCommitmentTransactionDecodeErrorZ() { CResult_HolderCommitmentTransactionDecodeErrorZ_free(self); } + CResult_HolderCommitmentTransactionDecodeErrorZ& operator=(CResult_HolderCommitmentTransactionDecodeErrorZ&& o) { CResult_HolderCommitmentTransactionDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_HolderCommitmentTransactionDecodeErrorZ)); return *this; } + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* operator &() { return &self; } + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_HolderCommitmentTransactionDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_HolderCommitmentTransactionDecodeErrorZ* operator ->() const { return &self; } +}; class CVec_UpdateFulfillHTLCZ { private: LDKCVec_UpdateFulfillHTLCZ self; @@ -2471,6 +2876,36 @@ class C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { const LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator &() const { return &self; } const LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator ->() const { return &self; } }; +class CResult_ChannelKeysDecodeErrorZ { +private: + LDKCResult_ChannelKeysDecodeErrorZ self; +public: + CResult_ChannelKeysDecodeErrorZ(const CResult_ChannelKeysDecodeErrorZ&) = delete; + CResult_ChannelKeysDecodeErrorZ(CResult_ChannelKeysDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelKeysDecodeErrorZ)); } + CResult_ChannelKeysDecodeErrorZ(LDKCResult_ChannelKeysDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelKeysDecodeErrorZ)); } + operator LDKCResult_ChannelKeysDecodeErrorZ() && { LDKCResult_ChannelKeysDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelKeysDecodeErrorZ)); return res; } + ~CResult_ChannelKeysDecodeErrorZ() { CResult_ChannelKeysDecodeErrorZ_free(self); } + CResult_ChannelKeysDecodeErrorZ& operator=(CResult_ChannelKeysDecodeErrorZ&& o) { CResult_ChannelKeysDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelKeysDecodeErrorZ)); return *this; } + LDKCResult_ChannelKeysDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelKeysDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelKeysDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelKeysDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_AnnouncementSignaturesDecodeErrorZ { +private: + LDKCResult_AnnouncementSignaturesDecodeErrorZ self; +public: + CResult_AnnouncementSignaturesDecodeErrorZ(const CResult_AnnouncementSignaturesDecodeErrorZ&) = delete; + CResult_AnnouncementSignaturesDecodeErrorZ(CResult_AnnouncementSignaturesDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_AnnouncementSignaturesDecodeErrorZ)); } + CResult_AnnouncementSignaturesDecodeErrorZ(LDKCResult_AnnouncementSignaturesDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ)); } + operator LDKCResult_AnnouncementSignaturesDecodeErrorZ() && { LDKCResult_AnnouncementSignaturesDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ)); return res; } + ~CResult_AnnouncementSignaturesDecodeErrorZ() { CResult_AnnouncementSignaturesDecodeErrorZ_free(self); } + CResult_AnnouncementSignaturesDecodeErrorZ& operator=(CResult_AnnouncementSignaturesDecodeErrorZ&& o) { CResult_AnnouncementSignaturesDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_AnnouncementSignaturesDecodeErrorZ)); return *this; } + LDKCResult_AnnouncementSignaturesDecodeErrorZ* operator &() { return &self; } + LDKCResult_AnnouncementSignaturesDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_AnnouncementSignaturesDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_AnnouncementSignaturesDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_InitDecodeErrorZ { private: LDKCResult_InitDecodeErrorZ self; @@ -2486,6 +2921,36 @@ class CResult_InitDecodeErrorZ { const LDKCResult_InitDecodeErrorZ* operator &() const { return &self; } const LDKCResult_InitDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_NodeFeaturesDecodeErrorZ { +private: + LDKCResult_NodeFeaturesDecodeErrorZ self; +public: + CResult_NodeFeaturesDecodeErrorZ(const CResult_NodeFeaturesDecodeErrorZ&) = delete; + CResult_NodeFeaturesDecodeErrorZ(CResult_NodeFeaturesDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NodeFeaturesDecodeErrorZ)); } + CResult_NodeFeaturesDecodeErrorZ(LDKCResult_NodeFeaturesDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NodeFeaturesDecodeErrorZ)); } + operator LDKCResult_NodeFeaturesDecodeErrorZ() && { LDKCResult_NodeFeaturesDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NodeFeaturesDecodeErrorZ)); return res; } + ~CResult_NodeFeaturesDecodeErrorZ() { CResult_NodeFeaturesDecodeErrorZ_free(self); } + CResult_NodeFeaturesDecodeErrorZ& operator=(CResult_NodeFeaturesDecodeErrorZ&& o) { CResult_NodeFeaturesDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NodeFeaturesDecodeErrorZ)); return *this; } + LDKCResult_NodeFeaturesDecodeErrorZ* operator &() { return &self; } + LDKCResult_NodeFeaturesDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_NodeFeaturesDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_NodeFeaturesDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_UpdateFulfillHTLCDecodeErrorZ { +private: + LDKCResult_UpdateFulfillHTLCDecodeErrorZ self; +public: + CResult_UpdateFulfillHTLCDecodeErrorZ(const CResult_UpdateFulfillHTLCDecodeErrorZ&) = delete; + CResult_UpdateFulfillHTLCDecodeErrorZ(CResult_UpdateFulfillHTLCDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UpdateFulfillHTLCDecodeErrorZ)); } + CResult_UpdateFulfillHTLCDecodeErrorZ(LDKCResult_UpdateFulfillHTLCDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ)); } + operator LDKCResult_UpdateFulfillHTLCDecodeErrorZ() && { LDKCResult_UpdateFulfillHTLCDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ)); return res; } + ~CResult_UpdateFulfillHTLCDecodeErrorZ() { CResult_UpdateFulfillHTLCDecodeErrorZ_free(self); } + CResult_UpdateFulfillHTLCDecodeErrorZ& operator=(CResult_UpdateFulfillHTLCDecodeErrorZ&& o) { CResult_UpdateFulfillHTLCDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UpdateFulfillHTLCDecodeErrorZ)); return *this; } + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* operator &() { return &self; } + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UpdateFulfillHTLCDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UpdateFulfillHTLCDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_ReplyShortChannelIdsEndDecodeErrorZ { private: LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ self; @@ -2501,20 +2966,20 @@ class CResult_ReplyShortChannelIdsEndDecodeErrorZ { const LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* operator &() const { return &self; } const LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* operator ->() const { return &self; } }; -class CResult_CResult_NetAddressu8ZDecodeErrorZ { +class CResult_OutPointDecodeErrorZ { private: - LDKCResult_CResult_NetAddressu8ZDecodeErrorZ self; + LDKCResult_OutPointDecodeErrorZ self; public: - CResult_CResult_NetAddressu8ZDecodeErrorZ(const CResult_CResult_NetAddressu8ZDecodeErrorZ&) = delete; - CResult_CResult_NetAddressu8ZDecodeErrorZ(CResult_CResult_NetAddressu8ZDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CResult_NetAddressu8ZDecodeErrorZ)); } - CResult_CResult_NetAddressu8ZDecodeErrorZ(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ)); } - operator LDKCResult_CResult_NetAddressu8ZDecodeErrorZ() && { LDKCResult_CResult_NetAddressu8ZDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ)); return res; } - ~CResult_CResult_NetAddressu8ZDecodeErrorZ() { CResult_CResult_NetAddressu8ZDecodeErrorZ_free(self); } - CResult_CResult_NetAddressu8ZDecodeErrorZ& operator=(CResult_CResult_NetAddressu8ZDecodeErrorZ&& o) { CResult_CResult_NetAddressu8ZDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CResult_NetAddressu8ZDecodeErrorZ)); return *this; } - LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator &() { return &self; } - LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator ->() const { return &self; } + CResult_OutPointDecodeErrorZ(const CResult_OutPointDecodeErrorZ&) = delete; + CResult_OutPointDecodeErrorZ(CResult_OutPointDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_OutPointDecodeErrorZ)); } + CResult_OutPointDecodeErrorZ(LDKCResult_OutPointDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_OutPointDecodeErrorZ)); } + operator LDKCResult_OutPointDecodeErrorZ() && { LDKCResult_OutPointDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_OutPointDecodeErrorZ)); return res; } + ~CResult_OutPointDecodeErrorZ() { CResult_OutPointDecodeErrorZ_free(self); } + CResult_OutPointDecodeErrorZ& operator=(CResult_OutPointDecodeErrorZ&& o) { CResult_OutPointDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_OutPointDecodeErrorZ)); return *this; } + LDKCResult_OutPointDecodeErrorZ* operator &() { return &self; } + LDKCResult_OutPointDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_OutPointDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_OutPointDecodeErrorZ* operator ->() const { return &self; } }; class CVec_ChannelDetailsZ { private: @@ -2531,6 +2996,21 @@ class CVec_ChannelDetailsZ { const LDKCVec_ChannelDetailsZ* operator &() const { return &self; } const LDKCVec_ChannelDetailsZ* operator ->() const { return &self; } }; +class CResult_CResult_NetAddressu8ZDecodeErrorZ { +private: + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ self; +public: + CResult_CResult_NetAddressu8ZDecodeErrorZ(const CResult_CResult_NetAddressu8ZDecodeErrorZ&) = delete; + CResult_CResult_NetAddressu8ZDecodeErrorZ(CResult_CResult_NetAddressu8ZDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CResult_NetAddressu8ZDecodeErrorZ)); } + CResult_CResult_NetAddressu8ZDecodeErrorZ(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ)); } + operator LDKCResult_CResult_NetAddressu8ZDecodeErrorZ() && { LDKCResult_CResult_NetAddressu8ZDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ)); return res; } + ~CResult_CResult_NetAddressu8ZDecodeErrorZ() { CResult_CResult_NetAddressu8ZDecodeErrorZ_free(self); } + CResult_CResult_NetAddressu8ZDecodeErrorZ& operator=(CResult_CResult_NetAddressu8ZDecodeErrorZ&& o) { CResult_CResult_NetAddressu8ZDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CResult_NetAddressu8ZDecodeErrorZ)); return *this; } + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator &() { return &self; } + LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* operator ->() const { return &self; } +}; class CVec_MessageSendEventZ { private: LDKCVec_MessageSendEventZ self; @@ -2576,6 +3056,21 @@ class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() const { return &self; } const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_BuiltCommitmentTransactionDecodeErrorZ { +private: + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ self; +public: + CResult_BuiltCommitmentTransactionDecodeErrorZ(const CResult_BuiltCommitmentTransactionDecodeErrorZ&) = delete; + CResult_BuiltCommitmentTransactionDecodeErrorZ(CResult_BuiltCommitmentTransactionDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_BuiltCommitmentTransactionDecodeErrorZ)); } + CResult_BuiltCommitmentTransactionDecodeErrorZ(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ)); } + operator LDKCResult_BuiltCommitmentTransactionDecodeErrorZ() && { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ)); return res; } + ~CResult_BuiltCommitmentTransactionDecodeErrorZ() { CResult_BuiltCommitmentTransactionDecodeErrorZ_free(self); } + CResult_BuiltCommitmentTransactionDecodeErrorZ& operator=(CResult_BuiltCommitmentTransactionDecodeErrorZ&& o) { CResult_BuiltCommitmentTransactionDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_BuiltCommitmentTransactionDecodeErrorZ)); return *this; } + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* operator &() { return &self; } + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* operator ->() const { return &self; } +}; class C2Tuple_OutPointScriptZ { private: LDKC2Tuple_OutPointScriptZ self; @@ -2606,21 +3101,6 @@ class CResult_InMemoryChannelKeysDecodeErrorZ { const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator &() const { return &self; } const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator ->() const { return &self; } }; -class CVec_UpdateFailHTLCZ { -private: - LDKCVec_UpdateFailHTLCZ self; -public: - CVec_UpdateFailHTLCZ(const CVec_UpdateFailHTLCZ&) = delete; - CVec_UpdateFailHTLCZ(CVec_UpdateFailHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); } - CVec_UpdateFailHTLCZ(LDKCVec_UpdateFailHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); } - operator LDKCVec_UpdateFailHTLCZ() && { LDKCVec_UpdateFailHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); return res; } - ~CVec_UpdateFailHTLCZ() { CVec_UpdateFailHTLCZ_free(self); } - CVec_UpdateFailHTLCZ& operator=(CVec_UpdateFailHTLCZ&& o) { CVec_UpdateFailHTLCZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); return *this; } - LDKCVec_UpdateFailHTLCZ* operator &() { return &self; } - LDKCVec_UpdateFailHTLCZ* operator ->() { return &self; } - const LDKCVec_UpdateFailHTLCZ* operator &() const { return &self; } - const LDKCVec_UpdateFailHTLCZ* operator ->() const { return &self; } -}; class CResult_RouteDecodeErrorZ { private: LDKCResult_RouteDecodeErrorZ self; @@ -2651,20 +3131,50 @@ class CVec_NodeAnnouncementZ { const LDKCVec_NodeAnnouncementZ* operator &() const { return &self; } const LDKCVec_NodeAnnouncementZ* operator ->() const { return &self; } }; -class CResult_UnsignedChannelAnnouncementDecodeErrorZ { +class CVec_UpdateFailHTLCZ { private: - LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ self; + LDKCVec_UpdateFailHTLCZ self; public: - CResult_UnsignedChannelAnnouncementDecodeErrorZ(const CResult_UnsignedChannelAnnouncementDecodeErrorZ&) = delete; - CResult_UnsignedChannelAnnouncementDecodeErrorZ(CResult_UnsignedChannelAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedChannelAnnouncementDecodeErrorZ)); } - CResult_UnsignedChannelAnnouncementDecodeErrorZ(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ)); } - operator LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ() && { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ)); return res; } - ~CResult_UnsignedChannelAnnouncementDecodeErrorZ() { CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(self); } - CResult_UnsignedChannelAnnouncementDecodeErrorZ& operator=(CResult_UnsignedChannelAnnouncementDecodeErrorZ&& o) { CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedChannelAnnouncementDecodeErrorZ)); return *this; } - LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator &() { return &self; } - LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* operator ->() const { return &self; } + CVec_UpdateFailHTLCZ(const CVec_UpdateFailHTLCZ&) = delete; + CVec_UpdateFailHTLCZ(CVec_UpdateFailHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); } + CVec_UpdateFailHTLCZ(LDKCVec_UpdateFailHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); } + operator LDKCVec_UpdateFailHTLCZ() && { LDKCVec_UpdateFailHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); return res; } + ~CVec_UpdateFailHTLCZ() { CVec_UpdateFailHTLCZ_free(self); } + CVec_UpdateFailHTLCZ& operator=(CVec_UpdateFailHTLCZ&& o) { CVec_UpdateFailHTLCZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); return *this; } + LDKCVec_UpdateFailHTLCZ* operator &() { return &self; } + LDKCVec_UpdateFailHTLCZ* operator ->() { return &self; } + const LDKCVec_UpdateFailHTLCZ* operator &() const { return &self; } + const LDKCVec_UpdateFailHTLCZ* operator ->() const { return &self; } +}; +class CResult_FundingLockedDecodeErrorZ { +private: + LDKCResult_FundingLockedDecodeErrorZ self; +public: + CResult_FundingLockedDecodeErrorZ(const CResult_FundingLockedDecodeErrorZ&) = delete; + CResult_FundingLockedDecodeErrorZ(CResult_FundingLockedDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_FundingLockedDecodeErrorZ)); } + CResult_FundingLockedDecodeErrorZ(LDKCResult_FundingLockedDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_FundingLockedDecodeErrorZ)); } + operator LDKCResult_FundingLockedDecodeErrorZ() && { LDKCResult_FundingLockedDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_FundingLockedDecodeErrorZ)); return res; } + ~CResult_FundingLockedDecodeErrorZ() { CResult_FundingLockedDecodeErrorZ_free(self); } + CResult_FundingLockedDecodeErrorZ& operator=(CResult_FundingLockedDecodeErrorZ&& o) { CResult_FundingLockedDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_FundingLockedDecodeErrorZ)); return *this; } + LDKCResult_FundingLockedDecodeErrorZ* operator &() { return &self; } + LDKCResult_FundingLockedDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_FundingLockedDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_FundingLockedDecodeErrorZ* operator ->() const { return &self; } +}; +class CResult_UpdateFailMalformedHTLCDecodeErrorZ { +private: + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ self; +public: + CResult_UpdateFailMalformedHTLCDecodeErrorZ(const CResult_UpdateFailMalformedHTLCDecodeErrorZ&) = delete; + CResult_UpdateFailMalformedHTLCDecodeErrorZ(CResult_UpdateFailMalformedHTLCDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UpdateFailMalformedHTLCDecodeErrorZ)); } + CResult_UpdateFailMalformedHTLCDecodeErrorZ(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ)); } + operator LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ() && { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ)); return res; } + ~CResult_UpdateFailMalformedHTLCDecodeErrorZ() { CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(self); } + CResult_UpdateFailMalformedHTLCDecodeErrorZ& operator=(CResult_UpdateFailMalformedHTLCDecodeErrorZ&& o) { CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UpdateFailMalformedHTLCDecodeErrorZ)); return *this; } + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* operator &() { return &self; } + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* operator ->() const { return &self; } }; class CResult_PongDecodeErrorZ { private: diff --git a/lightning-c-bindings/include/rust_types.h b/lightning-c-bindings/include/rust_types.h index 68395c7cdef..9c8d6ee5215 100644 --- a/lightning-c-bindings/include/rust_types.h +++ b/lightning-c-bindings/include/rust_types.h @@ -10,6 +10,39 @@ #else #define NONNULL_PTR #endif +struct nativeTxCreationKeysOpaque; +typedef struct nativeTxCreationKeysOpaque LDKnativeTxCreationKeys; +struct nativeChannelPublicKeysOpaque; +typedef struct nativeChannelPublicKeysOpaque LDKnativeChannelPublicKeys; +struct nativeHTLCOutputInCommitmentOpaque; +typedef struct nativeHTLCOutputInCommitmentOpaque LDKnativeHTLCOutputInCommitment; +struct nativeChannelTransactionParametersOpaque; +typedef struct nativeChannelTransactionParametersOpaque LDKnativeChannelTransactionParameters; +struct nativeCounterpartyChannelTransactionParametersOpaque; +typedef struct nativeCounterpartyChannelTransactionParametersOpaque LDKnativeCounterpartyChannelTransactionParameters; +struct nativeDirectedChannelTransactionParametersOpaque; +typedef struct nativeDirectedChannelTransactionParametersOpaque LDKnativeDirectedChannelTransactionParameters; +struct nativeHolderCommitmentTransactionOpaque; +typedef struct nativeHolderCommitmentTransactionOpaque LDKnativeHolderCommitmentTransaction; +struct nativeBuiltCommitmentTransactionOpaque; +typedef struct nativeBuiltCommitmentTransactionOpaque LDKnativeBuiltCommitmentTransaction; +struct nativeCommitmentTransactionOpaque; +typedef struct nativeCommitmentTransactionOpaque LDKnativeCommitmentTransaction; +struct nativeTrustedCommitmentTransactionOpaque; +typedef struct nativeTrustedCommitmentTransactionOpaque LDKnativeTrustedCommitmentTransaction; +struct nativeMessageHandlerOpaque; +typedef struct nativeMessageHandlerOpaque LDKnativeMessageHandler; +typedef struct LDKSocketDescriptor LDKSocketDescriptor; +struct nativePeerHandleErrorOpaque; +typedef struct nativePeerHandleErrorOpaque LDKnativePeerHandleError; +struct nativePeerManagerOpaque; +typedef struct nativePeerManagerOpaque LDKnativePeerManager; +struct nativeInitFeaturesOpaque; +typedef struct nativeInitFeaturesOpaque LDKnativeInitFeatures; +struct nativeNodeFeaturesOpaque; +typedef struct nativeNodeFeaturesOpaque LDKnativeNodeFeatures; +struct nativeChannelFeaturesOpaque; +typedef struct nativeChannelFeaturesOpaque LDKnativeChannelFeatures; struct nativeChannelHandshakeConfigOpaque; typedef struct nativeChannelHandshakeConfigOpaque LDKnativeChannelHandshakeConfig; struct nativeChannelHandshakeLimitsOpaque; @@ -18,8 +51,26 @@ struct nativeChannelConfigOpaque; typedef struct nativeChannelConfigOpaque LDKnativeChannelConfig; struct nativeUserConfigOpaque; typedef struct nativeUserConfigOpaque LDKnativeUserConfig; +struct nativeNetworkGraphOpaque; +typedef struct nativeNetworkGraphOpaque LDKnativeNetworkGraph; +struct nativeLockedNetworkGraphOpaque; +typedef struct nativeLockedNetworkGraphOpaque LDKnativeLockedNetworkGraph; +struct nativeNetGraphMsgHandlerOpaque; +typedef struct nativeNetGraphMsgHandlerOpaque LDKnativeNetGraphMsgHandler; +struct nativeDirectionalChannelInfoOpaque; +typedef struct nativeDirectionalChannelInfoOpaque LDKnativeDirectionalChannelInfo; +struct nativeChannelInfoOpaque; +typedef struct nativeChannelInfoOpaque LDKnativeChannelInfo; +struct nativeRoutingFeesOpaque; +typedef struct nativeRoutingFeesOpaque LDKnativeRoutingFees; +struct nativeNodeAnnouncementInfoOpaque; +typedef struct nativeNodeAnnouncementInfoOpaque LDKnativeNodeAnnouncementInfo; +struct nativeNodeInfoOpaque; +typedef struct nativeNodeInfoOpaque LDKnativeNodeInfo; struct nativeChainMonitorOpaque; typedef struct nativeChainMonitorOpaque LDKnativeChainMonitor; +struct nativeOutPointOpaque; +typedef struct nativeOutPointOpaque LDKnativeOutPoint; struct nativeChannelMonitorUpdateOpaque; typedef struct nativeChannelMonitorUpdateOpaque LDKnativeChannelMonitorUpdate; struct nativeMonitorUpdateErrorOpaque; @@ -30,14 +81,6 @@ struct nativeHTLCUpdateOpaque; typedef struct nativeHTLCUpdateOpaque LDKnativeHTLCUpdate; struct nativeChannelMonitorOpaque; typedef struct nativeChannelMonitorOpaque LDKnativeChannelMonitor; -struct nativeOutPointOpaque; -typedef struct nativeOutPointOpaque LDKnativeOutPoint; -struct LDKChannelKeys; -typedef struct LDKChannelKeys LDKChannelKeys; -struct nativeInMemoryChannelKeysOpaque; -typedef struct nativeInMemoryChannelKeysOpaque LDKnativeInMemoryChannelKeys; -struct nativeKeysManagerOpaque; -typedef struct nativeKeysManagerOpaque LDKnativeKeysManager; struct nativeChannelManagerOpaque; typedef struct nativeChannelManagerOpaque LDKnativeChannelManager; struct nativeChannelDetailsOpaque; @@ -46,6 +89,18 @@ struct nativePaymentSendFailureOpaque; typedef struct nativePaymentSendFailureOpaque LDKnativePaymentSendFailure; struct nativeChannelManagerReadArgsOpaque; typedef struct nativeChannelManagerReadArgsOpaque LDKnativeChannelManagerReadArgs; +struct LDKChannelKeys; +typedef struct LDKChannelKeys LDKChannelKeys; +struct nativeInMemoryChannelKeysOpaque; +typedef struct nativeInMemoryChannelKeysOpaque LDKnativeInMemoryChannelKeys; +struct nativeKeysManagerOpaque; +typedef struct nativeKeysManagerOpaque LDKnativeKeysManager; +struct nativeRouteHopOpaque; +typedef struct nativeRouteHopOpaque LDKnativeRouteHop; +struct nativeRouteOpaque; +typedef struct nativeRouteOpaque LDKnativeRoute; +struct nativeRouteHintOpaque; +typedef struct nativeRouteHintOpaque LDKnativeRouteHint; struct nativeDecodeErrorOpaque; typedef struct nativeDecodeErrorOpaque LDKnativeDecodeError; struct nativeInitOpaque; @@ -116,58 +171,3 @@ struct nativeLightningErrorOpaque; typedef struct nativeLightningErrorOpaque LDKnativeLightningError; struct nativeCommitmentUpdateOpaque; typedef struct nativeCommitmentUpdateOpaque LDKnativeCommitmentUpdate; -struct nativeMessageHandlerOpaque; -typedef struct nativeMessageHandlerOpaque LDKnativeMessageHandler; -typedef struct LDKSocketDescriptor LDKSocketDescriptor; -struct nativePeerHandleErrorOpaque; -typedef struct nativePeerHandleErrorOpaque LDKnativePeerHandleError; -struct nativePeerManagerOpaque; -typedef struct nativePeerManagerOpaque LDKnativePeerManager; -struct nativeTxCreationKeysOpaque; -typedef struct nativeTxCreationKeysOpaque LDKnativeTxCreationKeys; -struct nativeChannelPublicKeysOpaque; -typedef struct nativeChannelPublicKeysOpaque LDKnativeChannelPublicKeys; -struct nativeHTLCOutputInCommitmentOpaque; -typedef struct nativeHTLCOutputInCommitmentOpaque LDKnativeHTLCOutputInCommitment; -struct nativeChannelTransactionParametersOpaque; -typedef struct nativeChannelTransactionParametersOpaque LDKnativeChannelTransactionParameters; -struct nativeCounterpartyChannelTransactionParametersOpaque; -typedef struct nativeCounterpartyChannelTransactionParametersOpaque LDKnativeCounterpartyChannelTransactionParameters; -struct nativeDirectedChannelTransactionParametersOpaque; -typedef struct nativeDirectedChannelTransactionParametersOpaque LDKnativeDirectedChannelTransactionParameters; -struct nativeHolderCommitmentTransactionOpaque; -typedef struct nativeHolderCommitmentTransactionOpaque LDKnativeHolderCommitmentTransaction; -struct nativeBuiltCommitmentTransactionOpaque; -typedef struct nativeBuiltCommitmentTransactionOpaque LDKnativeBuiltCommitmentTransaction; -struct nativeCommitmentTransactionOpaque; -typedef struct nativeCommitmentTransactionOpaque LDKnativeCommitmentTransaction; -struct nativeTrustedCommitmentTransactionOpaque; -typedef struct nativeTrustedCommitmentTransactionOpaque LDKnativeTrustedCommitmentTransaction; -struct nativeInitFeaturesOpaque; -typedef struct nativeInitFeaturesOpaque LDKnativeInitFeatures; -struct nativeNodeFeaturesOpaque; -typedef struct nativeNodeFeaturesOpaque LDKnativeNodeFeatures; -struct nativeChannelFeaturesOpaque; -typedef struct nativeChannelFeaturesOpaque LDKnativeChannelFeatures; -struct nativeRouteHopOpaque; -typedef struct nativeRouteHopOpaque LDKnativeRouteHop; -struct nativeRouteOpaque; -typedef struct nativeRouteOpaque LDKnativeRoute; -struct nativeRouteHintOpaque; -typedef struct nativeRouteHintOpaque LDKnativeRouteHint; -struct nativeNetworkGraphOpaque; -typedef struct nativeNetworkGraphOpaque LDKnativeNetworkGraph; -struct nativeLockedNetworkGraphOpaque; -typedef struct nativeLockedNetworkGraphOpaque LDKnativeLockedNetworkGraph; -struct nativeNetGraphMsgHandlerOpaque; -typedef struct nativeNetGraphMsgHandlerOpaque LDKnativeNetGraphMsgHandler; -struct nativeDirectionalChannelInfoOpaque; -typedef struct nativeDirectionalChannelInfoOpaque LDKnativeDirectionalChannelInfo; -struct nativeChannelInfoOpaque; -typedef struct nativeChannelInfoOpaque LDKnativeChannelInfo; -struct nativeRoutingFeesOpaque; -typedef struct nativeRoutingFeesOpaque LDKnativeRoutingFees; -struct nativeNodeAnnouncementInfoOpaque; -typedef struct nativeNodeAnnouncementInfoOpaque LDKnativeNodeAnnouncementInfo; -struct nativeNodeInfoOpaque; -typedef struct nativeNodeInfoOpaque LDKnativeNodeInfo; diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index d30163e60a3..06eabf3c0d2 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -1,116 +1,2953 @@ #[repr(C)] -pub struct CVec_SpendableOutputDescriptorZ { - pub data: *mut crate::chain::keysinterface::SpendableOutputDescriptor, +pub union CResult_SecretKeyErrorZPtr { + pub result: *mut crate::c_types::SecretKey, + pub err: *mut crate::c_types::Secp256k1Error, +} +#[repr(C)] +pub struct CResult_SecretKeyErrorZ { + pub contents: CResult_SecretKeyErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_SecretKeyErrorZ_ok(o: crate::c_types::SecretKey) -> CResult_SecretKeyErrorZ { + CResult_SecretKeyErrorZ { + contents: CResult_SecretKeyErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_SecretKeyErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_SecretKeyErrorZ { + CResult_SecretKeyErrorZ { + contents: CResult_SecretKeyErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_SecretKeyErrorZ_free(_res: CResult_SecretKeyErrorZ) { } +impl Drop for CResult_SecretKeyErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_SecretKeyErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_SecretKeyErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_SecretKeyErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_PublicKeyErrorZPtr { + pub result: *mut crate::c_types::PublicKey, + pub err: *mut crate::c_types::Secp256k1Error, +} +#[repr(C)] +pub struct CResult_PublicKeyErrorZ { + pub contents: CResult_PublicKeyErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_PublicKeyErrorZ_ok(o: crate::c_types::PublicKey) -> CResult_PublicKeyErrorZ { + CResult_PublicKeyErrorZ { + contents: CResult_PublicKeyErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_PublicKeyErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_PublicKeyErrorZ { + CResult_PublicKeyErrorZ { + contents: CResult_PublicKeyErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_PublicKeyErrorZ_free(_res: CResult_PublicKeyErrorZ) { } +impl Drop for CResult_PublicKeyErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_PublicKeyErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_PublicKeyErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_PublicKeyErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_TxCreationKeysDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::TxCreationKeys, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_TxCreationKeysDecodeErrorZ { + pub contents: CResult_TxCreationKeysDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_ok(o: crate::ln::chan_utils::TxCreationKeys) -> CResult_TxCreationKeysDecodeErrorZ { + CResult_TxCreationKeysDecodeErrorZ { + contents: CResult_TxCreationKeysDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_TxCreationKeysDecodeErrorZ { + CResult_TxCreationKeysDecodeErrorZ { + contents: CResult_TxCreationKeysDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_free(_res: CResult_TxCreationKeysDecodeErrorZ) { } +impl Drop for CResult_TxCreationKeysDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_TxCreationKeysDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_TxCreationKeysDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_TxCreationKeysDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_TxCreationKeysDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_TxCreationKeysDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_TxCreationKeysDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_TxCreationKeysDecodeErrorZ_clone(orig: &CResult_TxCreationKeysDecodeErrorZ) -> CResult_TxCreationKeysDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_ChannelPublicKeysDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::ChannelPublicKeys, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_ChannelPublicKeysDecodeErrorZ { + pub contents: CResult_ChannelPublicKeysDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_ok(o: crate::ln::chan_utils::ChannelPublicKeys) -> CResult_ChannelPublicKeysDecodeErrorZ { + CResult_ChannelPublicKeysDecodeErrorZ { + contents: CResult_ChannelPublicKeysDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelPublicKeysDecodeErrorZ { + CResult_ChannelPublicKeysDecodeErrorZ { + contents: CResult_ChannelPublicKeysDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_free(_res: CResult_ChannelPublicKeysDecodeErrorZ) { } +impl Drop for CResult_ChannelPublicKeysDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_ChannelPublicKeysDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_ChannelPublicKeysDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ChannelPublicKeysDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_ChannelPublicKeysDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_ChannelPublicKeysDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_ChannelPublicKeysDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelPublicKeysDecodeErrorZ_clone(orig: &CResult_ChannelPublicKeysDecodeErrorZ) -> CResult_ChannelPublicKeysDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_TxCreationKeysErrorZPtr { + pub result: *mut crate::ln::chan_utils::TxCreationKeys, + pub err: *mut crate::c_types::Secp256k1Error, +} +#[repr(C)] +pub struct CResult_TxCreationKeysErrorZ { + pub contents: CResult_TxCreationKeysErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_TxCreationKeysErrorZ_ok(o: crate::ln::chan_utils::TxCreationKeys) -> CResult_TxCreationKeysErrorZ { + CResult_TxCreationKeysErrorZ { + contents: CResult_TxCreationKeysErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_TxCreationKeysErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_TxCreationKeysErrorZ { + CResult_TxCreationKeysErrorZ { + contents: CResult_TxCreationKeysErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_TxCreationKeysErrorZ_free(_res: CResult_TxCreationKeysErrorZ) { } +impl Drop for CResult_TxCreationKeysErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_TxCreationKeysErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_TxCreationKeysErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_TxCreationKeysErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_HTLCOutputInCommitmentDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::HTLCOutputInCommitment, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_HTLCOutputInCommitmentDecodeErrorZ { + pub contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o: crate::ln::chan_utils::HTLCOutputInCommitment) -> CResult_HTLCOutputInCommitmentDecodeErrorZ { + CResult_HTLCOutputInCommitmentDecodeErrorZ { + contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_HTLCOutputInCommitmentDecodeErrorZ { + CResult_HTLCOutputInCommitmentDecodeErrorZ { + contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res: CResult_HTLCOutputInCommitmentDecodeErrorZ) { } +impl Drop for CResult_HTLCOutputInCommitmentDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_HTLCOutputInCommitmentDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_HTLCOutputInCommitmentDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_HTLCOutputInCommitmentDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_HTLCOutputInCommitmentDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_HTLCOutputInCommitmentDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig: &CResult_HTLCOutputInCommitmentDecodeErrorZ) -> CResult_HTLCOutputInCommitmentDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::CounterpartyChannelTransactionParameters, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + pub contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o: crate::ln::chan_utils::CounterpartyChannelTransactionParameters) -> CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ) { } +impl Drop for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig: &CResult_CounterpartyChannelTransactionParametersDecodeErrorZ) -> CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_ChannelTransactionParametersDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::ChannelTransactionParameters, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_ChannelTransactionParametersDecodeErrorZ { + pub contents: CResult_ChannelTransactionParametersDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_ok(o: crate::ln::chan_utils::ChannelTransactionParameters) -> CResult_ChannelTransactionParametersDecodeErrorZ { + CResult_ChannelTransactionParametersDecodeErrorZ { + contents: CResult_ChannelTransactionParametersDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelTransactionParametersDecodeErrorZ { + CResult_ChannelTransactionParametersDecodeErrorZ { + contents: CResult_ChannelTransactionParametersDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_free(_res: CResult_ChannelTransactionParametersDecodeErrorZ) { } +impl Drop for CResult_ChannelTransactionParametersDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_ChannelTransactionParametersDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_ChannelTransactionParametersDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ChannelTransactionParametersDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_ChannelTransactionParametersDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_ChannelTransactionParametersDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_ChannelTransactionParametersDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig: &CResult_ChannelTransactionParametersDecodeErrorZ) -> CResult_ChannelTransactionParametersDecodeErrorZ { orig.clone() } +#[repr(C)] +pub struct CVec_SignatureZ { + pub data: *mut crate::c_types::Signature, + pub datalen: usize +} +impl CVec_SignatureZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Signature] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_SignatureZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_SignatureZ_free(_res: CVec_SignatureZ) { } +impl Drop for CVec_SignatureZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_SignatureZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub union CResult_HolderCommitmentTransactionDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::HolderCommitmentTransaction, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_HolderCommitmentTransactionDecodeErrorZ { + pub contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o: crate::ln::chan_utils::HolderCommitmentTransaction) -> CResult_HolderCommitmentTransactionDecodeErrorZ { + CResult_HolderCommitmentTransactionDecodeErrorZ { + contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_HolderCommitmentTransactionDecodeErrorZ { + CResult_HolderCommitmentTransactionDecodeErrorZ { + contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res: CResult_HolderCommitmentTransactionDecodeErrorZ) { } +impl Drop for CResult_HolderCommitmentTransactionDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_HolderCommitmentTransactionDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_HolderCommitmentTransactionDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_HolderCommitmentTransactionDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_HolderCommitmentTransactionDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_HolderCommitmentTransactionDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig: &CResult_HolderCommitmentTransactionDecodeErrorZ) -> CResult_HolderCommitmentTransactionDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_BuiltCommitmentTransactionDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::BuiltCommitmentTransaction, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_BuiltCommitmentTransactionDecodeErrorZ { + pub contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o: crate::ln::chan_utils::BuiltCommitmentTransaction) -> CResult_BuiltCommitmentTransactionDecodeErrorZ { + CResult_BuiltCommitmentTransactionDecodeErrorZ { + contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_BuiltCommitmentTransactionDecodeErrorZ { + CResult_BuiltCommitmentTransactionDecodeErrorZ { + contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res: CResult_BuiltCommitmentTransactionDecodeErrorZ) { } +impl Drop for CResult_BuiltCommitmentTransactionDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_BuiltCommitmentTransactionDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_BuiltCommitmentTransactionDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_BuiltCommitmentTransactionDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_BuiltCommitmentTransactionDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_BuiltCommitmentTransactionDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig: &CResult_BuiltCommitmentTransactionDecodeErrorZ) -> CResult_BuiltCommitmentTransactionDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_CommitmentTransactionDecodeErrorZPtr { + pub result: *mut crate::ln::chan_utils::CommitmentTransaction, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_CommitmentTransactionDecodeErrorZ { + pub contents: CResult_CommitmentTransactionDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_ok(o: crate::ln::chan_utils::CommitmentTransaction) -> CResult_CommitmentTransactionDecodeErrorZ { + CResult_CommitmentTransactionDecodeErrorZ { + contents: CResult_CommitmentTransactionDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CommitmentTransactionDecodeErrorZ { + CResult_CommitmentTransactionDecodeErrorZ { + contents: CResult_CommitmentTransactionDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_free(_res: CResult_CommitmentTransactionDecodeErrorZ) { } +impl Drop for CResult_CommitmentTransactionDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_CommitmentTransactionDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_CommitmentTransactionDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_CommitmentTransactionDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_CommitmentTransactionDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_CommitmentTransactionDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_CommitmentTransactionDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_CommitmentTransactionDecodeErrorZ_clone(orig: &CResult_CommitmentTransactionDecodeErrorZ) -> CResult_CommitmentTransactionDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_TrustedCommitmentTransactionNoneZPtr { + pub result: *mut crate::ln::chan_utils::TrustedCommitmentTransaction, + /// Note that this value is always NULL, as there are no contents in the Err variant + pub err: *mut std::ffi::c_void, +} +#[repr(C)] +pub struct CResult_TrustedCommitmentTransactionNoneZ { + pub contents: CResult_TrustedCommitmentTransactionNoneZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_ok(o: crate::ln::chan_utils::TrustedCommitmentTransaction) -> CResult_TrustedCommitmentTransactionNoneZ { + CResult_TrustedCommitmentTransactionNoneZ { + contents: CResult_TrustedCommitmentTransactionNoneZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_err() -> CResult_TrustedCommitmentTransactionNoneZ { + CResult_TrustedCommitmentTransactionNoneZ { + contents: CResult_TrustedCommitmentTransactionNoneZPtr { + err: std::ptr::null_mut(), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_free(_res: CResult_TrustedCommitmentTransactionNoneZ) { } +impl Drop for CResult_TrustedCommitmentTransactionNoneZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + } + } +} +impl From> for CResult_TrustedCommitmentTransactionNoneZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_TrustedCommitmentTransactionNoneZPtr { result } + } else { + let _ = unsafe { Box::from_raw(o.contents.err) }; + o.contents.err = std::ptr::null_mut(); + CResult_TrustedCommitmentTransactionNoneZPtr { err: std::ptr::null_mut() } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_CVec_SignatureZNoneZPtr { + pub result: *mut crate::c_types::derived::CVec_SignatureZ, + /// Note that this value is always NULL, as there are no contents in the Err variant + pub err: *mut std::ffi::c_void, +} +#[repr(C)] +pub struct CResult_CVec_SignatureZNoneZ { + pub contents: CResult_CVec_SignatureZNoneZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_CVec_SignatureZNoneZ_ok(o: crate::c_types::derived::CVec_SignatureZ) -> CResult_CVec_SignatureZNoneZ { + CResult_CVec_SignatureZNoneZ { + contents: CResult_CVec_SignatureZNoneZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_CVec_SignatureZNoneZ_err() -> CResult_CVec_SignatureZNoneZ { + CResult_CVec_SignatureZNoneZ { + contents: CResult_CVec_SignatureZNoneZPtr { + err: std::ptr::null_mut(), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_CVec_SignatureZNoneZ_free(_res: CResult_CVec_SignatureZNoneZ) { } +impl Drop for CResult_CVec_SignatureZNoneZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + } + } +} +impl From> for CResult_CVec_SignatureZNoneZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_CVec_SignatureZNoneZPtr { result } + } else { + let _ = unsafe { Box::from_raw(o.contents.err) }; + o.contents.err = std::ptr::null_mut(); + CResult_CVec_SignatureZNoneZPtr { err: std::ptr::null_mut() } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_CVec_SignatureZNoneZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_CVec_SignatureZNoneZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_CVec_SignatureZNoneZPtr { + err: std::ptr::null_mut() + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_CVec_SignatureZNoneZ_clone(orig: &CResult_CVec_SignatureZNoneZ) -> CResult_CVec_SignatureZNoneZ { orig.clone() } +#[repr(C)] +pub struct CVec_PublicKeyZ { + pub data: *mut crate::c_types::PublicKey, + pub datalen: usize +} +impl CVec_PublicKeyZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::PublicKey] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_PublicKeyZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_PublicKeyZ_free(_res: CVec_PublicKeyZ) { } +impl Drop for CVec_PublicKeyZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +#[repr(C)] +pub struct CVec_u8Z { + pub data: *mut u8, + pub datalen: usize +} +impl CVec_u8Z { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u8] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_u8Z { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_u8Z_free(_res: CVec_u8Z) { } +impl Drop for CVec_u8Z { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_u8Z { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub union CResult_CVec_u8ZPeerHandleErrorZPtr { + pub result: *mut crate::c_types::derived::CVec_u8Z, + pub err: *mut crate::ln::peer_handler::PeerHandleError, +} +#[repr(C)] +pub struct CResult_CVec_u8ZPeerHandleErrorZ { + pub contents: CResult_CVec_u8ZPeerHandleErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_ok(o: crate::c_types::derived::CVec_u8Z) -> CResult_CVec_u8ZPeerHandleErrorZ { + CResult_CVec_u8ZPeerHandleErrorZ { + contents: CResult_CVec_u8ZPeerHandleErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_CVec_u8ZPeerHandleErrorZ { + CResult_CVec_u8ZPeerHandleErrorZ { + contents: CResult_CVec_u8ZPeerHandleErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_free(_res: CResult_CVec_u8ZPeerHandleErrorZ) { } +impl Drop for CResult_CVec_u8ZPeerHandleErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_CVec_u8ZPeerHandleErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_CVec_u8ZPeerHandleErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_CVec_u8ZPeerHandleErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_CVec_u8ZPeerHandleErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_CVec_u8ZPeerHandleErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_CVec_u8ZPeerHandleErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: &CResult_CVec_u8ZPeerHandleErrorZ) -> CResult_CVec_u8ZPeerHandleErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_NonePeerHandleErrorZPtr { + /// Note that this value is always NULL, as there are no contents in the OK variant + pub result: *mut std::ffi::c_void, + pub err: *mut crate::ln::peer_handler::PeerHandleError, +} +#[repr(C)] +pub struct CResult_NonePeerHandleErrorZ { + pub contents: CResult_NonePeerHandleErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NonePeerHandleErrorZ_ok() -> CResult_NonePeerHandleErrorZ { + CResult_NonePeerHandleErrorZ { + contents: CResult_NonePeerHandleErrorZPtr { + result: std::ptr::null_mut(), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NonePeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_NonePeerHandleErrorZ { + CResult_NonePeerHandleErrorZ { + contents: CResult_NonePeerHandleErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NonePeerHandleErrorZ_free(_res: CResult_NonePeerHandleErrorZ) { } +impl Drop for CResult_NonePeerHandleErrorZ { + fn drop(&mut self) { + if self.result_ok { + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NonePeerHandleErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let _ = unsafe { Box::from_raw(o.contents.result) }; + o.contents.result = std::ptr::null_mut(); + CResult_NonePeerHandleErrorZPtr { result: std::ptr::null_mut() } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NonePeerHandleErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_NonePeerHandleErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_NonePeerHandleErrorZPtr { + result: std::ptr::null_mut() + } } + } else { + Self { result_ok: false, contents: CResult_NonePeerHandleErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_NonePeerHandleErrorZ_clone(orig: &CResult_NonePeerHandleErrorZ) -> CResult_NonePeerHandleErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_boolPeerHandleErrorZPtr { + pub result: *mut bool, + pub err: *mut crate::ln::peer_handler::PeerHandleError, +} +#[repr(C)] +pub struct CResult_boolPeerHandleErrorZ { + pub contents: CResult_boolPeerHandleErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_boolPeerHandleErrorZ_ok(o: bool) -> CResult_boolPeerHandleErrorZ { + CResult_boolPeerHandleErrorZ { + contents: CResult_boolPeerHandleErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_boolPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_boolPeerHandleErrorZ { + CResult_boolPeerHandleErrorZ { + contents: CResult_boolPeerHandleErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_boolPeerHandleErrorZ_free(_res: CResult_boolPeerHandleErrorZ) { } +impl Drop for CResult_boolPeerHandleErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_boolPeerHandleErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_boolPeerHandleErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_boolPeerHandleErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_boolPeerHandleErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_boolPeerHandleErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_boolPeerHandleErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_boolPeerHandleErrorZ_clone(orig: &CResult_boolPeerHandleErrorZ) -> CResult_boolPeerHandleErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_InitFeaturesDecodeErrorZPtr { + pub result: *mut crate::ln::features::InitFeatures, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_InitFeaturesDecodeErrorZ { + pub contents: CResult_InitFeaturesDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_ok(o: crate::ln::features::InitFeatures) -> CResult_InitFeaturesDecodeErrorZ { + CResult_InitFeaturesDecodeErrorZ { + contents: CResult_InitFeaturesDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitFeaturesDecodeErrorZ { + CResult_InitFeaturesDecodeErrorZ { + contents: CResult_InitFeaturesDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_free(_res: CResult_InitFeaturesDecodeErrorZ) { } +impl Drop for CResult_InitFeaturesDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_InitFeaturesDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_InitFeaturesDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_InitFeaturesDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_NodeFeaturesDecodeErrorZPtr { + pub result: *mut crate::ln::features::NodeFeatures, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_NodeFeaturesDecodeErrorZ { + pub contents: CResult_NodeFeaturesDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_ok(o: crate::ln::features::NodeFeatures) -> CResult_NodeFeaturesDecodeErrorZ { + CResult_NodeFeaturesDecodeErrorZ { + contents: CResult_NodeFeaturesDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeFeaturesDecodeErrorZ { + CResult_NodeFeaturesDecodeErrorZ { + contents: CResult_NodeFeaturesDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_free(_res: CResult_NodeFeaturesDecodeErrorZ) { } +impl Drop for CResult_NodeFeaturesDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NodeFeaturesDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_NodeFeaturesDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NodeFeaturesDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_ChannelFeaturesDecodeErrorZPtr { + pub result: *mut crate::ln::features::ChannelFeatures, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_ChannelFeaturesDecodeErrorZ { + pub contents: CResult_ChannelFeaturesDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_ok(o: crate::ln::features::ChannelFeatures) -> CResult_ChannelFeaturesDecodeErrorZ { + CResult_ChannelFeaturesDecodeErrorZ { + contents: CResult_ChannelFeaturesDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelFeaturesDecodeErrorZ { + CResult_ChannelFeaturesDecodeErrorZ { + contents: CResult_ChannelFeaturesDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_free(_res: CResult_ChannelFeaturesDecodeErrorZ) { } +impl Drop for CResult_ChannelFeaturesDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_ChannelFeaturesDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_ChannelFeaturesDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ChannelFeaturesDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_ChannelConfigDecodeErrorZPtr { + pub result: *mut crate::util::config::ChannelConfig, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_ChannelConfigDecodeErrorZ { + pub contents: CResult_ChannelConfigDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_ok(o: crate::util::config::ChannelConfig) -> CResult_ChannelConfigDecodeErrorZ { + CResult_ChannelConfigDecodeErrorZ { + contents: CResult_ChannelConfigDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelConfigDecodeErrorZ { + CResult_ChannelConfigDecodeErrorZ { + contents: CResult_ChannelConfigDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_free(_res: CResult_ChannelConfigDecodeErrorZ) { } +impl Drop for CResult_ChannelConfigDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_ChannelConfigDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_ChannelConfigDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ChannelConfigDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_ChannelConfigDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_ChannelConfigDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_ChannelConfigDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_clone(orig: &CResult_ChannelConfigDecodeErrorZ) -> CResult_ChannelConfigDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_boolLightningErrorZPtr { + pub result: *mut bool, + pub err: *mut crate::ln::msgs::LightningError, +} +#[repr(C)] +pub struct CResult_boolLightningErrorZ { + pub contents: CResult_boolLightningErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_boolLightningErrorZ_ok(o: bool) -> CResult_boolLightningErrorZ { + CResult_boolLightningErrorZ { + contents: CResult_boolLightningErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_boolLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_boolLightningErrorZ { + CResult_boolLightningErrorZ { + contents: CResult_boolLightningErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_boolLightningErrorZ_free(_res: CResult_boolLightningErrorZ) { } +impl Drop for CResult_boolLightningErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_boolLightningErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_boolLightningErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_boolLightningErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_boolLightningErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_boolLightningErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_boolLightningErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_boolLightningErrorZ_clone(orig: &CResult_boolLightningErrorZ) -> CResult_boolLightningErrorZ { orig.clone() } +#[repr(C)] +pub struct C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + pub a: crate::ln::msgs::ChannelAnnouncement, + pub b: crate::ln::msgs::ChannelUpdate, + pub c: crate::ln::msgs::ChannelUpdate, +} +impl From<(crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)> for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + fn from (tup: (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)) -> Self { + Self { + a: tup.0, + b: tup.1, + c: tup.2, + } + } +} +impl C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate) { + (self.a, self.b, self.c) + } +} +impl Clone for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + fn clone(&self) -> Self { + Self { + a: self.a.clone(), + b: self.b.clone(), + c: self.c.clone(), + } + } +} +#[no_mangle] +pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig: &C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { orig.clone() } +#[no_mangle] +pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: crate::ln::msgs::ChannelAnnouncement, b: crate::ln::msgs::ChannelUpdate, c: crate::ln::msgs::ChannelUpdate) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { a, b, c, } +} + +#[no_mangle] +pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) { } +#[repr(C)] +pub struct CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { + pub data: *mut crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, + pub datalen: usize +} +impl CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ) { } +impl Drop for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub struct CVec_NodeAnnouncementZ { + pub data: *mut crate::ln::msgs::NodeAnnouncement, + pub datalen: usize +} +impl CVec_NodeAnnouncementZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NodeAnnouncement] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_NodeAnnouncementZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_NodeAnnouncementZ_free(_res: CVec_NodeAnnouncementZ) { } +impl Drop for CVec_NodeAnnouncementZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_NodeAnnouncementZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub union CResult_NoneLightningErrorZPtr { + /// Note that this value is always NULL, as there are no contents in the OK variant + pub result: *mut std::ffi::c_void, + pub err: *mut crate::ln::msgs::LightningError, +} +#[repr(C)] +pub struct CResult_NoneLightningErrorZ { + pub contents: CResult_NoneLightningErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NoneLightningErrorZ_ok() -> CResult_NoneLightningErrorZ { + CResult_NoneLightningErrorZ { + contents: CResult_NoneLightningErrorZPtr { + result: std::ptr::null_mut(), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_NoneLightningErrorZ { + CResult_NoneLightningErrorZ { + contents: CResult_NoneLightningErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneLightningErrorZ_free(_res: CResult_NoneLightningErrorZ) { } +impl Drop for CResult_NoneLightningErrorZ { + fn drop(&mut self) { + if self.result_ok { + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NoneLightningErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let _ = unsafe { Box::from_raw(o.contents.result) }; + o.contents.result = std::ptr::null_mut(); + CResult_NoneLightningErrorZPtr { result: std::ptr::null_mut() } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NoneLightningErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_NoneLightningErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_NoneLightningErrorZPtr { + result: std::ptr::null_mut() + } } + } else { + Self { result_ok: false, contents: CResult_NoneLightningErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneLightningErrorZ_clone(orig: &CResult_NoneLightningErrorZ) -> CResult_NoneLightningErrorZ { orig.clone() } +#[repr(C)] +pub struct CVec_MessageSendEventZ { + pub data: *mut crate::util::events::MessageSendEvent, + pub datalen: usize +} +impl CVec_MessageSendEventZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::MessageSendEvent] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_MessageSendEventZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_MessageSendEventZ_free(_res: CVec_MessageSendEventZ) { } +impl Drop for CVec_MessageSendEventZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_MessageSendEventZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub union CResult_DirectionalChannelInfoDecodeErrorZPtr { + pub result: *mut crate::routing::network_graph::DirectionalChannelInfo, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_DirectionalChannelInfoDecodeErrorZ { + pub contents: CResult_DirectionalChannelInfoDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_ok(o: crate::routing::network_graph::DirectionalChannelInfo) -> CResult_DirectionalChannelInfoDecodeErrorZ { + CResult_DirectionalChannelInfoDecodeErrorZ { + contents: CResult_DirectionalChannelInfoDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_DirectionalChannelInfoDecodeErrorZ { + CResult_DirectionalChannelInfoDecodeErrorZ { + contents: CResult_DirectionalChannelInfoDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_free(_res: CResult_DirectionalChannelInfoDecodeErrorZ) { } +impl Drop for CResult_DirectionalChannelInfoDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_DirectionalChannelInfoDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_DirectionalChannelInfoDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_DirectionalChannelInfoDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_DirectionalChannelInfoDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_DirectionalChannelInfoDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_DirectionalChannelInfoDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig: &CResult_DirectionalChannelInfoDecodeErrorZ) -> CResult_DirectionalChannelInfoDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_ChannelInfoDecodeErrorZPtr { + pub result: *mut crate::routing::network_graph::ChannelInfo, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_ChannelInfoDecodeErrorZ { + pub contents: CResult_ChannelInfoDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_ok(o: crate::routing::network_graph::ChannelInfo) -> CResult_ChannelInfoDecodeErrorZ { + CResult_ChannelInfoDecodeErrorZ { + contents: CResult_ChannelInfoDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelInfoDecodeErrorZ { + CResult_ChannelInfoDecodeErrorZ { + contents: CResult_ChannelInfoDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelInfoDecodeErrorZ_free(_res: CResult_ChannelInfoDecodeErrorZ) { } +impl Drop for CResult_ChannelInfoDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_ChannelInfoDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_ChannelInfoDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ChannelInfoDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub union CResult_RoutingFeesDecodeErrorZPtr { + pub result: *mut crate::routing::network_graph::RoutingFees, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_RoutingFeesDecodeErrorZ { + pub contents: CResult_RoutingFeesDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_ok(o: crate::routing::network_graph::RoutingFees) -> CResult_RoutingFeesDecodeErrorZ { + CResult_RoutingFeesDecodeErrorZ { + contents: CResult_RoutingFeesDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RoutingFeesDecodeErrorZ { + CResult_RoutingFeesDecodeErrorZ { + contents: CResult_RoutingFeesDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_free(_res: CResult_RoutingFeesDecodeErrorZ) { } +impl Drop for CResult_RoutingFeesDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_RoutingFeesDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_RoutingFeesDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_RoutingFeesDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_RoutingFeesDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_RoutingFeesDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_RoutingFeesDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_clone(orig: &CResult_RoutingFeesDecodeErrorZ) -> CResult_RoutingFeesDecodeErrorZ { orig.clone() } +#[repr(C)] +pub struct CVec_NetAddressZ { + pub data: *mut crate::ln::msgs::NetAddress, + pub datalen: usize +} +impl CVec_NetAddressZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NetAddress] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_NetAddressZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_NetAddressZ_free(_res: CVec_NetAddressZ) { } +impl Drop for CVec_NetAddressZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_NetAddressZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub union CResult_NodeAnnouncementInfoDecodeErrorZPtr { + pub result: *mut crate::routing::network_graph::NodeAnnouncementInfo, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_NodeAnnouncementInfoDecodeErrorZ { + pub contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeAnnouncementInfo) -> CResult_NodeAnnouncementInfoDecodeErrorZ { + CResult_NodeAnnouncementInfoDecodeErrorZ { + contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementInfoDecodeErrorZ { + CResult_NodeAnnouncementInfoDecodeErrorZ { + contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: CResult_NodeAnnouncementInfoDecodeErrorZ) { } +impl Drop for CResult_NodeAnnouncementInfoDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NodeAnnouncementInfoDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_NodeAnnouncementInfoDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NodeAnnouncementInfoDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_NodeAnnouncementInfoDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementInfoDecodeErrorZ) -> CResult_NodeAnnouncementInfoDecodeErrorZ { orig.clone() } +#[repr(C)] +pub struct CVec_u64Z { + pub data: *mut u64, + pub datalen: usize +} +impl CVec_u64Z { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u64] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_u64Z { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_u64Z_free(_res: CVec_u64Z) { } +impl Drop for CVec_u64Z { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_u64Z { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub union CResult_NodeInfoDecodeErrorZPtr { + pub result: *mut crate::routing::network_graph::NodeInfo, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_NodeInfoDecodeErrorZ { + pub contents: CResult_NodeInfoDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NodeInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeInfo) -> CResult_NodeInfoDecodeErrorZ { + CResult_NodeInfoDecodeErrorZ { + contents: CResult_NodeInfoDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeInfoDecodeErrorZ { + CResult_NodeInfoDecodeErrorZ { + contents: CResult_NodeInfoDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeInfoDecodeErrorZ_free(_res: CResult_NodeInfoDecodeErrorZ) { } +impl Drop for CResult_NodeInfoDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NodeInfoDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_NodeInfoDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NodeInfoDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_NodeInfoDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_NodeInfoDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_NodeInfoDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_NodeInfoDecodeErrorZ_clone(orig: &CResult_NodeInfoDecodeErrorZ) -> CResult_NodeInfoDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_NetworkGraphDecodeErrorZPtr { + pub result: *mut crate::routing::network_graph::NetworkGraph, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_NetworkGraphDecodeErrorZ { + pub contents: CResult_NetworkGraphDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_ok(o: crate::routing::network_graph::NetworkGraph) -> CResult_NetworkGraphDecodeErrorZ { + CResult_NetworkGraphDecodeErrorZ { + contents: CResult_NetworkGraphDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NetworkGraphDecodeErrorZ { + CResult_NetworkGraphDecodeErrorZ { + contents: CResult_NetworkGraphDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_free(_res: CResult_NetworkGraphDecodeErrorZ) { } +impl Drop for CResult_NetworkGraphDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NetworkGraphDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_NetworkGraphDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NetworkGraphDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +#[repr(C)] +pub struct C2Tuple_usizeTransactionZ { + pub a: usize, + pub b: crate::c_types::Transaction, +} +impl From<(usize, crate::c_types::Transaction)> for C2Tuple_usizeTransactionZ { + fn from (tup: (usize, crate::c_types::Transaction)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_usizeTransactionZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (usize, crate::c_types::Transaction) { + (self.a, self.b) + } +} +#[no_mangle] +pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ { + C2Tuple_usizeTransactionZ { a, b, } +} + +#[no_mangle] +pub extern "C" fn C2Tuple_usizeTransactionZ_free(_res: C2Tuple_usizeTransactionZ) { } +#[repr(C)] +pub struct CVec_C2Tuple_usizeTransactionZZ { + pub data: *mut crate::c_types::derived::C2Tuple_usizeTransactionZ, + pub datalen: usize +} +impl CVec_C2Tuple_usizeTransactionZZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_usizeTransactionZ] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_C2Tuple_usizeTransactionZZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_C2Tuple_usizeTransactionZZ_free(_res: CVec_C2Tuple_usizeTransactionZZ) { } +impl Drop for CVec_C2Tuple_usizeTransactionZZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +#[repr(C)] +pub union CResult_NoneChannelMonitorUpdateErrZPtr { + /// Note that this value is always NULL, as there are no contents in the OK variant + pub result: *mut std::ffi::c_void, + pub err: *mut crate::chain::channelmonitor::ChannelMonitorUpdateErr, +} +#[repr(C)] +pub struct CResult_NoneChannelMonitorUpdateErrZ { + pub contents: CResult_NoneChannelMonitorUpdateErrZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ { + CResult_NoneChannelMonitorUpdateErrZ { + contents: CResult_NoneChannelMonitorUpdateErrZPtr { + result: std::ptr::null_mut(), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_err(e: crate::chain::channelmonitor::ChannelMonitorUpdateErr) -> CResult_NoneChannelMonitorUpdateErrZ { + CResult_NoneChannelMonitorUpdateErrZ { + contents: CResult_NoneChannelMonitorUpdateErrZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_free(_res: CResult_NoneChannelMonitorUpdateErrZ) { } +impl Drop for CResult_NoneChannelMonitorUpdateErrZ { + fn drop(&mut self) { + if self.result_ok { + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NoneChannelMonitorUpdateErrZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let _ = unsafe { Box::from_raw(o.contents.result) }; + o.contents.result = std::ptr::null_mut(); + CResult_NoneChannelMonitorUpdateErrZPtr { result: std::ptr::null_mut() } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NoneChannelMonitorUpdateErrZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_NoneChannelMonitorUpdateErrZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_NoneChannelMonitorUpdateErrZPtr { + result: std::ptr::null_mut() + } } + } else { + Self { result_ok: false, contents: CResult_NoneChannelMonitorUpdateErrZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_clone(orig: &CResult_NoneChannelMonitorUpdateErrZ) -> CResult_NoneChannelMonitorUpdateErrZ { orig.clone() } +#[repr(C)] +pub struct CVec_MonitorEventZ { + pub data: *mut crate::chain::channelmonitor::MonitorEvent, + pub datalen: usize +} +impl CVec_MonitorEventZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::MonitorEvent] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_MonitorEventZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_MonitorEventZ_free(_res: CVec_MonitorEventZ) { } +impl Drop for CVec_MonitorEventZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_MonitorEventZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub struct CVec_EventZ { + pub data: *mut crate::util::events::Event, pub datalen: usize } -impl CVec_SpendableOutputDescriptorZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret +impl CVec_EventZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret + } + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::Event] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } + } +} +impl From> for CVec_EventZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } + } +} +#[no_mangle] +pub extern "C" fn CVec_EventZ_free(_res: CVec_EventZ) { } +impl Drop for CVec_EventZ { + fn drop(&mut self) { + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + } +} +impl Clone for CVec_EventZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) + } +} +#[repr(C)] +pub union CResult_OutPointDecodeErrorZPtr { + pub result: *mut crate::chain::transaction::OutPoint, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_OutPointDecodeErrorZ { + pub contents: CResult_OutPointDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_OutPointDecodeErrorZ_ok(o: crate::chain::transaction::OutPoint) -> CResult_OutPointDecodeErrorZ { + CResult_OutPointDecodeErrorZ { + contents: CResult_OutPointDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_OutPointDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_OutPointDecodeErrorZ { + CResult_OutPointDecodeErrorZ { + contents: CResult_OutPointDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_OutPointDecodeErrorZ_free(_res: CResult_OutPointDecodeErrorZ) { } +impl Drop for CResult_OutPointDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_OutPointDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_OutPointDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_OutPointDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::keysinterface::SpendableOutputDescriptor] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } +} +impl Clone for CResult_OutPointDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_OutPointDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_OutPointDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } } } -impl From> for CVec_SpendableOutputDescriptorZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } +#[no_mangle] +pub extern "C" fn CResult_OutPointDecodeErrorZ_clone(orig: &CResult_OutPointDecodeErrorZ) -> CResult_OutPointDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_ChannelMonitorUpdateDecodeErrorZPtr { + pub result: *mut crate::chain::channelmonitor::ChannelMonitorUpdate, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_ChannelMonitorUpdateDecodeErrorZ { + pub contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: crate::chain::channelmonitor::ChannelMonitorUpdate) -> CResult_ChannelMonitorUpdateDecodeErrorZ { + CResult_ChannelMonitorUpdateDecodeErrorZ { + contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, } } #[no_mangle] -pub extern "C" fn CVec_SpendableOutputDescriptorZ_free(_res: CVec_SpendableOutputDescriptorZ) { } -impl Drop for CVec_SpendableOutputDescriptorZ { +pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelMonitorUpdateDecodeErrorZ { + CResult_ChannelMonitorUpdateDecodeErrorZ { + contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: CResult_ChannelMonitorUpdateDecodeErrorZ) { } +impl Drop for CResult_ChannelMonitorUpdateDecodeErrorZ { fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_ChannelMonitorUpdateDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_ChannelMonitorUpdateDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ChannelMonitorUpdateDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_ChannelMonitorUpdateDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: &CResult_ChannelMonitorUpdateDecodeErrorZ) -> CResult_ChannelMonitorUpdateDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_HTLCUpdateDecodeErrorZPtr { + pub result: *mut crate::chain::channelmonitor::HTLCUpdate, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_HTLCUpdateDecodeErrorZ { + pub contents: CResult_HTLCUpdateDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_ok(o: crate::chain::channelmonitor::HTLCUpdate) -> CResult_HTLCUpdateDecodeErrorZ { + CResult_HTLCUpdateDecodeErrorZ { + contents: CResult_HTLCUpdateDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_HTLCUpdateDecodeErrorZ { + CResult_HTLCUpdateDecodeErrorZ { + contents: CResult_HTLCUpdateDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_free(_res: CResult_HTLCUpdateDecodeErrorZ) { } +impl Drop for CResult_HTLCUpdateDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_HTLCUpdateDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_HTLCUpdateDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_HTLCUpdateDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_HTLCUpdateDecodeErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_HTLCUpdateDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_HTLCUpdateDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_clone(orig: &CResult_HTLCUpdateDecodeErrorZ) -> CResult_HTLCUpdateDecodeErrorZ { orig.clone() } +#[repr(C)] +pub union CResult_NoneMonitorUpdateErrorZPtr { + /// Note that this value is always NULL, as there are no contents in the OK variant + pub result: *mut std::ffi::c_void, + pub err: *mut crate::chain::channelmonitor::MonitorUpdateError, +} +#[repr(C)] +pub struct CResult_NoneMonitorUpdateErrorZ { + pub contents: CResult_NoneMonitorUpdateErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ { + CResult_NoneMonitorUpdateErrorZ { + contents: CResult_NoneMonitorUpdateErrorZPtr { + result: std::ptr::null_mut(), + }, + result_ok: true, + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_err(e: crate::chain::channelmonitor::MonitorUpdateError) -> CResult_NoneMonitorUpdateErrorZ { + CResult_NoneMonitorUpdateErrorZ { + contents: CResult_NoneMonitorUpdateErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_free(_res: CResult_NoneMonitorUpdateErrorZ) { } +impl Drop for CResult_NoneMonitorUpdateErrorZ { + fn drop(&mut self) { + if self.result_ok { + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } + } +} +impl From> for CResult_NoneMonitorUpdateErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let _ = unsafe { Box::from_raw(o.contents.result) }; + o.contents.result = std::ptr::null_mut(); + CResult_NoneMonitorUpdateErrorZPtr { result: std::ptr::null_mut() } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NoneMonitorUpdateErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_NoneMonitorUpdateErrorZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_NoneMonitorUpdateErrorZPtr { + result: std::ptr::null_mut() + } } + } else { + Self { result_ok: false, contents: CResult_NoneMonitorUpdateErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_clone(orig: &CResult_NoneMonitorUpdateErrorZ) -> CResult_NoneMonitorUpdateErrorZ { orig.clone() } +#[repr(C)] +pub struct C2Tuple_OutPointScriptZ { + pub a: crate::chain::transaction::OutPoint, + pub b: crate::c_types::derived::CVec_u8Z, +} +impl From<(crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)> for C2Tuple_OutPointScriptZ { + fn from (tup: (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_OutPointScriptZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z) { + (self.a, self.b) } } -impl Clone for CVec_SpendableOutputDescriptorZ { +impl Clone for C2Tuple_OutPointScriptZ { fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) + Self { + a: self.a.clone(), + b: self.b.clone(), + } } } +#[no_mangle] +pub extern "C" fn C2Tuple_OutPointScriptZ_clone(orig: &C2Tuple_OutPointScriptZ) -> C2Tuple_OutPointScriptZ { orig.clone() } +#[no_mangle] +pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ { + C2Tuple_OutPointScriptZ { a, b, } +} + +#[no_mangle] +pub extern "C" fn C2Tuple_OutPointScriptZ_free(_res: C2Tuple_OutPointScriptZ) { } #[repr(C)] -pub struct CVec_MessageSendEventZ { - pub data: *mut crate::util::events::MessageSendEvent, +pub struct CVec_TransactionZ { + pub data: *mut crate::c_types::Transaction, pub datalen: usize } -impl CVec_MessageSendEventZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_TransactionZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::MessageSendEvent] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Transaction] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_MessageSendEventZ { - fn from(v: Vec) -> Self { +impl From> for CVec_TransactionZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_MessageSendEventZ_free(_res: CVec_MessageSendEventZ) { } -impl Drop for CVec_MessageSendEventZ { +pub extern "C" fn CVec_TransactionZ_free(_res: CVec_TransactionZ) { } +impl Drop for CVec_TransactionZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -impl Clone for CVec_MessageSendEventZ { +#[repr(C)] +pub struct C2Tuple_u32TxOutZ { + pub a: u32, + pub b: crate::c_types::TxOut, +} +impl From<(u32, crate::c_types::TxOut)> for C2Tuple_u32TxOutZ { + fn from (tup: (u32, crate::c_types::TxOut)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_u32TxOutZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u32, crate::c_types::TxOut) { + (self.a, self.b) + } +} +impl Clone for C2Tuple_u32TxOutZ { fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) + Self { + a: self.a.clone(), + b: self.b.clone(), + } } } +#[no_mangle] +pub extern "C" fn C2Tuple_u32TxOutZ_clone(orig: &C2Tuple_u32TxOutZ) -> C2Tuple_u32TxOutZ { orig.clone() } +#[no_mangle] +pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2Tuple_u32TxOutZ { + C2Tuple_u32TxOutZ { a, b, } +} + +#[no_mangle] +pub extern "C" fn C2Tuple_u32TxOutZ_free(_res: C2Tuple_u32TxOutZ) { } #[repr(C)] -pub struct CVec_EventZ { - pub data: *mut crate::util::events::Event, +pub struct CVec_C2Tuple_u32TxOutZZ { + pub data: *mut crate::c_types::derived::C2Tuple_u32TxOutZ, pub datalen: usize } -impl CVec_EventZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_C2Tuple_u32TxOutZZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::util::events::Event] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_u32TxOutZ] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_EventZ { - fn from(v: Vec) -> Self { +impl From> for CVec_C2Tuple_u32TxOutZZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_EventZ_free(_res: CVec_EventZ) { } -impl Drop for CVec_EventZ { +pub extern "C" fn CVec_C2Tuple_u32TxOutZZ_free(_res: CVec_C2Tuple_u32TxOutZZ) { } +impl Drop for CVec_C2Tuple_u32TxOutZZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -impl Clone for CVec_EventZ { +impl Clone for CVec_C2Tuple_u32TxOutZZ { fn clone(&self) -> Self { let mut res = Vec::new(); if self.datalen == 0 { return Self::from(res); } @@ -119,96 +2956,123 @@ impl Clone for CVec_EventZ { } } #[repr(C)] -pub struct C2Tuple_usizeTransactionZ { - pub a: usize, - pub b: crate::c_types::Transaction, +pub struct C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { + pub a: crate::c_types::ThirtyTwoBytes, + pub b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ, } -impl From<(usize, crate::c_types::Transaction)> for C2Tuple_usizeTransactionZ { - fn from (tup: (usize, crate::c_types::Transaction)) -> Self { +impl From<(crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)> for C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { + fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)) -> Self { Self { a: tup.0, b: tup.1, } } } -impl C2Tuple_usizeTransactionZ { - #[allow(unused)] pub(crate) fn to_rust(mut self) -> (usize, crate::c_types::Transaction) { +impl C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) { (self.a, self.b) } } #[no_mangle] -pub extern "C" fn C2Tuple_usizeTransactionZ_new(a: usize, b: crate::c_types::Transaction) -> C2Tuple_usizeTransactionZ { - C2Tuple_usizeTransactionZ { a, b, } +pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) -> C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { + C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { a, b, } } #[no_mangle] -pub extern "C" fn C2Tuple_usizeTransactionZ_free(_res: C2Tuple_usizeTransactionZ) { } +pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) { } #[repr(C)] -pub struct CVec_C2Tuple_usizeTransactionZZ { - pub data: *mut crate::c_types::derived::C2Tuple_usizeTransactionZ, +pub struct CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { + pub data: *mut crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ, pub datalen: usize } -impl CVec_C2Tuple_usizeTransactionZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_usizeTransactionZ] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_C2Tuple_usizeTransactionZZ { - fn from(v: Vec) -> Self { +impl From> for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_C2Tuple_usizeTransactionZZ_free(_res: CVec_C2Tuple_usizeTransactionZZ) { } -impl Drop for CVec_C2Tuple_usizeTransactionZZ { +pub extern "C" fn CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ) { } +impl Drop for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } #[repr(C)] -pub union CResult_NoneChannelMonitorUpdateErrZPtr { - /// Note that this value is always NULL, as there are no contents in the OK variant - pub result: *mut std::ffi::c_void, - pub err: *mut crate::chain::channelmonitor::ChannelMonitorUpdateErr, +pub struct C2Tuple_BlockHashChannelMonitorZ { + pub a: crate::c_types::ThirtyTwoBytes, + pub b: crate::chain::channelmonitor::ChannelMonitor, +} +impl From<(crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)> for C2Tuple_BlockHashChannelMonitorZ { + fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)) -> Self { + Self { + a: tup.0, + b: tup.1, + } + } +} +impl C2Tuple_BlockHashChannelMonitorZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor) { + (self.a, self.b) + } +} +#[no_mangle] +pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::chain::channelmonitor::ChannelMonitor) -> C2Tuple_BlockHashChannelMonitorZ { + C2Tuple_BlockHashChannelMonitorZ { a, b, } } + +#[no_mangle] +pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_free(_res: C2Tuple_BlockHashChannelMonitorZ) { } #[repr(C)] -pub struct CResult_NoneChannelMonitorUpdateErrZ { - pub contents: CResult_NoneChannelMonitorUpdateErrZPtr, +pub union CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { + pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, + pub err: *mut crate::ln::msgs::DecodeError, +} +#[repr(C)] +pub struct CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + pub contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ { - CResult_NoneChannelMonitorUpdateErrZ { - contents: CResult_NoneChannelMonitorUpdateErrZPtr { - result: std::ptr::null_mut(), +pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_err(e: crate::chain::channelmonitor::ChannelMonitorUpdateErr) -> CResult_NoneChannelMonitorUpdateErrZ { - CResult_NoneChannelMonitorUpdateErrZ { - contents: CResult_NoneChannelMonitorUpdateErrZPtr { +pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_free(_res: CResult_NoneChannelMonitorUpdateErrZ) { } -impl Drop for CResult_NoneChannelMonitorUpdateErrZ { +pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ) { } +impl Drop for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { fn drop(&mut self) { if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } } else { if unsafe { !(self.contents.err as *mut ()).is_null() } { let _ = unsafe { Box::from_raw(self.contents.err) }; @@ -216,16 +3080,16 @@ impl Drop for CResult_NoneChannelMonitorUpdateErrZ { } } } -impl From> for CResult_NoneChannelMonitorUpdateErrZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { - let _ = unsafe { Box::from_raw(o.contents.result) }; - o.contents.result = std::ptr::null_mut(); - CResult_NoneChannelMonitorUpdateErrZPtr { result: std::ptr::null_mut() } + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NoneChannelMonitorUpdateErrZPtr { err } + CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { err } }; Self { contents, @@ -233,54 +3097,39 @@ impl From Self { - if self.result_ok { - Self { result_ok: true, contents: CResult_NoneChannelMonitorUpdateErrZPtr { - result: std::ptr::null_mut() - } } - } else { - Self { result_ok: false, contents: CResult_NoneChannelMonitorUpdateErrZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) - } } - } - } -} -#[no_mangle] -pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_clone(orig: &CResult_NoneChannelMonitorUpdateErrZ) -> CResult_NoneChannelMonitorUpdateErrZ { orig.clone() } #[repr(C)] -pub struct CVec_MonitorEventZ { - pub data: *mut crate::chain::channelmonitor::MonitorEvent, +pub struct CVec_SpendableOutputDescriptorZ { + pub data: *mut crate::chain::keysinterface::SpendableOutputDescriptor, pub datalen: usize } -impl CVec_MonitorEventZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_SpendableOutputDescriptorZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::MonitorEvent] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::keysinterface::SpendableOutputDescriptor] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_MonitorEventZ { - fn from(v: Vec) -> Self { +impl From> for CVec_SpendableOutputDescriptorZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_MonitorEventZ_free(_res: CVec_MonitorEventZ) { } -impl Drop for CVec_MonitorEventZ { +pub extern "C" fn CVec_SpendableOutputDescriptorZ_free(_res: CVec_SpendableOutputDescriptorZ) { } +impl Drop for CVec_SpendableOutputDescriptorZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -impl Clone for CVec_MonitorEventZ { +impl Clone for CVec_SpendableOutputDescriptorZ { fn clone(&self) -> Self { let mut res = Vec::new(); if self.datalen == 0 { return Self::from(res); } @@ -289,36 +3138,36 @@ impl Clone for CVec_MonitorEventZ { } } #[repr(C)] -pub union CResult_ChannelMonitorUpdateDecodeErrorZPtr { - pub result: *mut crate::chain::channelmonitor::ChannelMonitorUpdate, - pub err: *mut crate::ln::msgs::DecodeError, +pub union CResult_TxOutAccessErrorZPtr { + pub result: *mut crate::c_types::TxOut, + pub err: *mut crate::chain::AccessError, } #[repr(C)] -pub struct CResult_ChannelMonitorUpdateDecodeErrorZ { - pub contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr, +pub struct CResult_TxOutAccessErrorZ { + pub contents: CResult_TxOutAccessErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: crate::chain::channelmonitor::ChannelMonitorUpdate) -> CResult_ChannelMonitorUpdateDecodeErrorZ { - CResult_ChannelMonitorUpdateDecodeErrorZ { - contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { +pub extern "C" fn CResult_TxOutAccessErrorZ_ok(o: crate::c_types::TxOut) -> CResult_TxOutAccessErrorZ { + CResult_TxOutAccessErrorZ { + contents: CResult_TxOutAccessErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelMonitorUpdateDecodeErrorZ { - CResult_ChannelMonitorUpdateDecodeErrorZ { - contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { +pub extern "C" fn CResult_TxOutAccessErrorZ_err(e: crate::chain::AccessError) -> CResult_TxOutAccessErrorZ { + CResult_TxOutAccessErrorZ { + contents: CResult_TxOutAccessErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: CResult_ChannelMonitorUpdateDecodeErrorZ) { } -impl Drop for CResult_ChannelMonitorUpdateDecodeErrorZ { +pub extern "C" fn CResult_TxOutAccessErrorZ_free(_res: CResult_TxOutAccessErrorZ) { } +impl Drop for CResult_TxOutAccessErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -331,16 +3180,16 @@ impl Drop for CResult_ChannelMonitorUpdateDecodeErrorZ { } } } -impl From> for CResult_ChannelMonitorUpdateDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_TxOutAccessErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_ChannelMonitorUpdateDecodeErrorZPtr { result } + CResult_TxOutAccessErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_ChannelMonitorUpdateDecodeErrorZPtr { err } + CResult_TxOutAccessErrorZPtr { err } }; Self { contents, @@ -348,53 +3197,53 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_TxOutAccessErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_ChannelMonitorUpdateDecodeErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_TxOutAccessErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: &CResult_ChannelMonitorUpdateDecodeErrorZ) -> CResult_ChannelMonitorUpdateDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_TxOutAccessErrorZ_clone(orig: &CResult_TxOutAccessErrorZ) -> CResult_TxOutAccessErrorZ { orig.clone() } #[repr(C)] -pub union CResult_NoneMonitorUpdateErrorZPtr { +pub union CResult_NoneAPIErrorZPtr { /// Note that this value is always NULL, as there are no contents in the OK variant pub result: *mut std::ffi::c_void, - pub err: *mut crate::chain::channelmonitor::MonitorUpdateError, + pub err: *mut crate::util::errors::APIError, } #[repr(C)] -pub struct CResult_NoneMonitorUpdateErrorZ { - pub contents: CResult_NoneMonitorUpdateErrorZPtr, +pub struct CResult_NoneAPIErrorZ { + pub contents: CResult_NoneAPIErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ { - CResult_NoneMonitorUpdateErrorZ { - contents: CResult_NoneMonitorUpdateErrorZPtr { +pub extern "C" fn CResult_NoneAPIErrorZ_ok() -> CResult_NoneAPIErrorZ { + CResult_NoneAPIErrorZ { + contents: CResult_NoneAPIErrorZPtr { result: std::ptr::null_mut(), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_err(e: crate::chain::channelmonitor::MonitorUpdateError) -> CResult_NoneMonitorUpdateErrorZ { - CResult_NoneMonitorUpdateErrorZ { - contents: CResult_NoneMonitorUpdateErrorZPtr { +pub extern "C" fn CResult_NoneAPIErrorZ_err(e: crate::util::errors::APIError) -> CResult_NoneAPIErrorZ { + CResult_NoneAPIErrorZ { + contents: CResult_NoneAPIErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_free(_res: CResult_NoneMonitorUpdateErrorZ) { } -impl Drop for CResult_NoneMonitorUpdateErrorZ { +pub extern "C" fn CResult_NoneAPIErrorZ_free(_res: CResult_NoneAPIErrorZ) { } +impl Drop for CResult_NoneAPIErrorZ { fn drop(&mut self) { if self.result_ok { } else { @@ -404,16 +3253,16 @@ impl Drop for CResult_NoneMonitorUpdateErrorZ { } } } -impl From> for CResult_NoneMonitorUpdateErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_NoneAPIErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let _ = unsafe { Box::from_raw(o.contents.result) }; o.contents.result = std::ptr::null_mut(); - CResult_NoneMonitorUpdateErrorZPtr { result: std::ptr::null_mut() } + CResult_NoneAPIErrorZPtr { result: std::ptr::null_mut() } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NoneMonitorUpdateErrorZPtr { err } + CResult_NoneAPIErrorZPtr { err } }; Self { contents, @@ -421,266 +3270,222 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_NoneMonitorUpdateErrorZPtr { + Self { result_ok: true, contents: CResult_NoneAPIErrorZPtr { result: std::ptr::null_mut() } } } else { - Self { result_ok: false, contents: CResult_NoneMonitorUpdateErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_NoneAPIErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_clone(orig: &CResult_NoneMonitorUpdateErrorZ) -> CResult_NoneMonitorUpdateErrorZ { orig.clone() } -#[repr(C)] -pub struct C2Tuple_OutPointScriptZ { - pub a: crate::chain::transaction::OutPoint, - pub b: crate::c_types::derived::CVec_u8Z, -} -impl From<(crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)> for C2Tuple_OutPointScriptZ { - fn from (tup: (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z)) -> Self { - Self { - a: tup.0, - b: tup.1, - } - } -} -impl C2Tuple_OutPointScriptZ { - #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::chain::transaction::OutPoint, crate::c_types::derived::CVec_u8Z) { - (self.a, self.b) - } -} -#[no_mangle] -pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutPoint, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_OutPointScriptZ { - C2Tuple_OutPointScriptZ { a, b, } -} - -#[no_mangle] -pub extern "C" fn C2Tuple_OutPointScriptZ_free(_res: C2Tuple_OutPointScriptZ) { } +pub extern "C" fn CResult_NoneAPIErrorZ_clone(orig: &CResult_NoneAPIErrorZ) -> CResult_NoneAPIErrorZ { orig.clone() } #[repr(C)] -pub struct CVec_TransactionZ { - pub data: *mut crate::c_types::Transaction, +pub struct CVec_ChannelDetailsZ { + pub data: *mut crate::ln::channelmanager::ChannelDetails, pub datalen: usize } -impl CVec_TransactionZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_ChannelDetailsZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Transaction] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::channelmanager::ChannelDetails] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_TransactionZ { - fn from(v: Vec) -> Self { +impl From> for CVec_ChannelDetailsZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_TransactionZ_free(_res: CVec_TransactionZ) { } -impl Drop for CVec_TransactionZ { +pub extern "C" fn CVec_ChannelDetailsZ_free(_res: CVec_ChannelDetailsZ) { } +impl Drop for CVec_ChannelDetailsZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -#[repr(C)] -pub struct C2Tuple_u32TxOutZ { - pub a: u32, - pub b: crate::c_types::TxOut, -} -impl From<(u32, crate::c_types::TxOut)> for C2Tuple_u32TxOutZ { - fn from (tup: (u32, crate::c_types::TxOut)) -> Self { - Self { - a: tup.0, - b: tup.1, - } - } -} -impl C2Tuple_u32TxOutZ { - #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u32, crate::c_types::TxOut) { - (self.a, self.b) - } -} -impl Clone for C2Tuple_u32TxOutZ { +impl Clone for CVec_ChannelDetailsZ { fn clone(&self) -> Self { - Self { - a: self.a.clone(), - b: self.b.clone(), - } + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) } } -#[no_mangle] -pub extern "C" fn C2Tuple_u32TxOutZ_clone(orig: &C2Tuple_u32TxOutZ) -> C2Tuple_u32TxOutZ { orig.clone() } -#[no_mangle] -pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2Tuple_u32TxOutZ { - C2Tuple_u32TxOutZ { a, b, } +#[repr(C)] +pub union CResult_NonePaymentSendFailureZPtr { + /// Note that this value is always NULL, as there are no contents in the OK variant + pub result: *mut std::ffi::c_void, + pub err: *mut crate::ln::channelmanager::PaymentSendFailure, } - -#[no_mangle] -pub extern "C" fn C2Tuple_u32TxOutZ_free(_res: C2Tuple_u32TxOutZ) { } #[repr(C)] -pub struct CVec_C2Tuple_u32TxOutZZ { - pub data: *mut crate::c_types::derived::C2Tuple_u32TxOutZ, - pub datalen: usize +pub struct CResult_NonePaymentSendFailureZ { + pub contents: CResult_NonePaymentSendFailureZPtr, + pub result_ok: bool, } -impl CVec_C2Tuple_u32TxOutZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_u32TxOutZ] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } +#[no_mangle] +pub extern "C" fn CResult_NonePaymentSendFailureZ_ok() -> CResult_NonePaymentSendFailureZ { + CResult_NonePaymentSendFailureZ { + contents: CResult_NonePaymentSendFailureZPtr { + result: std::ptr::null_mut(), + }, + result_ok: true, } } -impl From> for CVec_C2Tuple_u32TxOutZZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } +#[no_mangle] +pub extern "C" fn CResult_NonePaymentSendFailureZ_err(e: crate::ln::channelmanager::PaymentSendFailure) -> CResult_NonePaymentSendFailureZ { + CResult_NonePaymentSendFailureZ { + contents: CResult_NonePaymentSendFailureZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, } } #[no_mangle] -pub extern "C" fn CVec_C2Tuple_u32TxOutZZ_free(_res: CVec_C2Tuple_u32TxOutZZ) { } -impl Drop for CVec_C2Tuple_u32TxOutZZ { +pub extern "C" fn CResult_NonePaymentSendFailureZ_free(_res: CResult_NonePaymentSendFailureZ) { } +impl Drop for CResult_NonePaymentSendFailureZ { fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -impl Clone for CVec_C2Tuple_u32TxOutZZ { - fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) + if self.result_ok { + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } } } -#[repr(C)] -pub struct C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { - pub a: crate::c_types::ThirtyTwoBytes, - pub b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ, -} -impl From<(crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)> for C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { - fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ)) -> Self { +impl From> for CResult_NonePaymentSendFailureZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let _ = unsafe { Box::from_raw(o.contents.result) }; + o.contents.result = std::ptr::null_mut(); + CResult_NonePaymentSendFailureZPtr { result: std::ptr::null_mut() } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NonePaymentSendFailureZPtr { err } + }; Self { - a: tup.0, - b: tup.1, + contents, + result_ok: o.result_ok, } } } -impl C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { - #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) { - (self.a, self.b) +impl Clone for CResult_NonePaymentSendFailureZ { + fn clone(&self) -> Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_NonePaymentSendFailureZPtr { + result: std::ptr::null_mut() + } } + } else { + Self { result_ok: false, contents: CResult_NonePaymentSendFailureZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } } } #[no_mangle] -pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) -> C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { - C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { a, b, } -} - -#[no_mangle] -pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) { } +pub extern "C" fn CResult_NonePaymentSendFailureZ_clone(orig: &CResult_NonePaymentSendFailureZ) -> CResult_NonePaymentSendFailureZ { orig.clone() } #[repr(C)] -pub struct CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { - pub data: *mut crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ, +pub struct CVec_ChannelMonitorZ { + pub data: *mut crate::chain::channelmonitor::ChannelMonitor, pub datalen: usize } -impl CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_ChannelMonitorZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::ChannelMonitor] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { - fn from(v: Vec) -> Self { +impl From> for CVec_ChannelMonitorZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ) { } -impl Drop for CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ { +pub extern "C" fn CVec_ChannelMonitorZ_free(_res: CVec_ChannelMonitorZ) { } +impl Drop for CVec_ChannelMonitorZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } #[repr(C)] -pub struct C2Tuple_BlockHashChannelMonitorZ { +pub struct C2Tuple_BlockHashChannelManagerZ { pub a: crate::c_types::ThirtyTwoBytes, - pub b: crate::chain::channelmonitor::ChannelMonitor, + pub b: crate::ln::channelmanager::ChannelManager, } -impl From<(crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)> for C2Tuple_BlockHashChannelMonitorZ { - fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor)) -> Self { +impl From<(crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)> for C2Tuple_BlockHashChannelManagerZ { + fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)) -> Self { Self { a: tup.0, b: tup.1, } } } -impl C2Tuple_BlockHashChannelMonitorZ { - #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::chain::channelmonitor::ChannelMonitor) { +impl C2Tuple_BlockHashChannelManagerZ { + #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager) { (self.a, self.b) } } #[no_mangle] -pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::chain::channelmonitor::ChannelMonitor) -> C2Tuple_BlockHashChannelMonitorZ { - C2Tuple_BlockHashChannelMonitorZ { a, b, } +pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::ln::channelmanager::ChannelManager) -> C2Tuple_BlockHashChannelManagerZ { + C2Tuple_BlockHashChannelManagerZ { a, b, } } #[no_mangle] -pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_free(_res: C2Tuple_BlockHashChannelMonitorZ) { } +pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_free(_res: C2Tuple_BlockHashChannelManagerZ) { } #[repr(C)] -pub union CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { - pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, +pub union CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { + pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - pub contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr, +pub struct CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + pub contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { +pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - contents: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { +pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ) { } -impl Drop for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { +pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ) { } +impl Drop for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -693,16 +3498,16 @@ impl Drop for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { } } } -impl From> for CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { result } + CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { err } + CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { err } }; Self { contents, @@ -786,46 +3591,6 @@ impl Clone for CResult_SpendableOutputDescriptorDecodeErrorZ { #[no_mangle] pub extern "C" fn CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig: &CResult_SpendableOutputDescriptorDecodeErrorZ) -> CResult_SpendableOutputDescriptorDecodeErrorZ { orig.clone() } #[repr(C)] -pub struct CVec_SignatureZ { - pub data: *mut crate::c_types::Signature, - pub datalen: usize -} -impl CVec_SignatureZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Signature] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_SignatureZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_SignatureZ_free(_res: CVec_SignatureZ) { } -impl Drop for CVec_SignatureZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -impl Clone for CVec_SignatureZ { - fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) - } -} -#[repr(C)] pub struct C2Tuple_SignatureCVec_SignatureZZ { pub a: crate::c_types::Signature, pub b: crate::c_types::derived::CVec_SignatureZ, @@ -1007,36 +3772,36 @@ impl Clone for CResult_SignatureNoneZ { #[no_mangle] pub extern "C" fn CResult_SignatureNoneZ_clone(orig: &CResult_SignatureNoneZ) -> CResult_SignatureNoneZ { orig.clone() } #[repr(C)] -pub union CResult_ChanKeySignerDecodeErrorZPtr { +pub union CResult_ChannelKeysDecodeErrorZPtr { pub result: *mut crate::chain::keysinterface::ChannelKeys, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_ChanKeySignerDecodeErrorZ { - pub contents: CResult_ChanKeySignerDecodeErrorZPtr, +pub struct CResult_ChannelKeysDecodeErrorZ { + pub contents: CResult_ChannelKeysDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_ok(o: crate::chain::keysinterface::ChannelKeys) -> CResult_ChanKeySignerDecodeErrorZ { - CResult_ChanKeySignerDecodeErrorZ { - contents: CResult_ChanKeySignerDecodeErrorZPtr { +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_ok(o: crate::chain::keysinterface::ChannelKeys) -> CResult_ChannelKeysDecodeErrorZ { + CResult_ChannelKeysDecodeErrorZ { + contents: CResult_ChannelKeysDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChanKeySignerDecodeErrorZ { - CResult_ChanKeySignerDecodeErrorZ { - contents: CResult_ChanKeySignerDecodeErrorZPtr { +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelKeysDecodeErrorZ { + CResult_ChannelKeysDecodeErrorZ { + contents: CResult_ChannelKeysDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_free(_res: CResult_ChanKeySignerDecodeErrorZ) { } -impl Drop for CResult_ChanKeySignerDecodeErrorZ { +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_free(_res: CResult_ChannelKeysDecodeErrorZ) { } +impl Drop for CResult_ChannelKeysDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -1049,16 +3814,16 @@ impl Drop for CResult_ChanKeySignerDecodeErrorZ { } } } -impl From> for CResult_ChanKeySignerDecodeErrorZ { +impl From> for CResult_ChannelKeysDecodeErrorZ { fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_ChanKeySignerDecodeErrorZPtr { result } + CResult_ChannelKeysDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_ChanKeySignerDecodeErrorZPtr { err } + CResult_ChannelKeysDecodeErrorZPtr { err } }; Self { contents, @@ -1066,21 +3831,21 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_ChanKeySignerDecodeErrorZPtr { + Self { result_ok: true, contents: CResult_ChannelKeysDecodeErrorZPtr { result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_ChanKeySignerDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_ChannelKeysDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_clone(orig: &CResult_ChanKeySignerDecodeErrorZ) -> CResult_ChanKeySignerDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_clone(orig: &CResult_ChannelKeysDecodeErrorZ) -> CResult_ChannelKeysDecodeErrorZ { orig.clone() } #[repr(C)] pub union CResult_InMemoryChannelKeysDecodeErrorZPtr { pub result: *mut crate::chain::keysinterface::InMemoryChannelKeys, @@ -1157,186 +3922,78 @@ impl Clone for CResult_InMemoryChannelKeysDecodeErrorZ { #[no_mangle] pub extern "C" fn CResult_InMemoryChannelKeysDecodeErrorZ_clone(orig: &CResult_InMemoryChannelKeysDecodeErrorZ) -> CResult_InMemoryChannelKeysDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_TxOutAccessErrorZPtr { - pub result: *mut crate::c_types::TxOut, - pub err: *mut crate::chain::AccessError, -} -#[repr(C)] -pub struct CResult_TxOutAccessErrorZ { - pub contents: CResult_TxOutAccessErrorZPtr, - pub result_ok: bool, -} -#[no_mangle] -pub extern "C" fn CResult_TxOutAccessErrorZ_ok(o: crate::c_types::TxOut) -> CResult_TxOutAccessErrorZ { - CResult_TxOutAccessErrorZ { - contents: CResult_TxOutAccessErrorZPtr { - result: Box::into_raw(Box::new(o)), - }, - result_ok: true, - } -} -#[no_mangle] -pub extern "C" fn CResult_TxOutAccessErrorZ_err(e: crate::chain::AccessError) -> CResult_TxOutAccessErrorZ { - CResult_TxOutAccessErrorZ { - contents: CResult_TxOutAccessErrorZPtr { - err: Box::into_raw(Box::new(e)), - }, - result_ok: false, - } -} -#[no_mangle] -pub extern "C" fn CResult_TxOutAccessErrorZ_free(_res: CResult_TxOutAccessErrorZ) { } -impl Drop for CResult_TxOutAccessErrorZ { - fn drop(&mut self) { - if self.result_ok { - if unsafe { !(self.contents.result as *mut ()).is_null() } { - let _ = unsafe { Box::from_raw(self.contents.result) }; - } - } else { - if unsafe { !(self.contents.err as *mut ()).is_null() } { - let _ = unsafe { Box::from_raw(self.contents.err) }; - } - } - } -} -impl From> for CResult_TxOutAccessErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { - let contents = if o.result_ok { - let result = unsafe { o.contents.result }; - unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_TxOutAccessErrorZPtr { result } - } else { - let err = unsafe { o.contents.err }; - unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_TxOutAccessErrorZPtr { err } - }; - Self { - contents, - result_ok: o.result_ok, - } - } +pub struct CVec_RouteHopZ { + pub data: *mut crate::routing::router::RouteHop, + pub datalen: usize } -impl Clone for CResult_TxOutAccessErrorZ { - fn clone(&self) -> Self { - if self.result_ok { - Self { result_ok: true, contents: CResult_TxOutAccessErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) - } } - } else { - Self { result_ok: false, contents: CResult_TxOutAccessErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) - } } - } +impl CVec_RouteHopZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { + if self.datalen == 0 { return Vec::new(); } + let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); + self.data = std::ptr::null_mut(); + self.datalen = 0; + ret } -} -#[no_mangle] -pub extern "C" fn CResult_TxOutAccessErrorZ_clone(orig: &CResult_TxOutAccessErrorZ) -> CResult_TxOutAccessErrorZ { orig.clone() } -#[repr(C)] -pub union CResult_NoneAPIErrorZPtr { - /// Note that this value is always NULL, as there are no contents in the OK variant - pub result: *mut std::ffi::c_void, - pub err: *mut crate::util::errors::APIError, -} -#[repr(C)] -pub struct CResult_NoneAPIErrorZ { - pub contents: CResult_NoneAPIErrorZPtr, - pub result_ok: bool, -} -#[no_mangle] -pub extern "C" fn CResult_NoneAPIErrorZ_ok() -> CResult_NoneAPIErrorZ { - CResult_NoneAPIErrorZ { - contents: CResult_NoneAPIErrorZPtr { - result: std::ptr::null_mut(), - }, - result_ok: true, + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHop] { + unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -#[no_mangle] -pub extern "C" fn CResult_NoneAPIErrorZ_err(e: crate::util::errors::APIError) -> CResult_NoneAPIErrorZ { - CResult_NoneAPIErrorZ { - contents: CResult_NoneAPIErrorZPtr { - err: Box::into_raw(Box::new(e)), - }, - result_ok: false, +impl From> for CVec_RouteHopZ { + fn from(v: Vec) -> Self { + let datalen = v.len(); + let data = Box::into_raw(v.into_boxed_slice()); + Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CResult_NoneAPIErrorZ_free(_res: CResult_NoneAPIErrorZ) { } -impl Drop for CResult_NoneAPIErrorZ { +pub extern "C" fn CVec_RouteHopZ_free(_res: CVec_RouteHopZ) { } +impl Drop for CVec_RouteHopZ { fn drop(&mut self) { - if self.result_ok { - } else { - if unsafe { !(self.contents.err as *mut ()).is_null() } { - let _ = unsafe { Box::from_raw(self.contents.err) }; - } - } - } -} -impl From> for CResult_NoneAPIErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { - let contents = if o.result_ok { - let _ = unsafe { Box::from_raw(o.contents.result) }; - o.contents.result = std::ptr::null_mut(); - CResult_NoneAPIErrorZPtr { result: std::ptr::null_mut() } - } else { - let err = unsafe { o.contents.err }; - unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NoneAPIErrorZPtr { err } - }; - Self { - contents, - result_ok: o.result_ok, - } + if self.datalen == 0 { return; } + unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -impl Clone for CResult_NoneAPIErrorZ { - fn clone(&self) -> Self { - if self.result_ok { - Self { result_ok: true, contents: CResult_NoneAPIErrorZPtr { - result: std::ptr::null_mut() - } } - } else { - Self { result_ok: false, contents: CResult_NoneAPIErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) - } } - } +impl Clone for CVec_RouteHopZ { + fn clone(&self) -> Self { + let mut res = Vec::new(); + if self.datalen == 0 { return Self::from(res); } + res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); + Self::from(res) } } -#[no_mangle] -pub extern "C" fn CResult_NoneAPIErrorZ_clone(orig: &CResult_NoneAPIErrorZ) -> CResult_NoneAPIErrorZ { orig.clone() } #[repr(C)] -pub struct CVec_ChannelDetailsZ { - pub data: *mut crate::ln::channelmanager::ChannelDetails, +pub struct CVec_CVec_RouteHopZZ { + pub data: *mut crate::c_types::derived::CVec_RouteHopZ, pub datalen: usize } -impl CVec_ChannelDetailsZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_CVec_RouteHopZZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::channelmanager::ChannelDetails] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_RouteHopZ] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_ChannelDetailsZ { - fn from(v: Vec) -> Self { +impl From> for CVec_CVec_RouteHopZZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_ChannelDetailsZ_free(_res: CVec_ChannelDetailsZ) { } -impl Drop for CVec_ChannelDetailsZ { +pub extern "C" fn CVec_CVec_RouteHopZZ_free(_res: CVec_CVec_RouteHopZZ) { } +impl Drop for CVec_CVec_RouteHopZZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -impl Clone for CVec_ChannelDetailsZ { +impl Clone for CVec_CVec_RouteHopZZ { fn clone(&self) -> Self { let mut res = Vec::new(); if self.datalen == 0 { return Self::from(res); } @@ -1345,39 +4002,41 @@ impl Clone for CVec_ChannelDetailsZ { } } #[repr(C)] -pub union CResult_NonePaymentSendFailureZPtr { - /// Note that this value is always NULL, as there are no contents in the OK variant - pub result: *mut std::ffi::c_void, - pub err: *mut crate::ln::channelmanager::PaymentSendFailure, +pub union CResult_RouteDecodeErrorZPtr { + pub result: *mut crate::routing::router::Route, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_NonePaymentSendFailureZ { - pub contents: CResult_NonePaymentSendFailureZPtr, +pub struct CResult_RouteDecodeErrorZ { + pub contents: CResult_RouteDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NonePaymentSendFailureZ_ok() -> CResult_NonePaymentSendFailureZ { - CResult_NonePaymentSendFailureZ { - contents: CResult_NonePaymentSendFailureZPtr { - result: std::ptr::null_mut(), +pub extern "C" fn CResult_RouteDecodeErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteDecodeErrorZ { + CResult_RouteDecodeErrorZ { + contents: CResult_RouteDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NonePaymentSendFailureZ_err(e: crate::ln::channelmanager::PaymentSendFailure) -> CResult_NonePaymentSendFailureZ { - CResult_NonePaymentSendFailureZ { - contents: CResult_NonePaymentSendFailureZPtr { +pub extern "C" fn CResult_RouteDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RouteDecodeErrorZ { + CResult_RouteDecodeErrorZ { + contents: CResult_RouteDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NonePaymentSendFailureZ_free(_res: CResult_NonePaymentSendFailureZ) { } -impl Drop for CResult_NonePaymentSendFailureZ { +pub extern "C" fn CResult_RouteDecodeErrorZ_free(_res: CResult_RouteDecodeErrorZ) { } +impl Drop for CResult_RouteDecodeErrorZ { fn drop(&mut self) { if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } } else { if unsafe { !(self.contents.err as *mut ()).is_null() } { let _ = unsafe { Box::from_raw(self.contents.err) }; @@ -1385,16 +4044,16 @@ impl Drop for CResult_NonePaymentSendFailureZ { } } } -impl From> for CResult_NonePaymentSendFailureZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_RouteDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { - let _ = unsafe { Box::from_raw(o.contents.result) }; - o.contents.result = std::ptr::null_mut(); - CResult_NonePaymentSendFailureZPtr { result: std::ptr::null_mut() } + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_RouteDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NonePaymentSendFailureZPtr { err } + CResult_RouteDecodeErrorZPtr { err } }; Self { contents, @@ -1402,54 +4061,54 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_NonePaymentSendFailureZPtr { - result: std::ptr::null_mut() + Self { result_ok: true, contents: CResult_RouteDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_NonePaymentSendFailureZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_RouteDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_NonePaymentSendFailureZ_clone(orig: &CResult_NonePaymentSendFailureZ) -> CResult_NonePaymentSendFailureZ { orig.clone() } +pub extern "C" fn CResult_RouteDecodeErrorZ_clone(orig: &CResult_RouteDecodeErrorZ) -> CResult_RouteDecodeErrorZ { orig.clone() } #[repr(C)] -pub struct CVec_NetAddressZ { - pub data: *mut crate::ln::msgs::NetAddress, +pub struct CVec_RouteHintZ { + pub data: *mut crate::routing::router::RouteHint, pub datalen: usize } -impl CVec_NetAddressZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { +impl CVec_RouteHintZ { + #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; ret } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NetAddress] { + #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHint] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } -impl From> for CVec_NetAddressZ { - fn from(v: Vec) -> Self { +impl From> for CVec_RouteHintZ { + fn from(v: Vec) -> Self { let datalen = v.len(); let data = Box::into_raw(v.into_boxed_slice()); Self { datalen, data: unsafe { (*data).as_mut_ptr() } } } } #[no_mangle] -pub extern "C" fn CVec_NetAddressZ_free(_res: CVec_NetAddressZ) { } -impl Drop for CVec_NetAddressZ { +pub extern "C" fn CVec_RouteHintZ_free(_res: CVec_RouteHintZ) { } +impl Drop for CVec_RouteHintZ { fn drop(&mut self) { if self.datalen == 0 { return; } unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; } } -impl Clone for CVec_NetAddressZ { +impl Clone for CVec_RouteHintZ { fn clone(&self) -> Self { let mut res = Vec::new(); if self.datalen == 0 { return Self::from(res); } @@ -1458,93 +4117,36 @@ impl Clone for CVec_NetAddressZ { } } #[repr(C)] -pub struct CVec_ChannelMonitorZ { - pub data: *mut crate::chain::channelmonitor::ChannelMonitor, - pub datalen: usize -} -impl CVec_ChannelMonitorZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::chain::channelmonitor::ChannelMonitor] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_ChannelMonitorZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_ChannelMonitorZ_free(_res: CVec_ChannelMonitorZ) { } -impl Drop for CVec_ChannelMonitorZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -#[repr(C)] -pub struct C2Tuple_BlockHashChannelManagerZ { - pub a: crate::c_types::ThirtyTwoBytes, - pub b: crate::ln::channelmanager::ChannelManager, -} -impl From<(crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)> for C2Tuple_BlockHashChannelManagerZ { - fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager)) -> Self { - Self { - a: tup.0, - b: tup.1, - } - } -} -impl C2Tuple_BlockHashChannelManagerZ { - #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::ln::channelmanager::ChannelManager) { - (self.a, self.b) - } -} -#[no_mangle] -pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::ln::channelmanager::ChannelManager) -> C2Tuple_BlockHashChannelManagerZ { - C2Tuple_BlockHashChannelManagerZ { a, b, } -} - -#[no_mangle] -pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_free(_res: C2Tuple_BlockHashChannelManagerZ) { } -#[repr(C)] -pub union CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { - pub result: *mut crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, - pub err: *mut crate::ln::msgs::DecodeError, +pub union CResult_RouteLightningErrorZPtr { + pub result: *mut crate::routing::router::Route, + pub err: *mut crate::ln::msgs::LightningError, } #[repr(C)] -pub struct CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - pub contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr, +pub struct CResult_RouteLightningErrorZ { + pub contents: CResult_RouteLightningErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { +pub extern "C" fn CResult_RouteLightningErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteLightningErrorZ { + CResult_RouteLightningErrorZ { + contents: CResult_RouteLightningErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - contents: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { +pub extern "C" fn CResult_RouteLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_RouteLightningErrorZ { + CResult_RouteLightningErrorZ { + contents: CResult_RouteLightningErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ) { } -impl Drop for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { +pub extern "C" fn CResult_RouteLightningErrorZ_free(_res: CResult_RouteLightningErrorZ) { } +impl Drop for CResult_RouteLightningErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -1557,16 +4159,16 @@ impl Drop for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { } } } -impl From> for CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_RouteLightningErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result } + CResult_RouteLightningErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { err } + CResult_RouteLightningErrorZPtr { err } }; Self { contents, @@ -1574,6 +4176,21 @@ impl From Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_RouteLightningErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_RouteLightningErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_RouteLightningErrorZ_clone(orig: &CResult_RouteLightningErrorZ) -> CResult_RouteLightningErrorZ { orig.clone() } #[repr(C)] pub union CResult_NetAddressu8ZPtr { pub result: *mut crate::ln::msgs::NetAddress, @@ -1711,59 +4328,19 @@ impl From Self { - if self.result_ok { - Self { result_ok: true, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) - } } - } else { - Self { result_ok: false, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) - } } - } - } -} -#[no_mangle] -pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig: &CResult_CResult_NetAddressu8ZDecodeErrorZ) -> CResult_CResult_NetAddressu8ZDecodeErrorZ { orig.clone() } -#[repr(C)] -pub struct CVec_u64Z { - pub data: *mut u64, - pub datalen: usize -} -impl CVec_u64Z { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u64] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_u64Z { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_u64Z_free(_res: CVec_u64Z) { } -impl Drop for CVec_u64Z { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -impl Clone for CVec_u64Z { - fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) + if self.result_ok { + Self { result_ok: true, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_CResult_NetAddressu8ZDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } } } +#[no_mangle] +pub extern "C" fn CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig: &CResult_CResult_NetAddressu8ZDecodeErrorZ) -> CResult_CResult_NetAddressu8ZDecodeErrorZ { orig.clone() } #[repr(C)] pub struct CVec_UpdateAddHTLCZ { pub data: *mut crate::ln::msgs::UpdateAddHTLC, @@ -1925,36 +4502,36 @@ impl Clone for CVec_UpdateFailMalformedHTLCZ { } } #[repr(C)] -pub union CResult_boolLightningErrorZPtr { - pub result: *mut bool, - pub err: *mut crate::ln::msgs::LightningError, +pub union CResult_AcceptChannelDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::AcceptChannel, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_boolLightningErrorZ { - pub contents: CResult_boolLightningErrorZPtr, +pub struct CResult_AcceptChannelDecodeErrorZ { + pub contents: CResult_AcceptChannelDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_boolLightningErrorZ_ok(o: bool) -> CResult_boolLightningErrorZ { - CResult_boolLightningErrorZ { - contents: CResult_boolLightningErrorZPtr { +pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_ok(o: crate::ln::msgs::AcceptChannel) -> CResult_AcceptChannelDecodeErrorZ { + CResult_AcceptChannelDecodeErrorZ { + contents: CResult_AcceptChannelDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_boolLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_boolLightningErrorZ { - CResult_boolLightningErrorZ { - contents: CResult_boolLightningErrorZPtr { +pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AcceptChannelDecodeErrorZ { + CResult_AcceptChannelDecodeErrorZ { + contents: CResult_AcceptChannelDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_boolLightningErrorZ_free(_res: CResult_boolLightningErrorZ) { } -impl Drop for CResult_boolLightningErrorZ { +pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_free(_res: CResult_AcceptChannelDecodeErrorZ) { } +impl Drop for CResult_AcceptChannelDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -1967,16 +4544,16 @@ impl Drop for CResult_boolLightningErrorZ { } } } -impl From> for CResult_boolLightningErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_AcceptChannelDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_boolLightningErrorZPtr { result } + CResult_AcceptChannelDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_boolLightningErrorZPtr { err } + CResult_AcceptChannelDecodeErrorZPtr { err } }; Self { contents, @@ -1984,173 +4561,57 @@ impl From> f } } } -impl Clone for CResult_boolLightningErrorZ { +impl Clone for CResult_AcceptChannelDecodeErrorZ { fn clone(&self) -> Self { if self.result_ok { - Self { result_ok: true, contents: CResult_boolLightningErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_AcceptChannelDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_boolLightningErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_AcceptChannelDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_boolLightningErrorZ_clone(orig: &CResult_boolLightningErrorZ) -> CResult_boolLightningErrorZ { orig.clone() } -#[repr(C)] -pub struct C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - pub a: crate::ln::msgs::ChannelAnnouncement, - pub b: crate::ln::msgs::ChannelUpdate, - pub c: crate::ln::msgs::ChannelUpdate, -} -impl From<(crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)> for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - fn from (tup: (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate)) -> Self { - Self { - a: tup.0, - b: tup.1, - c: tup.2, - } - } -} -impl C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::ln::msgs::ChannelAnnouncement, crate::ln::msgs::ChannelUpdate, crate::ln::msgs::ChannelUpdate) { - (self.a, self.b, self.c) - } -} -impl Clone for C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - fn clone(&self) -> Self { - Self { - a: self.a.clone(), - b: self.b.clone(), - c: self.c.clone(), - } - } -} -#[no_mangle] -pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig: &C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { orig.clone() } -#[no_mangle] -pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: crate::ln::msgs::ChannelAnnouncement, b: crate::ln::msgs::ChannelUpdate, c: crate::ln::msgs::ChannelUpdate) -> C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { a, b, c, } -} - -#[no_mangle] -pub extern "C" fn C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) { } -#[repr(C)] -pub struct CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - pub data: *mut crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, - pub datalen: usize -} -impl CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res: CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ) { } -impl Drop for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -impl Clone for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { - fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) - } -} -#[repr(C)] -pub struct CVec_NodeAnnouncementZ { - pub data: *mut crate::ln::msgs::NodeAnnouncement, - pub datalen: usize -} -impl CVec_NodeAnnouncementZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::ln::msgs::NodeAnnouncement] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_NodeAnnouncementZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_NodeAnnouncementZ_free(_res: CVec_NodeAnnouncementZ) { } -impl Drop for CVec_NodeAnnouncementZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -impl Clone for CVec_NodeAnnouncementZ { - fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) - } -} +pub extern "C" fn CResult_AcceptChannelDecodeErrorZ_clone(orig: &CResult_AcceptChannelDecodeErrorZ) -> CResult_AcceptChannelDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_NoneLightningErrorZPtr { - /// Note that this value is always NULL, as there are no contents in the OK variant - pub result: *mut std::ffi::c_void, - pub err: *mut crate::ln::msgs::LightningError, +pub union CResult_AnnouncementSignaturesDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::AnnouncementSignatures, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_NoneLightningErrorZ { - pub contents: CResult_NoneLightningErrorZPtr, +pub struct CResult_AnnouncementSignaturesDecodeErrorZ { + pub contents: CResult_AnnouncementSignaturesDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NoneLightningErrorZ_ok() -> CResult_NoneLightningErrorZ { - CResult_NoneLightningErrorZ { - contents: CResult_NoneLightningErrorZPtr { - result: std::ptr::null_mut(), +pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_ok(o: crate::ln::msgs::AnnouncementSignatures) -> CResult_AnnouncementSignaturesDecodeErrorZ { + CResult_AnnouncementSignaturesDecodeErrorZ { + contents: CResult_AnnouncementSignaturesDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NoneLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_NoneLightningErrorZ { - CResult_NoneLightningErrorZ { - contents: CResult_NoneLightningErrorZPtr { +pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_AnnouncementSignaturesDecodeErrorZ { + CResult_AnnouncementSignaturesDecodeErrorZ { + contents: CResult_AnnouncementSignaturesDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NoneLightningErrorZ_free(_res: CResult_NoneLightningErrorZ) { } -impl Drop for CResult_NoneLightningErrorZ { +pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_free(_res: CResult_AnnouncementSignaturesDecodeErrorZ) { } +impl Drop for CResult_AnnouncementSignaturesDecodeErrorZ { fn drop(&mut self) { if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } } else { if unsafe { !(self.contents.err as *mut ()).is_null() } { let _ = unsafe { Box::from_raw(self.contents.err) }; @@ -2158,16 +4619,16 @@ impl Drop for CResult_NoneLightningErrorZ { } } } -impl From> for CResult_NoneLightningErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_AnnouncementSignaturesDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { - let _ = unsafe { Box::from_raw(o.contents.result) }; - o.contents.result = std::ptr::null_mut(); - CResult_NoneLightningErrorZPtr { result: std::ptr::null_mut() } + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_AnnouncementSignaturesDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NoneLightningErrorZPtr { err } + CResult_AnnouncementSignaturesDecodeErrorZPtr { err } }; Self { contents, @@ -2175,21 +4636,21 @@ impl From> for } } } -impl Clone for CResult_NoneLightningErrorZ { +impl Clone for CResult_AnnouncementSignaturesDecodeErrorZ { fn clone(&self) -> Self { if self.result_ok { - Self { result_ok: true, contents: CResult_NoneLightningErrorZPtr { - result: std::ptr::null_mut() + Self { result_ok: true, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_NoneLightningErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_AnnouncementSignaturesDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_NoneLightningErrorZ_clone(orig: &CResult_NoneLightningErrorZ) -> CResult_NoneLightningErrorZ { orig.clone() } +pub extern "C" fn CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig: &CResult_AnnouncementSignaturesDecodeErrorZ) -> CResult_AnnouncementSignaturesDecodeErrorZ { orig.clone() } #[repr(C)] pub union CResult_ChannelReestablishDecodeErrorZPtr { pub result: *mut crate::ln::msgs::ChannelReestablish, @@ -2266,36 +4727,36 @@ impl Clone for CResult_ChannelReestablishDecodeErrorZ { #[no_mangle] pub extern "C" fn CResult_ChannelReestablishDecodeErrorZ_clone(orig: &CResult_ChannelReestablishDecodeErrorZ) -> CResult_ChannelReestablishDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_InitDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::Init, +pub union CResult_ClosingSignedDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::ClosingSigned, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_InitDecodeErrorZ { - pub contents: CResult_InitDecodeErrorZPtr, +pub struct CResult_ClosingSignedDecodeErrorZ { + pub contents: CResult_ClosingSignedDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_InitDecodeErrorZ_ok(o: crate::ln::msgs::Init) -> CResult_InitDecodeErrorZ { - CResult_InitDecodeErrorZ { - contents: CResult_InitDecodeErrorZPtr { +pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_ok(o: crate::ln::msgs::ClosingSigned) -> CResult_ClosingSignedDecodeErrorZ { + CResult_ClosingSignedDecodeErrorZ { + contents: CResult_ClosingSignedDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_InitDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitDecodeErrorZ { - CResult_InitDecodeErrorZ { - contents: CResult_InitDecodeErrorZPtr { +pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ClosingSignedDecodeErrorZ { + CResult_ClosingSignedDecodeErrorZ { + contents: CResult_ClosingSignedDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_InitDecodeErrorZ_free(_res: CResult_InitDecodeErrorZ) { } -impl Drop for CResult_InitDecodeErrorZ { +pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_free(_res: CResult_ClosingSignedDecodeErrorZ) { } +impl Drop for CResult_ClosingSignedDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2308,16 +4769,16 @@ impl Drop for CResult_InitDecodeErrorZ { } } } -impl From> for CResult_InitDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_ClosingSignedDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_InitDecodeErrorZPtr { result } + CResult_ClosingSignedDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_InitDecodeErrorZPtr { err } + CResult_ClosingSignedDecodeErrorZPtr { err } }; Self { contents, @@ -2325,52 +4786,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_InitDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_ClosingSignedDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_InitDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_ClosingSignedDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_InitDecodeErrorZ_clone(orig: &CResult_InitDecodeErrorZ) -> CResult_InitDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_ClosingSignedDecodeErrorZ_clone(orig: &CResult_ClosingSignedDecodeErrorZ) -> CResult_ClosingSignedDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_PingDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::Ping, +pub union CResult_CommitmentSignedDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::CommitmentSigned, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_PingDecodeErrorZ { - pub contents: CResult_PingDecodeErrorZPtr, +pub struct CResult_CommitmentSignedDecodeErrorZ { + pub contents: CResult_CommitmentSignedDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_PingDecodeErrorZ_ok(o: crate::ln::msgs::Ping) -> CResult_PingDecodeErrorZ { - CResult_PingDecodeErrorZ { - contents: CResult_PingDecodeErrorZPtr { +pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_ok(o: crate::ln::msgs::CommitmentSigned) -> CResult_CommitmentSignedDecodeErrorZ { + CResult_CommitmentSignedDecodeErrorZ { + contents: CResult_CommitmentSignedDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_PingDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PingDecodeErrorZ { - CResult_PingDecodeErrorZ { - contents: CResult_PingDecodeErrorZPtr { +pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_CommitmentSignedDecodeErrorZ { + CResult_CommitmentSignedDecodeErrorZ { + contents: CResult_CommitmentSignedDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_PingDecodeErrorZ_free(_res: CResult_PingDecodeErrorZ) { } -impl Drop for CResult_PingDecodeErrorZ { +pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_free(_res: CResult_CommitmentSignedDecodeErrorZ) { } +impl Drop for CResult_CommitmentSignedDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2383,16 +4844,16 @@ impl Drop for CResult_PingDecodeErrorZ { } } } -impl From> for CResult_PingDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_CommitmentSignedDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_PingDecodeErrorZPtr { result } + CResult_CommitmentSignedDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_PingDecodeErrorZPtr { err } + CResult_CommitmentSignedDecodeErrorZPtr { err } }; Self { contents, @@ -2400,52 +4861,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_PingDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_CommitmentSignedDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_PingDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_CommitmentSignedDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_PingDecodeErrorZ_clone(orig: &CResult_PingDecodeErrorZ) -> CResult_PingDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_CommitmentSignedDecodeErrorZ_clone(orig: &CResult_CommitmentSignedDecodeErrorZ) -> CResult_CommitmentSignedDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_PongDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::Pong, +pub union CResult_FundingCreatedDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::FundingCreated, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_PongDecodeErrorZ { - pub contents: CResult_PongDecodeErrorZPtr, +pub struct CResult_FundingCreatedDecodeErrorZ { + pub contents: CResult_FundingCreatedDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_PongDecodeErrorZ_ok(o: crate::ln::msgs::Pong) -> CResult_PongDecodeErrorZ { - CResult_PongDecodeErrorZ { - contents: CResult_PongDecodeErrorZPtr { +pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_ok(o: crate::ln::msgs::FundingCreated) -> CResult_FundingCreatedDecodeErrorZ { + CResult_FundingCreatedDecodeErrorZ { + contents: CResult_FundingCreatedDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_PongDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PongDecodeErrorZ { - CResult_PongDecodeErrorZ { - contents: CResult_PongDecodeErrorZPtr { +pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingCreatedDecodeErrorZ { + CResult_FundingCreatedDecodeErrorZ { + contents: CResult_FundingCreatedDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_PongDecodeErrorZ_free(_res: CResult_PongDecodeErrorZ) { } -impl Drop for CResult_PongDecodeErrorZ { +pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_free(_res: CResult_FundingCreatedDecodeErrorZ) { } +impl Drop for CResult_FundingCreatedDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2458,16 +4919,16 @@ impl Drop for CResult_PongDecodeErrorZ { } } } -impl From> for CResult_PongDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_FundingCreatedDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_PongDecodeErrorZPtr { result } + CResult_FundingCreatedDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_PongDecodeErrorZPtr { err } + CResult_FundingCreatedDecodeErrorZPtr { err } }; Self { contents, @@ -2475,52 +4936,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_PongDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_FundingCreatedDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_PongDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_FundingCreatedDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_PongDecodeErrorZ_clone(orig: &CResult_PongDecodeErrorZ) -> CResult_PongDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_FundingCreatedDecodeErrorZ_clone(orig: &CResult_FundingCreatedDecodeErrorZ) -> CResult_FundingCreatedDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::UnsignedChannelAnnouncement, +pub union CResult_FundingSignedDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::FundingSigned, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_UnsignedChannelAnnouncementDecodeErrorZ { - pub contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr, +pub struct CResult_FundingSignedDecodeErrorZ { + pub contents: CResult_FundingSignedDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelAnnouncement) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { - CResult_UnsignedChannelAnnouncementDecodeErrorZ { - contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { +pub extern "C" fn CResult_FundingSignedDecodeErrorZ_ok(o: crate::ln::msgs::FundingSigned) -> CResult_FundingSignedDecodeErrorZ { + CResult_FundingSignedDecodeErrorZ { + contents: CResult_FundingSignedDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { - CResult_UnsignedChannelAnnouncementDecodeErrorZ { - contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { +pub extern "C" fn CResult_FundingSignedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingSignedDecodeErrorZ { + CResult_FundingSignedDecodeErrorZ { + contents: CResult_FundingSignedDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedChannelAnnouncementDecodeErrorZ) { } -impl Drop for CResult_UnsignedChannelAnnouncementDecodeErrorZ { +pub extern "C" fn CResult_FundingSignedDecodeErrorZ_free(_res: CResult_FundingSignedDecodeErrorZ) { } +impl Drop for CResult_FundingSignedDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2533,16 +4994,16 @@ impl Drop for CResult_UnsignedChannelAnnouncementDecodeErrorZ { } } } -impl From> for CResult_UnsignedChannelAnnouncementDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_FundingSignedDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { result } + CResult_FundingSignedDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { err } + CResult_FundingSignedDecodeErrorZPtr { err } }; Self { contents, @@ -2550,52 +5011,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_FundingSignedDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_FundingSignedDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedChannelAnnouncementDecodeErrorZ) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_FundingSignedDecodeErrorZ_clone(orig: &CResult_FundingSignedDecodeErrorZ) -> CResult_FundingSignedDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_UnsignedChannelUpdateDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::UnsignedChannelUpdate, +pub union CResult_FundingLockedDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::FundingLocked, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_UnsignedChannelUpdateDecodeErrorZ { - pub contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr, +pub struct CResult_FundingLockedDecodeErrorZ { + pub contents: CResult_FundingLockedDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelUpdate) -> CResult_UnsignedChannelUpdateDecodeErrorZ { - CResult_UnsignedChannelUpdateDecodeErrorZ { - contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { +pub extern "C" fn CResult_FundingLockedDecodeErrorZ_ok(o: crate::ln::msgs::FundingLocked) -> CResult_FundingLockedDecodeErrorZ { + CResult_FundingLockedDecodeErrorZ { + contents: CResult_FundingLockedDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelUpdateDecodeErrorZ { - CResult_UnsignedChannelUpdateDecodeErrorZ { - contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { +pub extern "C" fn CResult_FundingLockedDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_FundingLockedDecodeErrorZ { + CResult_FundingLockedDecodeErrorZ { + contents: CResult_FundingLockedDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: CResult_UnsignedChannelUpdateDecodeErrorZ) { } -impl Drop for CResult_UnsignedChannelUpdateDecodeErrorZ { +pub extern "C" fn CResult_FundingLockedDecodeErrorZ_free(_res: CResult_FundingLockedDecodeErrorZ) { } +impl Drop for CResult_FundingLockedDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2608,16 +5069,16 @@ impl Drop for CResult_UnsignedChannelUpdateDecodeErrorZ { } } } -impl From> for CResult_UnsignedChannelUpdateDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_FundingLockedDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_UnsignedChannelUpdateDecodeErrorZPtr { result } + CResult_FundingLockedDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_UnsignedChannelUpdateDecodeErrorZPtr { err } + CResult_FundingLockedDecodeErrorZPtr { err } }; Self { contents, @@ -2625,52 +5086,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_FundingLockedDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_FundingLockedDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: &CResult_UnsignedChannelUpdateDecodeErrorZ) -> CResult_UnsignedChannelUpdateDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_FundingLockedDecodeErrorZ_clone(orig: &CResult_FundingLockedDecodeErrorZ) -> CResult_FundingLockedDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_ErrorMessageDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::ErrorMessage, +pub union CResult_InitDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::Init, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_ErrorMessageDecodeErrorZ { - pub contents: CResult_ErrorMessageDecodeErrorZPtr, +pub struct CResult_InitDecodeErrorZ { + pub contents: CResult_InitDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_ok(o: crate::ln::msgs::ErrorMessage) -> CResult_ErrorMessageDecodeErrorZ { - CResult_ErrorMessageDecodeErrorZ { - contents: CResult_ErrorMessageDecodeErrorZPtr { +pub extern "C" fn CResult_InitDecodeErrorZ_ok(o: crate::ln::msgs::Init) -> CResult_InitDecodeErrorZ { + CResult_InitDecodeErrorZ { + contents: CResult_InitDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ErrorMessageDecodeErrorZ { - CResult_ErrorMessageDecodeErrorZ { - contents: CResult_ErrorMessageDecodeErrorZPtr { +pub extern "C" fn CResult_InitDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InitDecodeErrorZ { + CResult_InitDecodeErrorZ { + contents: CResult_InitDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_free(_res: CResult_ErrorMessageDecodeErrorZ) { } -impl Drop for CResult_ErrorMessageDecodeErrorZ { +pub extern "C" fn CResult_InitDecodeErrorZ_free(_res: CResult_InitDecodeErrorZ) { } +impl Drop for CResult_InitDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2683,16 +5144,16 @@ impl Drop for CResult_ErrorMessageDecodeErrorZ { } } } -impl From> for CResult_ErrorMessageDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_InitDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_ErrorMessageDecodeErrorZPtr { result } + CResult_InitDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_ErrorMessageDecodeErrorZPtr { err } + CResult_InitDecodeErrorZPtr { err } }; Self { contents, @@ -2700,52 +5161,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_ErrorMessageDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_InitDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_ErrorMessageDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_InitDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_clone(orig: &CResult_ErrorMessageDecodeErrorZ) -> CResult_ErrorMessageDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_InitDecodeErrorZ_clone(orig: &CResult_InitDecodeErrorZ) -> CResult_InitDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::UnsignedNodeAnnouncement, +pub union CResult_OpenChannelDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::OpenChannel, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_UnsignedNodeAnnouncementDecodeErrorZ { - pub contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr, +pub struct CResult_OpenChannelDecodeErrorZ { + pub contents: CResult_OpenChannelDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedNodeAnnouncement) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { - CResult_UnsignedNodeAnnouncementDecodeErrorZ { - contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { +pub extern "C" fn CResult_OpenChannelDecodeErrorZ_ok(o: crate::ln::msgs::OpenChannel) -> CResult_OpenChannelDecodeErrorZ { + CResult_OpenChannelDecodeErrorZ { + contents: CResult_OpenChannelDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { - CResult_UnsignedNodeAnnouncementDecodeErrorZ { - contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { +pub extern "C" fn CResult_OpenChannelDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_OpenChannelDecodeErrorZ { + CResult_OpenChannelDecodeErrorZ { + contents: CResult_OpenChannelDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedNodeAnnouncementDecodeErrorZ) { } -impl Drop for CResult_UnsignedNodeAnnouncementDecodeErrorZ { +pub extern "C" fn CResult_OpenChannelDecodeErrorZ_free(_res: CResult_OpenChannelDecodeErrorZ) { } +impl Drop for CResult_OpenChannelDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2758,16 +5219,16 @@ impl Drop for CResult_UnsignedNodeAnnouncementDecodeErrorZ { } } } -impl From> for CResult_UnsignedNodeAnnouncementDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_OpenChannelDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { result } + CResult_OpenChannelDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err } + CResult_OpenChannelDecodeErrorZPtr { err } }; Self { contents, @@ -2775,52 +5236,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_OpenChannelDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_OpenChannelDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedNodeAnnouncementDecodeErrorZ) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_OpenChannelDecodeErrorZ_clone(orig: &CResult_OpenChannelDecodeErrorZ) -> CResult_OpenChannelDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_QueryShortChannelIdsDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::QueryShortChannelIds, +pub union CResult_RevokeAndACKDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::RevokeAndACK, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_QueryShortChannelIdsDecodeErrorZ { - pub contents: CResult_QueryShortChannelIdsDecodeErrorZPtr, +pub struct CResult_RevokeAndACKDecodeErrorZ { + pub contents: CResult_RevokeAndACKDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_ok(o: crate::ln::msgs::QueryShortChannelIds) -> CResult_QueryShortChannelIdsDecodeErrorZ { - CResult_QueryShortChannelIdsDecodeErrorZ { - contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { +pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_ok(o: crate::ln::msgs::RevokeAndACK) -> CResult_RevokeAndACKDecodeErrorZ { + CResult_RevokeAndACKDecodeErrorZ { + contents: CResult_RevokeAndACKDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryShortChannelIdsDecodeErrorZ { - CResult_QueryShortChannelIdsDecodeErrorZ { - contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { +pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RevokeAndACKDecodeErrorZ { + CResult_RevokeAndACKDecodeErrorZ { + contents: CResult_RevokeAndACKDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: CResult_QueryShortChannelIdsDecodeErrorZ) { } -impl Drop for CResult_QueryShortChannelIdsDecodeErrorZ { +pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_free(_res: CResult_RevokeAndACKDecodeErrorZ) { } +impl Drop for CResult_RevokeAndACKDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2833,16 +5294,16 @@ impl Drop for CResult_QueryShortChannelIdsDecodeErrorZ { } } } -impl From> for CResult_QueryShortChannelIdsDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_RevokeAndACKDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_QueryShortChannelIdsDecodeErrorZPtr { result } + CResult_RevokeAndACKDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_QueryShortChannelIdsDecodeErrorZPtr { err } + CResult_RevokeAndACKDecodeErrorZPtr { err } }; Self { contents, @@ -2850,52 +5311,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_RevokeAndACKDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_RevokeAndACKDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: &CResult_QueryShortChannelIdsDecodeErrorZ) -> CResult_QueryShortChannelIdsDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_RevokeAndACKDecodeErrorZ_clone(orig: &CResult_RevokeAndACKDecodeErrorZ) -> CResult_RevokeAndACKDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::ReplyShortChannelIdsEnd, +pub union CResult_ShutdownDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::Shutdown, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_ReplyShortChannelIdsEndDecodeErrorZ { - pub contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr, +pub struct CResult_ShutdownDecodeErrorZ { + pub contents: CResult_ShutdownDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o: crate::ln::msgs::ReplyShortChannelIdsEnd) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { - CResult_ReplyShortChannelIdsEndDecodeErrorZ { - contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { +pub extern "C" fn CResult_ShutdownDecodeErrorZ_ok(o: crate::ln::msgs::Shutdown) -> CResult_ShutdownDecodeErrorZ { + CResult_ShutdownDecodeErrorZ { + contents: CResult_ShutdownDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { - CResult_ReplyShortChannelIdsEndDecodeErrorZ { - contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { +pub extern "C" fn CResult_ShutdownDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ShutdownDecodeErrorZ { + CResult_ShutdownDecodeErrorZ { + contents: CResult_ShutdownDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: CResult_ReplyShortChannelIdsEndDecodeErrorZ) { } -impl Drop for CResult_ReplyShortChannelIdsEndDecodeErrorZ { +pub extern "C" fn CResult_ShutdownDecodeErrorZ_free(_res: CResult_ShutdownDecodeErrorZ) { } +impl Drop for CResult_ShutdownDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2908,16 +5369,16 @@ impl Drop for CResult_ReplyShortChannelIdsEndDecodeErrorZ { } } } -impl From> for CResult_ReplyShortChannelIdsEndDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_ShutdownDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { result } + CResult_ShutdownDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err } + CResult_ShutdownDecodeErrorZPtr { err } }; Self { contents, @@ -2925,52 +5386,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_ShutdownDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_ShutdownDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: &CResult_ReplyShortChannelIdsEndDecodeErrorZ) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_ShutdownDecodeErrorZ_clone(orig: &CResult_ShutdownDecodeErrorZ) -> CResult_ShutdownDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_QueryChannelRangeDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::QueryChannelRange, +pub union CResult_UpdateFailHTLCDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UpdateFailHTLC, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_QueryChannelRangeDecodeErrorZ { - pub contents: CResult_QueryChannelRangeDecodeErrorZPtr, +pub struct CResult_UpdateFailHTLCDecodeErrorZ { + pub contents: CResult_UpdateFailHTLCDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::QueryChannelRange) -> CResult_QueryChannelRangeDecodeErrorZ { - CResult_QueryChannelRangeDecodeErrorZ { - contents: CResult_QueryChannelRangeDecodeErrorZPtr { +pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailHTLC) -> CResult_UpdateFailHTLCDecodeErrorZ { + CResult_UpdateFailHTLCDecodeErrorZ { + contents: CResult_UpdateFailHTLCDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryChannelRangeDecodeErrorZ { - CResult_QueryChannelRangeDecodeErrorZ { - contents: CResult_QueryChannelRangeDecodeErrorZPtr { +pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailHTLCDecodeErrorZ { + CResult_UpdateFailHTLCDecodeErrorZ { + contents: CResult_UpdateFailHTLCDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_free(_res: CResult_QueryChannelRangeDecodeErrorZ) { } -impl Drop for CResult_QueryChannelRangeDecodeErrorZ { +pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_free(_res: CResult_UpdateFailHTLCDecodeErrorZ) { } +impl Drop for CResult_UpdateFailHTLCDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -2983,16 +5444,16 @@ impl Drop for CResult_QueryChannelRangeDecodeErrorZ { } } } -impl From> for CResult_QueryChannelRangeDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_UpdateFailHTLCDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_QueryChannelRangeDecodeErrorZPtr { result } + CResult_UpdateFailHTLCDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_QueryChannelRangeDecodeErrorZPtr { err } + CResult_UpdateFailHTLCDecodeErrorZPtr { err } }; Self { contents, @@ -3000,52 +5461,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_QueryChannelRangeDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_UpdateFailHTLCDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_QueryChannelRangeDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_UpdateFailHTLCDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_clone(orig: &CResult_QueryChannelRangeDecodeErrorZ) -> CResult_QueryChannelRangeDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_UpdateFailHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailHTLCDecodeErrorZ) -> CResult_UpdateFailHTLCDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_ReplyChannelRangeDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::ReplyChannelRange, +pub union CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UpdateFailMalformedHTLC, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_ReplyChannelRangeDecodeErrorZ { - pub contents: CResult_ReplyChannelRangeDecodeErrorZPtr, +pub struct CResult_UpdateFailMalformedHTLCDecodeErrorZ { + pub contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::ReplyChannelRange) -> CResult_ReplyChannelRangeDecodeErrorZ { - CResult_ReplyChannelRangeDecodeErrorZ { - contents: CResult_ReplyChannelRangeDecodeErrorZPtr { +pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFailMalformedHTLC) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ { + CResult_UpdateFailMalformedHTLCDecodeErrorZ { + contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyChannelRangeDecodeErrorZ { - CResult_ReplyChannelRangeDecodeErrorZ { - contents: CResult_ReplyChannelRangeDecodeErrorZPtr { +pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ { + CResult_UpdateFailMalformedHTLCDecodeErrorZ { + contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_free(_res: CResult_ReplyChannelRangeDecodeErrorZ) { } -impl Drop for CResult_ReplyChannelRangeDecodeErrorZ { +pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res: CResult_UpdateFailMalformedHTLCDecodeErrorZ) { } +impl Drop for CResult_UpdateFailMalformedHTLCDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3058,16 +5519,16 @@ impl Drop for CResult_ReplyChannelRangeDecodeErrorZ { } } } -impl From> for CResult_ReplyChannelRangeDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_UpdateFailMalformedHTLCDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_ReplyChannelRangeDecodeErrorZPtr { result } + CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_ReplyChannelRangeDecodeErrorZPtr { err } + CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { err } }; Self { contents, @@ -3075,52 +5536,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_ReplyChannelRangeDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_ReplyChannelRangeDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: &CResult_ReplyChannelRangeDecodeErrorZ) -> CResult_ReplyChannelRangeDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFailMalformedHTLCDecodeErrorZ) -> CResult_UpdateFailMalformedHTLCDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_GossipTimestampFilterDecodeErrorZPtr { - pub result: *mut crate::ln::msgs::GossipTimestampFilter, +pub union CResult_UpdateFeeDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UpdateFee, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_GossipTimestampFilterDecodeErrorZ { - pub contents: CResult_GossipTimestampFilterDecodeErrorZPtr, +pub struct CResult_UpdateFeeDecodeErrorZ { + pub contents: CResult_UpdateFeeDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_ok(o: crate::ln::msgs::GossipTimestampFilter) -> CResult_GossipTimestampFilterDecodeErrorZ { - CResult_GossipTimestampFilterDecodeErrorZ { - contents: CResult_GossipTimestampFilterDecodeErrorZPtr { +pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFee) -> CResult_UpdateFeeDecodeErrorZ { + CResult_UpdateFeeDecodeErrorZ { + contents: CResult_UpdateFeeDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_GossipTimestampFilterDecodeErrorZ { - CResult_GossipTimestampFilterDecodeErrorZ { - contents: CResult_GossipTimestampFilterDecodeErrorZPtr { +pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFeeDecodeErrorZ { + CResult_UpdateFeeDecodeErrorZ { + contents: CResult_UpdateFeeDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_free(_res: CResult_GossipTimestampFilterDecodeErrorZ) { } -impl Drop for CResult_GossipTimestampFilterDecodeErrorZ { +pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_free(_res: CResult_UpdateFeeDecodeErrorZ) { } +impl Drop for CResult_UpdateFeeDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3133,16 +5594,16 @@ impl Drop for CResult_GossipTimestampFilterDecodeErrorZ { } } } -impl From> for CResult_GossipTimestampFilterDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_UpdateFeeDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_GossipTimestampFilterDecodeErrorZPtr { result } + CResult_UpdateFeeDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_GossipTimestampFilterDecodeErrorZPtr { err } + CResult_UpdateFeeDecodeErrorZPtr { err } }; Self { contents, @@ -3150,124 +5611,127 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_GossipTimestampFilterDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_UpdateFeeDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_GossipTimestampFilterDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_UpdateFeeDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: &CResult_GossipTimestampFilterDecodeErrorZ) -> CResult_GossipTimestampFilterDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_UpdateFeeDecodeErrorZ_clone(orig: &CResult_UpdateFeeDecodeErrorZ) -> CResult_UpdateFeeDecodeErrorZ { orig.clone() } #[repr(C)] -pub struct CVec_PublicKeyZ { - pub data: *mut crate::c_types::PublicKey, - pub datalen: usize -} -impl CVec_PublicKeyZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::PublicKey] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_PublicKeyZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_PublicKeyZ_free(_res: CVec_PublicKeyZ) { } -impl Drop for CVec_PublicKeyZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } +pub union CResult_UpdateFulfillHTLCDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UpdateFulfillHTLC, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CVec_u8Z { - pub data: *mut u8, - pub datalen: usize -} -impl CVec_u8Z { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[u8] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } +pub struct CResult_UpdateFulfillHTLCDecodeErrorZ { + pub contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateFulfillHTLC) -> CResult_UpdateFulfillHTLCDecodeErrorZ { + CResult_UpdateFulfillHTLCDecodeErrorZ { + contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, } } -impl From> for CVec_u8Z { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } +#[no_mangle] +pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateFulfillHTLCDecodeErrorZ { + CResult_UpdateFulfillHTLCDecodeErrorZ { + contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, } } #[no_mangle] -pub extern "C" fn CVec_u8Z_free(_res: CVec_u8Z) { } -impl Drop for CVec_u8Z { +pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res: CResult_UpdateFulfillHTLCDecodeErrorZ) { } +impl Drop for CResult_UpdateFulfillHTLCDecodeErrorZ { fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } } } -impl Clone for CVec_u8Z { +impl From> for CResult_UpdateFulfillHTLCDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_UpdateFulfillHTLCDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_UpdateFulfillHTLCDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } + } +} +impl Clone for CResult_UpdateFulfillHTLCDecodeErrorZ { fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) + if self.result_ok { + Self { result_ok: true, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_UpdateFulfillHTLCDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } } } +#[no_mangle] +pub extern "C" fn CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig: &CResult_UpdateFulfillHTLCDecodeErrorZ) -> CResult_UpdateFulfillHTLCDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_CVec_u8ZPeerHandleErrorZPtr { - pub result: *mut crate::c_types::derived::CVec_u8Z, - pub err: *mut crate::ln::peer_handler::PeerHandleError, +pub union CResult_UpdateAddHTLCDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UpdateAddHTLC, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_CVec_u8ZPeerHandleErrorZ { - pub contents: CResult_CVec_u8ZPeerHandleErrorZPtr, +pub struct CResult_UpdateAddHTLCDecodeErrorZ { + pub contents: CResult_UpdateAddHTLCDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_ok(o: crate::c_types::derived::CVec_u8Z) -> CResult_CVec_u8ZPeerHandleErrorZ { - CResult_CVec_u8ZPeerHandleErrorZ { - contents: CResult_CVec_u8ZPeerHandleErrorZPtr { +pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_ok(o: crate::ln::msgs::UpdateAddHTLC) -> CResult_UpdateAddHTLCDecodeErrorZ { + CResult_UpdateAddHTLCDecodeErrorZ { + contents: CResult_UpdateAddHTLCDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_CVec_u8ZPeerHandleErrorZ { - CResult_CVec_u8ZPeerHandleErrorZ { - contents: CResult_CVec_u8ZPeerHandleErrorZPtr { +pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UpdateAddHTLCDecodeErrorZ { + CResult_UpdateAddHTLCDecodeErrorZ { + contents: CResult_UpdateAddHTLCDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_free(_res: CResult_CVec_u8ZPeerHandleErrorZ) { } -impl Drop for CResult_CVec_u8ZPeerHandleErrorZ { +pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_free(_res: CResult_UpdateAddHTLCDecodeErrorZ) { } +impl Drop for CResult_UpdateAddHTLCDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3280,16 +5744,16 @@ impl Drop for CResult_CVec_u8ZPeerHandleErrorZ { } } } -impl From> for CResult_CVec_u8ZPeerHandleErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_UpdateAddHTLCDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_CVec_u8ZPeerHandleErrorZPtr { result } + CResult_UpdateAddHTLCDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_CVec_u8ZPeerHandleErrorZPtr { err } + CResult_UpdateAddHTLCDecodeErrorZPtr { err } }; Self { contents, @@ -3297,55 +5761,57 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_CVec_u8ZPeerHandleErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_UpdateAddHTLCDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_CVec_u8ZPeerHandleErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_UpdateAddHTLCDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: &CResult_CVec_u8ZPeerHandleErrorZ) -> CResult_CVec_u8ZPeerHandleErrorZ { orig.clone() } +pub extern "C" fn CResult_UpdateAddHTLCDecodeErrorZ_clone(orig: &CResult_UpdateAddHTLCDecodeErrorZ) -> CResult_UpdateAddHTLCDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_NonePeerHandleErrorZPtr { - /// Note that this value is always NULL, as there are no contents in the OK variant - pub result: *mut std::ffi::c_void, - pub err: *mut crate::ln::peer_handler::PeerHandleError, +pub union CResult_PingDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::Ping, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_NonePeerHandleErrorZ { - pub contents: CResult_NonePeerHandleErrorZPtr, +pub struct CResult_PingDecodeErrorZ { + pub contents: CResult_PingDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NonePeerHandleErrorZ_ok() -> CResult_NonePeerHandleErrorZ { - CResult_NonePeerHandleErrorZ { - contents: CResult_NonePeerHandleErrorZPtr { - result: std::ptr::null_mut(), +pub extern "C" fn CResult_PingDecodeErrorZ_ok(o: crate::ln::msgs::Ping) -> CResult_PingDecodeErrorZ { + CResult_PingDecodeErrorZ { + contents: CResult_PingDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NonePeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_NonePeerHandleErrorZ { - CResult_NonePeerHandleErrorZ { - contents: CResult_NonePeerHandleErrorZPtr { +pub extern "C" fn CResult_PingDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PingDecodeErrorZ { + CResult_PingDecodeErrorZ { + contents: CResult_PingDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NonePeerHandleErrorZ_free(_res: CResult_NonePeerHandleErrorZ) { } -impl Drop for CResult_NonePeerHandleErrorZ { +pub extern "C" fn CResult_PingDecodeErrorZ_free(_res: CResult_PingDecodeErrorZ) { } +impl Drop for CResult_PingDecodeErrorZ { fn drop(&mut self) { if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } } else { if unsafe { !(self.contents.err as *mut ()).is_null() } { let _ = unsafe { Box::from_raw(self.contents.err) }; @@ -3353,16 +5819,16 @@ impl Drop for CResult_NonePeerHandleErrorZ { } } } -impl From> for CResult_NonePeerHandleErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_PingDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { - let _ = unsafe { Box::from_raw(o.contents.result) }; - o.contents.result = std::ptr::null_mut(); - CResult_NonePeerHandleErrorZPtr { result: std::ptr::null_mut() } + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_PingDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NonePeerHandleErrorZPtr { err } + CResult_PingDecodeErrorZPtr { err } }; Self { contents, @@ -3370,52 +5836,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_NonePeerHandleErrorZPtr { - result: std::ptr::null_mut() + Self { result_ok: true, contents: CResult_PingDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_NonePeerHandleErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_PingDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_NonePeerHandleErrorZ_clone(orig: &CResult_NonePeerHandleErrorZ) -> CResult_NonePeerHandleErrorZ { orig.clone() } +pub extern "C" fn CResult_PingDecodeErrorZ_clone(orig: &CResult_PingDecodeErrorZ) -> CResult_PingDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_boolPeerHandleErrorZPtr { - pub result: *mut bool, - pub err: *mut crate::ln::peer_handler::PeerHandleError, +pub union CResult_PongDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::Pong, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_boolPeerHandleErrorZ { - pub contents: CResult_boolPeerHandleErrorZPtr, +pub struct CResult_PongDecodeErrorZ { + pub contents: CResult_PongDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_boolPeerHandleErrorZ_ok(o: bool) -> CResult_boolPeerHandleErrorZ { - CResult_boolPeerHandleErrorZ { - contents: CResult_boolPeerHandleErrorZPtr { +pub extern "C" fn CResult_PongDecodeErrorZ_ok(o: crate::ln::msgs::Pong) -> CResult_PongDecodeErrorZ { + CResult_PongDecodeErrorZ { + contents: CResult_PongDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_boolPeerHandleErrorZ_err(e: crate::ln::peer_handler::PeerHandleError) -> CResult_boolPeerHandleErrorZ { - CResult_boolPeerHandleErrorZ { - contents: CResult_boolPeerHandleErrorZPtr { +pub extern "C" fn CResult_PongDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_PongDecodeErrorZ { + CResult_PongDecodeErrorZ { + contents: CResult_PongDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_boolPeerHandleErrorZ_free(_res: CResult_boolPeerHandleErrorZ) { } -impl Drop for CResult_boolPeerHandleErrorZ { +pub extern "C" fn CResult_PongDecodeErrorZ_free(_res: CResult_PongDecodeErrorZ) { } +impl Drop for CResult_PongDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3428,16 +5894,16 @@ impl Drop for CResult_boolPeerHandleErrorZ { } } } -impl From> for CResult_boolPeerHandleErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_PongDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_boolPeerHandleErrorZPtr { result } + CResult_PongDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_boolPeerHandleErrorZPtr { err } + CResult_PongDecodeErrorZPtr { err } }; Self { contents, @@ -3445,52 +5911,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_boolPeerHandleErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_PongDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_boolPeerHandleErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_PongDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_boolPeerHandleErrorZ_clone(orig: &CResult_boolPeerHandleErrorZ) -> CResult_boolPeerHandleErrorZ { orig.clone() } +pub extern "C" fn CResult_PongDecodeErrorZ_clone(orig: &CResult_PongDecodeErrorZ) -> CResult_PongDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_SecretKeySecpErrorZPtr { - pub result: *mut crate::c_types::SecretKey, - pub err: *mut crate::c_types::Secp256k1Error, +pub union CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UnsignedChannelAnnouncement, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_SecretKeySecpErrorZ { - pub contents: CResult_SecretKeySecpErrorZPtr, +pub struct CResult_UnsignedChannelAnnouncementDecodeErrorZ { + pub contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_SecretKeySecpErrorZ_ok(o: crate::c_types::SecretKey) -> CResult_SecretKeySecpErrorZ { - CResult_SecretKeySecpErrorZ { - contents: CResult_SecretKeySecpErrorZPtr { +pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelAnnouncement) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { + CResult_UnsignedChannelAnnouncementDecodeErrorZ { + contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_SecretKeySecpErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_SecretKeySecpErrorZ { - CResult_SecretKeySecpErrorZ { - contents: CResult_SecretKeySecpErrorZPtr { +pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { + CResult_UnsignedChannelAnnouncementDecodeErrorZ { + contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_SecretKeySecpErrorZ_free(_res: CResult_SecretKeySecpErrorZ) { } -impl Drop for CResult_SecretKeySecpErrorZ { +pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedChannelAnnouncementDecodeErrorZ) { } +impl Drop for CResult_UnsignedChannelAnnouncementDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3503,16 +5969,16 @@ impl Drop for CResult_SecretKeySecpErrorZ { } } } -impl From> for CResult_SecretKeySecpErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_UnsignedChannelAnnouncementDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_SecretKeySecpErrorZPtr { result } + CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_SecretKeySecpErrorZPtr { err } + CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { err } }; Self { contents, @@ -3520,37 +5986,52 @@ impl From Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedChannelAnnouncementDecodeErrorZ) -> CResult_UnsignedChannelAnnouncementDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_PublicKeySecpErrorZPtr { - pub result: *mut crate::c_types::PublicKey, - pub err: *mut crate::c_types::Secp256k1Error, +pub union CResult_ChannelAnnouncementDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::ChannelAnnouncement, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_PublicKeySecpErrorZ { - pub contents: CResult_PublicKeySecpErrorZPtr, +pub struct CResult_ChannelAnnouncementDecodeErrorZ { + pub contents: CResult_ChannelAnnouncementDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_PublicKeySecpErrorZ_ok(o: crate::c_types::PublicKey) -> CResult_PublicKeySecpErrorZ { - CResult_PublicKeySecpErrorZ { - contents: CResult_PublicKeySecpErrorZPtr { +pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::ChannelAnnouncement) -> CResult_ChannelAnnouncementDecodeErrorZ { + CResult_ChannelAnnouncementDecodeErrorZ { + contents: CResult_ChannelAnnouncementDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_PublicKeySecpErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_PublicKeySecpErrorZ { - CResult_PublicKeySecpErrorZ { - contents: CResult_PublicKeySecpErrorZPtr { +pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelAnnouncementDecodeErrorZ { + CResult_ChannelAnnouncementDecodeErrorZ { + contents: CResult_ChannelAnnouncementDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_PublicKeySecpErrorZ_free(_res: CResult_PublicKeySecpErrorZ) { } -impl Drop for CResult_PublicKeySecpErrorZ { +pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_free(_res: CResult_ChannelAnnouncementDecodeErrorZ) { } +impl Drop for CResult_ChannelAnnouncementDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3563,16 +6044,16 @@ impl Drop for CResult_PublicKeySecpErrorZ { } } } -impl From> for CResult_PublicKeySecpErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_ChannelAnnouncementDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_PublicKeySecpErrorZPtr { result } + CResult_ChannelAnnouncementDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_PublicKeySecpErrorZPtr { err } + CResult_ChannelAnnouncementDecodeErrorZPtr { err } }; Self { contents, @@ -3580,37 +6061,52 @@ impl From Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_ChannelAnnouncementDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_ChannelAnnouncementDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelAnnouncementDecodeErrorZ_clone(orig: &CResult_ChannelAnnouncementDecodeErrorZ) -> CResult_ChannelAnnouncementDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_TxCreationKeysSecpErrorZPtr { - pub result: *mut crate::ln::chan_utils::TxCreationKeys, - pub err: *mut crate::c_types::Secp256k1Error, +pub union CResult_UnsignedChannelUpdateDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UnsignedChannelUpdate, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_TxCreationKeysSecpErrorZ { - pub contents: CResult_TxCreationKeysSecpErrorZPtr, +pub struct CResult_UnsignedChannelUpdateDecodeErrorZ { + pub contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_TxCreationKeysSecpErrorZ_ok(o: crate::ln::chan_utils::TxCreationKeys) -> CResult_TxCreationKeysSecpErrorZ { - CResult_TxCreationKeysSecpErrorZ { - contents: CResult_TxCreationKeysSecpErrorZPtr { +pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedChannelUpdate) -> CResult_UnsignedChannelUpdateDecodeErrorZ { + CResult_UnsignedChannelUpdateDecodeErrorZ { + contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_TxCreationKeysSecpErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_TxCreationKeysSecpErrorZ { - CResult_TxCreationKeysSecpErrorZ { - contents: CResult_TxCreationKeysSecpErrorZPtr { +pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedChannelUpdateDecodeErrorZ { + CResult_UnsignedChannelUpdateDecodeErrorZ { + contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_TxCreationKeysSecpErrorZ_free(_res: CResult_TxCreationKeysSecpErrorZ) { } -impl Drop for CResult_TxCreationKeysSecpErrorZ { +pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: CResult_UnsignedChannelUpdateDecodeErrorZ) { } +impl Drop for CResult_UnsignedChannelUpdateDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3623,16 +6119,16 @@ impl Drop for CResult_TxCreationKeysSecpErrorZ { } } } -impl From> for CResult_TxCreationKeysSecpErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_UnsignedChannelUpdateDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_TxCreationKeysSecpErrorZPtr { result } + CResult_UnsignedChannelUpdateDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_TxCreationKeysSecpErrorZPtr { err } + CResult_UnsignedChannelUpdateDecodeErrorZPtr { err } }; Self { contents, @@ -3640,57 +6136,74 @@ impl From Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_UnsignedChannelUpdateDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: &CResult_UnsignedChannelUpdateDecodeErrorZ) -> CResult_UnsignedChannelUpdateDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_TrustedCommitmentTransactionNoneZPtr { - pub result: *mut crate::ln::chan_utils::TrustedCommitmentTransaction, - /// Note that this value is always NULL, as there are no contents in the Err variant - pub err: *mut std::ffi::c_void, +pub union CResult_ChannelUpdateDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::ChannelUpdate, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_TrustedCommitmentTransactionNoneZ { - pub contents: CResult_TrustedCommitmentTransactionNoneZPtr, +pub struct CResult_ChannelUpdateDecodeErrorZ { + pub contents: CResult_ChannelUpdateDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_ok(o: crate::ln::chan_utils::TrustedCommitmentTransaction) -> CResult_TrustedCommitmentTransactionNoneZ { - CResult_TrustedCommitmentTransactionNoneZ { - contents: CResult_TrustedCommitmentTransactionNoneZPtr { +pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_ok(o: crate::ln::msgs::ChannelUpdate) -> CResult_ChannelUpdateDecodeErrorZ { + CResult_ChannelUpdateDecodeErrorZ { + contents: CResult_ChannelUpdateDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_err() -> CResult_TrustedCommitmentTransactionNoneZ { - CResult_TrustedCommitmentTransactionNoneZ { - contents: CResult_TrustedCommitmentTransactionNoneZPtr { - err: std::ptr::null_mut(), +pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelUpdateDecodeErrorZ { + CResult_ChannelUpdateDecodeErrorZ { + contents: CResult_ChannelUpdateDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_free(_res: CResult_TrustedCommitmentTransactionNoneZ) { } -impl Drop for CResult_TrustedCommitmentTransactionNoneZ { +pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_free(_res: CResult_ChannelUpdateDecodeErrorZ) { } +impl Drop for CResult_ChannelUpdateDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { let _ = unsafe { Box::from_raw(self.contents.result) }; } } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } } } } -impl From> for CResult_TrustedCommitmentTransactionNoneZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_ChannelUpdateDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_TrustedCommitmentTransactionNoneZPtr { result } + CResult_ChannelUpdateDecodeErrorZPtr { result } } else { - let _ = unsafe { Box::from_raw(o.contents.err) }; - o.contents.err = std::ptr::null_mut(); - CResult_TrustedCommitmentTransactionNoneZPtr { err: std::ptr::null_mut() } + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ChannelUpdateDecodeErrorZPtr { err } }; Self { contents, @@ -3698,57 +6211,74 @@ impl From Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_ChannelUpdateDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_ChannelUpdateDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_ChannelUpdateDecodeErrorZ_clone(orig: &CResult_ChannelUpdateDecodeErrorZ) -> CResult_ChannelUpdateDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_CVec_SignatureZNoneZPtr { - pub result: *mut crate::c_types::derived::CVec_SignatureZ, - /// Note that this value is always NULL, as there are no contents in the Err variant - pub err: *mut std::ffi::c_void, +pub union CResult_ErrorMessageDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::ErrorMessage, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_CVec_SignatureZNoneZ { - pub contents: CResult_CVec_SignatureZNoneZPtr, +pub struct CResult_ErrorMessageDecodeErrorZ { + pub contents: CResult_ErrorMessageDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_CVec_SignatureZNoneZ_ok(o: crate::c_types::derived::CVec_SignatureZ) -> CResult_CVec_SignatureZNoneZ { - CResult_CVec_SignatureZNoneZ { - contents: CResult_CVec_SignatureZNoneZPtr { +pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_ok(o: crate::ln::msgs::ErrorMessage) -> CResult_ErrorMessageDecodeErrorZ { + CResult_ErrorMessageDecodeErrorZ { + contents: CResult_ErrorMessageDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_CVec_SignatureZNoneZ_err() -> CResult_CVec_SignatureZNoneZ { - CResult_CVec_SignatureZNoneZ { - contents: CResult_CVec_SignatureZNoneZPtr { - err: std::ptr::null_mut(), +pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ErrorMessageDecodeErrorZ { + CResult_ErrorMessageDecodeErrorZ { + contents: CResult_ErrorMessageDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_CVec_SignatureZNoneZ_free(_res: CResult_CVec_SignatureZNoneZ) { } -impl Drop for CResult_CVec_SignatureZNoneZ { +pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_free(_res: CResult_ErrorMessageDecodeErrorZ) { } +impl Drop for CResult_ErrorMessageDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { let _ = unsafe { Box::from_raw(self.contents.result) }; } } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } } } } -impl From> for CResult_CVec_SignatureZNoneZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_ErrorMessageDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_CVec_SignatureZNoneZPtr { result } + CResult_ErrorMessageDecodeErrorZPtr { result } } else { - let _ = unsafe { Box::from_raw(o.contents.err) }; - o.contents.err = std::ptr::null_mut(); - CResult_CVec_SignatureZNoneZPtr { err: std::ptr::null_mut() } + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_ErrorMessageDecodeErrorZPtr { err } }; Self { contents, @@ -3756,132 +6286,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_CVec_SignatureZNoneZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_ErrorMessageDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_CVec_SignatureZNoneZPtr { - err: std::ptr::null_mut() + Self { result_ok: false, contents: CResult_ErrorMessageDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_CVec_SignatureZNoneZ_clone(orig: &CResult_CVec_SignatureZNoneZ) -> CResult_CVec_SignatureZNoneZ { orig.clone() } -#[repr(C)] -pub struct CVec_RouteHopZ { - pub data: *mut crate::routing::router::RouteHop, - pub datalen: usize -} -impl CVec_RouteHopZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHop] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_RouteHopZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_RouteHopZ_free(_res: CVec_RouteHopZ) { } -impl Drop for CVec_RouteHopZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -impl Clone for CVec_RouteHopZ { - fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) - } -} -#[repr(C)] -pub struct CVec_CVec_RouteHopZZ { - pub data: *mut crate::c_types::derived::CVec_RouteHopZ, - pub datalen: usize -} -impl CVec_CVec_RouteHopZZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret - } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_RouteHopZ] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } - } -} -impl From> for CVec_CVec_RouteHopZZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } - } -} -#[no_mangle] -pub extern "C" fn CVec_CVec_RouteHopZZ_free(_res: CVec_CVec_RouteHopZZ) { } -impl Drop for CVec_CVec_RouteHopZZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; - } -} -impl Clone for CVec_CVec_RouteHopZZ { - fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) - } -} +pub extern "C" fn CResult_ErrorMessageDecodeErrorZ_clone(orig: &CResult_ErrorMessageDecodeErrorZ) -> CResult_ErrorMessageDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_RouteDecodeErrorZPtr { - pub result: *mut crate::routing::router::Route, +pub union CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::UnsignedNodeAnnouncement, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_RouteDecodeErrorZ { - pub contents: CResult_RouteDecodeErrorZPtr, +pub struct CResult_UnsignedNodeAnnouncementDecodeErrorZ { + pub contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_RouteDecodeErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteDecodeErrorZ { - CResult_RouteDecodeErrorZ { - contents: CResult_RouteDecodeErrorZPtr { +pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::UnsignedNodeAnnouncement) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { + CResult_UnsignedNodeAnnouncementDecodeErrorZ { + contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_RouteDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RouteDecodeErrorZ { - CResult_RouteDecodeErrorZ { - contents: CResult_RouteDecodeErrorZPtr { +pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { + CResult_UnsignedNodeAnnouncementDecodeErrorZ { + contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_RouteDecodeErrorZ_free(_res: CResult_RouteDecodeErrorZ) { } -impl Drop for CResult_RouteDecodeErrorZ { +pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: CResult_UnsignedNodeAnnouncementDecodeErrorZ) { } +impl Drop for CResult_UnsignedNodeAnnouncementDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3894,16 +6344,16 @@ impl Drop for CResult_RouteDecodeErrorZ { } } } -impl From> for CResult_RouteDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_UnsignedNodeAnnouncementDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_RouteDecodeErrorZPtr { result } + CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_RouteDecodeErrorZPtr { err } + CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err } }; Self { contents, @@ -3911,92 +6361,127 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_RouteDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_RouteDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_RouteDecodeErrorZ_clone(orig: &CResult_RouteDecodeErrorZ) -> CResult_RouteDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: &CResult_UnsignedNodeAnnouncementDecodeErrorZ) -> CResult_UnsignedNodeAnnouncementDecodeErrorZ { orig.clone() } #[repr(C)] -pub struct CVec_RouteHintZ { - pub data: *mut crate::routing::router::RouteHint, - pub datalen: usize +pub union CResult_NodeAnnouncementDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::NodeAnnouncement, + pub err: *mut crate::ln::msgs::DecodeError, } -impl CVec_RouteHintZ { - #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec { - if self.datalen == 0 { return Vec::new(); } - let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); - self.data = std::ptr::null_mut(); - self.datalen = 0; - ret +#[repr(C)] +pub struct CResult_NodeAnnouncementDecodeErrorZ { + pub contents: CResult_NodeAnnouncementDecodeErrorZPtr, + pub result_ok: bool, +} +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_ok(o: crate::ln::msgs::NodeAnnouncement) -> CResult_NodeAnnouncementDecodeErrorZ { + CResult_NodeAnnouncementDecodeErrorZ { + contents: CResult_NodeAnnouncementDecodeErrorZPtr { + result: Box::into_raw(Box::new(o)), + }, + result_ok: true, } - #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::routing::router::RouteHint] { - unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } +} +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementDecodeErrorZ { + CResult_NodeAnnouncementDecodeErrorZ { + contents: CResult_NodeAnnouncementDecodeErrorZPtr { + err: Box::into_raw(Box::new(e)), + }, + result_ok: false, } } -impl From> for CVec_RouteHintZ { - fn from(v: Vec) -> Self { - let datalen = v.len(); - let data = Box::into_raw(v.into_boxed_slice()); - Self { datalen, data: unsafe { (*data).as_mut_ptr() } } +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_free(_res: CResult_NodeAnnouncementDecodeErrorZ) { } +impl Drop for CResult_NodeAnnouncementDecodeErrorZ { + fn drop(&mut self) { + if self.result_ok { + if unsafe { !(self.contents.result as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.result) }; + } + } else { + if unsafe { !(self.contents.err as *mut ()).is_null() } { + let _ = unsafe { Box::from_raw(self.contents.err) }; + } + } } } -#[no_mangle] -pub extern "C" fn CVec_RouteHintZ_free(_res: CVec_RouteHintZ) { } -impl Drop for CVec_RouteHintZ { - fn drop(&mut self) { - if self.datalen == 0 { return; } - unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }; +impl From> for CResult_NodeAnnouncementDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { + let contents = if o.result_ok { + let result = unsafe { o.contents.result }; + unsafe { o.contents.result = std::ptr::null_mut() }; + CResult_NodeAnnouncementDecodeErrorZPtr { result } + } else { + let err = unsafe { o.contents.err }; + unsafe { o.contents.err = std::ptr::null_mut(); } + CResult_NodeAnnouncementDecodeErrorZPtr { err } + }; + Self { + contents, + result_ok: o.result_ok, + } } } -impl Clone for CVec_RouteHintZ { +impl Clone for CResult_NodeAnnouncementDecodeErrorZ { fn clone(&self) -> Self { - let mut res = Vec::new(); - if self.datalen == 0 { return Self::from(res); } - res.extend_from_slice(unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }); - Self::from(res) + if self.result_ok { + Self { result_ok: true, contents: CResult_NodeAnnouncementDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_NodeAnnouncementDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } } } +#[no_mangle] +pub extern "C" fn CResult_NodeAnnouncementDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementDecodeErrorZ) -> CResult_NodeAnnouncementDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_RouteLightningErrorZPtr { - pub result: *mut crate::routing::router::Route, - pub err: *mut crate::ln::msgs::LightningError, +pub union CResult_QueryShortChannelIdsDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::QueryShortChannelIds, + pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_RouteLightningErrorZ { - pub contents: CResult_RouteLightningErrorZPtr, +pub struct CResult_QueryShortChannelIdsDecodeErrorZ { + pub contents: CResult_QueryShortChannelIdsDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_RouteLightningErrorZ_ok(o: crate::routing::router::Route) -> CResult_RouteLightningErrorZ { - CResult_RouteLightningErrorZ { - contents: CResult_RouteLightningErrorZPtr { +pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_ok(o: crate::ln::msgs::QueryShortChannelIds) -> CResult_QueryShortChannelIdsDecodeErrorZ { + CResult_QueryShortChannelIdsDecodeErrorZ { + contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_RouteLightningErrorZ_err(e: crate::ln::msgs::LightningError) -> CResult_RouteLightningErrorZ { - CResult_RouteLightningErrorZ { - contents: CResult_RouteLightningErrorZPtr { +pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryShortChannelIdsDecodeErrorZ { + CResult_QueryShortChannelIdsDecodeErrorZ { + contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_RouteLightningErrorZ_free(_res: CResult_RouteLightningErrorZ) { } -impl Drop for CResult_RouteLightningErrorZ { +pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: CResult_QueryShortChannelIdsDecodeErrorZ) { } +impl Drop for CResult_QueryShortChannelIdsDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -4009,16 +6494,16 @@ impl Drop for CResult_RouteLightningErrorZ { } } } -impl From> for CResult_RouteLightningErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_QueryShortChannelIdsDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_RouteLightningErrorZPtr { result } + CResult_QueryShortChannelIdsDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_RouteLightningErrorZPtr { err } + CResult_QueryShortChannelIdsDecodeErrorZPtr { err } }; Self { contents, @@ -4026,52 +6511,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_RouteLightningErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_RouteLightningErrorZPtr { - err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + Self { result_ok: false, contents: CResult_QueryShortChannelIdsDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_RouteLightningErrorZ_clone(orig: &CResult_RouteLightningErrorZ) -> CResult_RouteLightningErrorZ { orig.clone() } +pub extern "C" fn CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: &CResult_QueryShortChannelIdsDecodeErrorZ) -> CResult_QueryShortChannelIdsDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_RoutingFeesDecodeErrorZPtr { - pub result: *mut crate::routing::network_graph::RoutingFees, +pub union CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::ReplyShortChannelIdsEnd, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_RoutingFeesDecodeErrorZ { - pub contents: CResult_RoutingFeesDecodeErrorZPtr, +pub struct CResult_ReplyShortChannelIdsEndDecodeErrorZ { + pub contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_ok(o: crate::routing::network_graph::RoutingFees) -> CResult_RoutingFeesDecodeErrorZ { - CResult_RoutingFeesDecodeErrorZ { - contents: CResult_RoutingFeesDecodeErrorZPtr { +pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o: crate::ln::msgs::ReplyShortChannelIdsEnd) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { + CResult_ReplyShortChannelIdsEndDecodeErrorZ { + contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_RoutingFeesDecodeErrorZ { - CResult_RoutingFeesDecodeErrorZ { - contents: CResult_RoutingFeesDecodeErrorZPtr { +pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { + CResult_ReplyShortChannelIdsEndDecodeErrorZ { + contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_free(_res: CResult_RoutingFeesDecodeErrorZ) { } -impl Drop for CResult_RoutingFeesDecodeErrorZ { +pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: CResult_ReplyShortChannelIdsEndDecodeErrorZ) { } +impl Drop for CResult_ReplyShortChannelIdsEndDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -4084,16 +6569,16 @@ impl Drop for CResult_RoutingFeesDecodeErrorZ { } } } -impl From> for CResult_RoutingFeesDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_ReplyShortChannelIdsEndDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_RoutingFeesDecodeErrorZPtr { result } + CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_RoutingFeesDecodeErrorZPtr { err } + CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err } }; Self { contents, @@ -4101,52 +6586,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_RoutingFeesDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_RoutingFeesDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_RoutingFeesDecodeErrorZ_clone(orig: &CResult_RoutingFeesDecodeErrorZ) -> CResult_RoutingFeesDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: &CResult_ReplyShortChannelIdsEndDecodeErrorZ) -> CResult_ReplyShortChannelIdsEndDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_NodeAnnouncementInfoDecodeErrorZPtr { - pub result: *mut crate::routing::network_graph::NodeAnnouncementInfo, +pub union CResult_QueryChannelRangeDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::QueryChannelRange, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_NodeAnnouncementInfoDecodeErrorZ { - pub contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr, +pub struct CResult_QueryChannelRangeDecodeErrorZ { + pub contents: CResult_QueryChannelRangeDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeAnnouncementInfo) -> CResult_NodeAnnouncementInfoDecodeErrorZ { - CResult_NodeAnnouncementInfoDecodeErrorZ { - contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { +pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::QueryChannelRange) -> CResult_QueryChannelRangeDecodeErrorZ { + CResult_QueryChannelRangeDecodeErrorZ { + contents: CResult_QueryChannelRangeDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeAnnouncementInfoDecodeErrorZ { - CResult_NodeAnnouncementInfoDecodeErrorZ { - contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { +pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_QueryChannelRangeDecodeErrorZ { + CResult_QueryChannelRangeDecodeErrorZ { + contents: CResult_QueryChannelRangeDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: CResult_NodeAnnouncementInfoDecodeErrorZ) { } -impl Drop for CResult_NodeAnnouncementInfoDecodeErrorZ { +pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_free(_res: CResult_QueryChannelRangeDecodeErrorZ) { } +impl Drop for CResult_QueryChannelRangeDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -4159,16 +6644,16 @@ impl Drop for CResult_NodeAnnouncementInfoDecodeErrorZ { } } } -impl From> for CResult_NodeAnnouncementInfoDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_QueryChannelRangeDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_NodeAnnouncementInfoDecodeErrorZPtr { result } + CResult_QueryChannelRangeDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NodeAnnouncementInfoDecodeErrorZPtr { err } + CResult_QueryChannelRangeDecodeErrorZPtr { err } }; Self { contents, @@ -4176,52 +6661,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_QueryChannelRangeDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_NodeAnnouncementInfoDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_QueryChannelRangeDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: &CResult_NodeAnnouncementInfoDecodeErrorZ) -> CResult_NodeAnnouncementInfoDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_QueryChannelRangeDecodeErrorZ_clone(orig: &CResult_QueryChannelRangeDecodeErrorZ) -> CResult_QueryChannelRangeDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_NodeInfoDecodeErrorZPtr { - pub result: *mut crate::routing::network_graph::NodeInfo, +pub union CResult_ReplyChannelRangeDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::ReplyChannelRange, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_NodeInfoDecodeErrorZ { - pub contents: CResult_NodeInfoDecodeErrorZPtr, +pub struct CResult_ReplyChannelRangeDecodeErrorZ { + pub contents: CResult_ReplyChannelRangeDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NodeInfoDecodeErrorZ_ok(o: crate::routing::network_graph::NodeInfo) -> CResult_NodeInfoDecodeErrorZ { - CResult_NodeInfoDecodeErrorZ { - contents: CResult_NodeInfoDecodeErrorZPtr { +pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_ok(o: crate::ln::msgs::ReplyChannelRange) -> CResult_ReplyChannelRangeDecodeErrorZ { + CResult_ReplyChannelRangeDecodeErrorZ { + contents: CResult_ReplyChannelRangeDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NodeInfoDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NodeInfoDecodeErrorZ { - CResult_NodeInfoDecodeErrorZ { - contents: CResult_NodeInfoDecodeErrorZPtr { +pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ReplyChannelRangeDecodeErrorZ { + CResult_ReplyChannelRangeDecodeErrorZ { + contents: CResult_ReplyChannelRangeDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NodeInfoDecodeErrorZ_free(_res: CResult_NodeInfoDecodeErrorZ) { } -impl Drop for CResult_NodeInfoDecodeErrorZ { +pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_free(_res: CResult_ReplyChannelRangeDecodeErrorZ) { } +impl Drop for CResult_ReplyChannelRangeDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -4234,16 +6719,16 @@ impl Drop for CResult_NodeInfoDecodeErrorZ { } } } -impl From> for CResult_NodeInfoDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_ReplyChannelRangeDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_NodeInfoDecodeErrorZPtr { result } + CResult_ReplyChannelRangeDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NodeInfoDecodeErrorZPtr { err } + CResult_ReplyChannelRangeDecodeErrorZPtr { err } }; Self { contents, @@ -4251,52 +6736,52 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_NodeInfoDecodeErrorZPtr { - result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + Self { result_ok: true, contents: CResult_ReplyChannelRangeDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_NodeInfoDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_ReplyChannelRangeDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_NodeInfoDecodeErrorZ_clone(orig: &CResult_NodeInfoDecodeErrorZ) -> CResult_NodeInfoDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: &CResult_ReplyChannelRangeDecodeErrorZ) -> CResult_ReplyChannelRangeDecodeErrorZ { orig.clone() } #[repr(C)] -pub union CResult_NetworkGraphDecodeErrorZPtr { - pub result: *mut crate::routing::network_graph::NetworkGraph, +pub union CResult_GossipTimestampFilterDecodeErrorZPtr { + pub result: *mut crate::ln::msgs::GossipTimestampFilter, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_NetworkGraphDecodeErrorZ { - pub contents: CResult_NetworkGraphDecodeErrorZPtr, +pub struct CResult_GossipTimestampFilterDecodeErrorZ { + pub contents: CResult_GossipTimestampFilterDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_ok(o: crate::routing::network_graph::NetworkGraph) -> CResult_NetworkGraphDecodeErrorZ { - CResult_NetworkGraphDecodeErrorZ { - contents: CResult_NetworkGraphDecodeErrorZPtr { +pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_ok(o: crate::ln::msgs::GossipTimestampFilter) -> CResult_GossipTimestampFilterDecodeErrorZ { + CResult_GossipTimestampFilterDecodeErrorZ { + contents: CResult_GossipTimestampFilterDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_NetworkGraphDecodeErrorZ { - CResult_NetworkGraphDecodeErrorZ { - contents: CResult_NetworkGraphDecodeErrorZPtr { +pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_GossipTimestampFilterDecodeErrorZ { + CResult_GossipTimestampFilterDecodeErrorZ { + contents: CResult_GossipTimestampFilterDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_NetworkGraphDecodeErrorZ_free(_res: CResult_NetworkGraphDecodeErrorZ) { } -impl Drop for CResult_NetworkGraphDecodeErrorZ { +pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_free(_res: CResult_GossipTimestampFilterDecodeErrorZ) { } +impl Drop for CResult_GossipTimestampFilterDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -4309,16 +6794,16 @@ impl Drop for CResult_NetworkGraphDecodeErrorZ { } } } -impl From> for CResult_NetworkGraphDecodeErrorZ { - fn from(mut o: crate::c_types::CResultTempl) -> Self { +impl From> for CResult_GossipTimestampFilterDecodeErrorZ { + fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_NetworkGraphDecodeErrorZPtr { result } + CResult_GossipTimestampFilterDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_NetworkGraphDecodeErrorZPtr { err } + CResult_GossipTimestampFilterDecodeErrorZPtr { err } }; Self { contents, @@ -4326,3 +6811,18 @@ impl From Self { + if self.result_ok { + Self { result_ok: true, contents: CResult_GossipTimestampFilterDecodeErrorZPtr { + result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) + } } + } else { + Self { result_ok: false, contents: CResult_GossipTimestampFilterDecodeErrorZPtr { + err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) + } } + } + } +} +#[no_mangle] +pub extern "C" fn CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: &CResult_GossipTimestampFilterDecodeErrorZ) -> CResult_GossipTimestampFilterDecodeErrorZ { orig.clone() } diff --git a/lightning-c-bindings/src/chain/channelmonitor.rs b/lightning-c-bindings/src/chain/channelmonitor.rs index 86617f1bb98..8b9a3afc8e1 100644 --- a/lightning-c-bindings/src/chain/channelmonitor.rs +++ b/lightning-c-bindings/src/chain/channelmonitor.rs @@ -56,24 +56,6 @@ impl ChannelMonitorUpdate { ret } } -impl Clone for ChannelMonitorUpdate { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelMonitorUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelMonitorUpdate)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelMonitorUpdate_clone(orig: &ChannelMonitorUpdate) -> ChannelMonitorUpdate { - orig.clone() -} /// The sequence number of this update. Updates *must* be replayed in-order according to this /// sequence number (and updates may panic if they are not). The update_id values are strictly /// increasing and increase by one for each new update, with one exception specified below. @@ -109,6 +91,24 @@ pub extern "C" fn ChannelMonitorUpdate_get_update_id(this_ptr: &ChannelMonitorUp pub extern "C" fn ChannelMonitorUpdate_set_update_id(this_ptr: &mut ChannelMonitorUpdate, mut val: u64) { unsafe { &mut *this_ptr.inner }.update_id = val; } +impl Clone for ChannelMonitorUpdate { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelMonitorUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelMonitorUpdate)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelMonitorUpdate_clone(orig: &ChannelMonitorUpdate) -> ChannelMonitorUpdate { + orig.clone() +} #[no_mangle] pub static CLOSED_CHANNEL_UPDATE_ID: u64 = lightning::chain::channelmonitor::CLOSED_CHANNEL_UPDATE_ID; @@ -401,19 +401,17 @@ pub extern "C" fn HTLCUpdate_clone(orig: &HTLCUpdate) -> HTLCUpdate { } #[no_mangle] pub extern "C" fn HTLCUpdate_write(obj: &HTLCUpdate) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn HTLCUpdate_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeHTLCUpdate) }) } #[no_mangle] -pub extern "C" fn HTLCUpdate_read(ser: crate::c_types::u8slice) -> HTLCUpdate { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - HTLCUpdate { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - HTLCUpdate { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn HTLCUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_HTLCUpdateDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::chain::channelmonitor::HTLCUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } use lightning::chain::channelmonitor::ChannelMonitor as nativeChannelMonitorImport; diff --git a/lightning-c-bindings/src/chain/keysinterface.rs b/lightning-c-bindings/src/chain/keysinterface.rs index 37758e8bc32..3083f0b9056 100644 --- a/lightning-c-bindings/src/chain/keysinterface.rs +++ b/lightning-c-bindings/src/chain/keysinterface.rs @@ -531,7 +531,7 @@ pub struct KeysInterface { /// contain no versioning scheme. You may wish to include your own version prefix and ensure /// you've read all of the provided bytes to ensure no corruption occurred. #[must_use] - pub read_chan_signer: extern "C" fn (this_arg: *const c_void, reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChanKeySignerDecodeErrorZ, + pub read_chan_signer: extern "C" fn (this_arg: *const c_void, reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelKeysDecodeErrorZ, pub free: Option, } unsafe impl Send for KeysInterface {} @@ -627,24 +627,6 @@ impl InMemoryChannelKeys { ret } } -impl Clone for InMemoryChannelKeys { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn InMemoryChannelKeys_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInMemoryChannelKeys)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn InMemoryChannelKeys_clone(orig: &InMemoryChannelKeys) -> InMemoryChannelKeys { - orig.clone() -} /// Private key of anchor tx #[no_mangle] pub extern "C" fn InMemoryChannelKeys_get_funding_key(this_ptr: &InMemoryChannelKeys) -> *const [u8; 32] { @@ -711,6 +693,24 @@ pub extern "C" fn InMemoryChannelKeys_get_commitment_seed(this_ptr: &InMemoryCha pub extern "C" fn InMemoryChannelKeys_set_commitment_seed(this_ptr: &mut InMemoryChannelKeys, mut val: crate::c_types::ThirtyTwoBytes) { unsafe { &mut *this_ptr.inner }.commitment_seed = val.data; } +impl Clone for InMemoryChannelKeys { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn InMemoryChannelKeys_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInMemoryChannelKeys)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn InMemoryChannelKeys_clone(orig: &InMemoryChannelKeys) -> InMemoryChannelKeys { + orig.clone() +} /// Create a new InMemoryChannelKeys #[must_use] #[no_mangle] @@ -1026,7 +1026,7 @@ extern "C" fn KeysManager_KeysInterface_get_secure_random_bytes(this_arg: *const crate::c_types::ThirtyTwoBytes { data: ret } } #[must_use] -extern "C" fn KeysManager_KeysInterface_read_chan_signer(this_arg: *const c_void, mut reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChanKeySignerDecodeErrorZ { +extern "C" fn KeysManager_KeysInterface_read_chan_signer(this_arg: *const c_void, mut reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelKeysDecodeErrorZ { let mut ret = unsafe { &mut *(this_arg as *mut nativeKeysManager) }.read_chan_signer(reader.to_slice()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { o.into() }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; local_ret diff --git a/lightning-c-bindings/src/chain/transaction.rs b/lightning-c-bindings/src/chain/transaction.rs index cb719789b5e..d0fd8c62112 100644 --- a/lightning-c-bindings/src/chain/transaction.rs +++ b/lightning-c-bindings/src/chain/transaction.rs @@ -45,24 +45,6 @@ impl OutPoint { ret } } -impl Clone for OutPoint { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn OutPoint_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOutPoint)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn OutPoint_clone(orig: &OutPoint) -> OutPoint { - orig.clone() -} /// The referenced transaction's txid. #[no_mangle] pub extern "C" fn OutPoint_get_txid(this_ptr: &OutPoint) -> *const [u8; 32] { @@ -93,6 +75,24 @@ pub extern "C" fn OutPoint_new(mut txid_arg: crate::c_types::ThirtyTwoBytes, mut index: index_arg, })), is_owned: true } } +impl Clone for OutPoint { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn OutPoint_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOutPoint)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn OutPoint_clone(orig: &OutPoint) -> OutPoint { + orig.clone() +} /// Convert an `OutPoint` to a lightning channel id. #[must_use] #[no_mangle] @@ -103,17 +103,15 @@ pub extern "C" fn OutPoint_to_channel_id(this_arg: &OutPoint) -> crate::c_types: #[no_mangle] pub extern "C" fn OutPoint_write(obj: &OutPoint) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn OutPoint_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeOutPoint) }) } #[no_mangle] -pub extern "C" fn OutPoint_read(ser: crate::c_types::u8slice) -> OutPoint { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - OutPoint { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - OutPoint { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn OutPoint_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OutPointDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } diff --git a/lightning-c-bindings/src/ln/chan_utils.rs b/lightning-c-bindings/src/ln/chan_utils.rs index df66c917687..2783d803d40 100644 --- a/lightning-c-bindings/src/ln/chan_utils.rs +++ b/lightning-c-bindings/src/ln/chan_utils.rs @@ -19,7 +19,7 @@ pub extern "C" fn build_commitment_secret(commitment_seed: *const [u8; 32], mut /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_private_key(mut per_commitment_point: crate::c_types::PublicKey, base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeySecpErrorZ { +pub extern "C" fn derive_private_key(mut per_commitment_point: crate::c_types::PublicKey, base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_private_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *base_secret}[..]).unwrap()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::SecretKey::from_rust(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -32,7 +32,7 @@ pub extern "C" fn derive_private_key(mut per_commitment_point: crate::c_types::P /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_public_key(mut per_commitment_point: crate::c_types::PublicKey, mut base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeySecpErrorZ { +pub extern "C" fn derive_public_key(mut per_commitment_point: crate::c_types::PublicKey, mut base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_public_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &base_point.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::PublicKey::from_rust(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -48,7 +48,7 @@ pub extern "C" fn derive_public_key(mut per_commitment_point: crate::c_types::Pu /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u8; 32], countersignatory_revocation_base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeySecpErrorZ { +pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u8; 32], countersignatory_revocation_base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_private_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *per_commitment_secret}[..]).unwrap(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *countersignatory_revocation_base_secret}[..]).unwrap()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::SecretKey::from_rust(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -66,7 +66,7 @@ pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_public_revocation_key(mut per_commitment_point: crate::c_types::PublicKey, mut countersignatory_revocation_base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeySecpErrorZ { +pub extern "C" fn derive_public_revocation_key(mut per_commitment_point: crate::c_types::PublicKey, mut countersignatory_revocation_base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_public_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &countersignatory_revocation_base_point.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::PublicKey::from_rust(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -120,24 +120,6 @@ impl TxCreationKeys { ret } } -impl Clone for TxCreationKeys { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn TxCreationKeys_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeTxCreationKeys)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn TxCreationKeys_clone(orig: &TxCreationKeys) -> TxCreationKeys { - orig.clone() -} /// The broadcaster's per-commitment public key which was used to derive the other keys. #[no_mangle] pub extern "C" fn TxCreationKeys_get_per_commitment_point(this_ptr: &TxCreationKeys) -> crate::c_types::PublicKey { @@ -208,21 +190,37 @@ pub extern "C" fn TxCreationKeys_new(mut per_commitment_point_arg: crate::c_type broadcaster_delayed_payment_key: broadcaster_delayed_payment_key_arg.into_rust(), })), is_owned: true } } +impl Clone for TxCreationKeys { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn TxCreationKeys_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeTxCreationKeys)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn TxCreationKeys_clone(orig: &TxCreationKeys) -> TxCreationKeys { + orig.clone() +} #[no_mangle] pub extern "C" fn TxCreationKeys_write(obj: &TxCreationKeys) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn TxCreationKeys_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeTxCreationKeys) }) } #[no_mangle] -pub extern "C" fn TxCreationKeys_read(ser: crate::c_types::u8slice) -> TxCreationKeys { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - TxCreationKeys { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - TxCreationKeys { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn TxCreationKeys_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_TxCreationKeysDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::TxCreationKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } use lightning::ln::chan_utils::ChannelPublicKeys as nativeChannelPublicKeysImport; @@ -262,24 +260,6 @@ impl ChannelPublicKeys { ret } } -impl Clone for ChannelPublicKeys { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelPublicKeys_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelPublicKeys)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelPublicKeys_clone(orig: &ChannelPublicKeys) -> ChannelPublicKeys { - orig.clone() -} /// The public key which is used to sign all commitment transactions, as it appears in the /// on-chain channel lock-in 2-of-2 multisig output. #[no_mangle] @@ -364,27 +344,43 @@ pub extern "C" fn ChannelPublicKeys_new(mut funding_pubkey_arg: crate::c_types:: htlc_basepoint: htlc_basepoint_arg.into_rust(), })), is_owned: true } } +impl Clone for ChannelPublicKeys { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelPublicKeys_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelPublicKeys)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelPublicKeys_clone(orig: &ChannelPublicKeys) -> ChannelPublicKeys { + orig.clone() +} #[no_mangle] pub extern "C" fn ChannelPublicKeys_write(obj: &ChannelPublicKeys) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn ChannelPublicKeys_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelPublicKeys) }) } #[no_mangle] -pub extern "C" fn ChannelPublicKeys_read(ser: crate::c_types::u8slice) -> ChannelPublicKeys { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - ChannelPublicKeys { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - ChannelPublicKeys { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn ChannelPublicKeys_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelPublicKeysDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::ChannelPublicKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } /// Create per-state keys from channel base points and the per-commitment point. /// Key set is asymmetric and can't be used as part of counter-signatory set of transactions. #[must_use] #[no_mangle] -pub extern "C" fn TxCreationKeys_derive_new(mut per_commitment_point: crate::c_types::PublicKey, mut broadcaster_delayed_payment_base: crate::c_types::PublicKey, mut broadcaster_htlc_base: crate::c_types::PublicKey, mut countersignatory_revocation_base: crate::c_types::PublicKey, mut countersignatory_htlc_base: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_TxCreationKeysSecpErrorZ { +pub extern "C" fn TxCreationKeys_derive_new(mut per_commitment_point: crate::c_types::PublicKey, mut broadcaster_delayed_payment_base: crate::c_types::PublicKey, mut broadcaster_htlc_base: crate::c_types::PublicKey, mut countersignatory_revocation_base: crate::c_types::PublicKey, mut countersignatory_htlc_base: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_TxCreationKeysErrorZ { let mut ret = lightning::ln::chan_utils::TxCreationKeys::derive_new(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &broadcaster_delayed_payment_base.into_rust(), &broadcaster_htlc_base.into_rust(), &countersignatory_revocation_base.into_rust(), &countersignatory_htlc_base.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::TxCreationKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -394,7 +390,7 @@ pub extern "C" fn TxCreationKeys_derive_new(mut per_commitment_point: crate::c_t /// Key set is asymmetric and can't be used as part of counter-signatory set of transactions. #[must_use] #[no_mangle] -pub extern "C" fn TxCreationKeys_from_channel_static_keys(mut per_commitment_point: crate::c_types::PublicKey, broadcaster_keys: &crate::ln::chan_utils::ChannelPublicKeys, countersignatory_keys: &crate::ln::chan_utils::ChannelPublicKeys) -> crate::c_types::derived::CResult_TxCreationKeysSecpErrorZ { +pub extern "C" fn TxCreationKeys_from_channel_static_keys(mut per_commitment_point: crate::c_types::PublicKey, broadcaster_keys: &crate::ln::chan_utils::ChannelPublicKeys, countersignatory_keys: &crate::ln::chan_utils::ChannelPublicKeys) -> crate::c_types::derived::CResult_TxCreationKeysErrorZ { let mut ret = lightning::ln::chan_utils::TxCreationKeys::from_channel_static_keys(&per_commitment_point.into_rust(), unsafe { &*broadcaster_keys.inner }, unsafe { &*countersignatory_keys.inner }, &bitcoin::secp256k1::Secp256k1::new()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::TxCreationKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -447,24 +443,6 @@ impl HTLCOutputInCommitment { ret } } -impl Clone for HTLCOutputInCommitment { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn HTLCOutputInCommitment_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHTLCOutputInCommitment)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn HTLCOutputInCommitment_clone(orig: &HTLCOutputInCommitment) -> HTLCOutputInCommitment { - orig.clone() -} /// Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction). /// Note that this is not the same as whether it is ountbound *from us*. To determine that you /// need to compare this value to whether the commitment transaction in question is that of @@ -517,21 +495,37 @@ pub extern "C" fn HTLCOutputInCommitment_get_payment_hash(this_ptr: &HTLCOutputI pub extern "C" fn HTLCOutputInCommitment_set_payment_hash(this_ptr: &mut HTLCOutputInCommitment, mut val: crate::c_types::ThirtyTwoBytes) { unsafe { &mut *this_ptr.inner }.payment_hash = ::lightning::ln::channelmanager::PaymentHash(val.data); } +impl Clone for HTLCOutputInCommitment { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn HTLCOutputInCommitment_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHTLCOutputInCommitment)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn HTLCOutputInCommitment_clone(orig: &HTLCOutputInCommitment) -> HTLCOutputInCommitment { + orig.clone() +} #[no_mangle] pub extern "C" fn HTLCOutputInCommitment_write(obj: &HTLCOutputInCommitment) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn HTLCOutputInCommitment_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeHTLCOutputInCommitment) }) } #[no_mangle] -pub extern "C" fn HTLCOutputInCommitment_read(ser: crate::c_types::u8slice) -> HTLCOutputInCommitment { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - HTLCOutputInCommitment { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - HTLCOutputInCommitment { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn HTLCOutputInCommitment_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_HTLCOutputInCommitmentDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::HTLCOutputInCommitment { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } /// Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc /// does not need to have its previous_output_index filled. @@ -599,24 +593,6 @@ impl ChannelTransactionParameters { ret } } -impl Clone for ChannelTransactionParameters { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelTransactionParameters_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTransactionParameters)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelTransactionParameters_clone(orig: &ChannelTransactionParameters) -> ChannelTransactionParameters { - orig.clone() -} /// Holder public keys #[no_mangle] pub extern "C" fn ChannelTransactionParameters_get_holder_pubkeys(this_ptr: &ChannelTransactionParameters) -> crate::ln::chan_utils::ChannelPublicKeys { @@ -693,6 +669,24 @@ pub extern "C" fn ChannelTransactionParameters_new(mut holder_pubkeys_arg: crate funding_outpoint: local_funding_outpoint_arg, })), is_owned: true } } +impl Clone for ChannelTransactionParameters { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelTransactionParameters_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTransactionParameters)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelTransactionParameters_clone(orig: &ChannelTransactionParameters) -> ChannelTransactionParameters { + orig.clone() +} use lightning::ln::chan_utils::CounterpartyChannelTransactionParameters as nativeCounterpartyChannelTransactionParametersImport; type nativeCounterpartyChannelTransactionParameters = nativeCounterpartyChannelTransactionParametersImport; @@ -731,24 +725,6 @@ impl CounterpartyChannelTransactionParameters { ret } } -impl Clone for CounterpartyChannelTransactionParameters { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn CounterpartyChannelTransactionParameters_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCounterpartyChannelTransactionParameters)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn CounterpartyChannelTransactionParameters_clone(orig: &CounterpartyChannelTransactionParameters) -> CounterpartyChannelTransactionParameters { - orig.clone() -} /// Counter-party public keys #[no_mangle] pub extern "C" fn CounterpartyChannelTransactionParameters_get_pubkeys(this_ptr: &CounterpartyChannelTransactionParameters) -> crate::ln::chan_utils::ChannelPublicKeys { @@ -779,6 +755,24 @@ pub extern "C" fn CounterpartyChannelTransactionParameters_new(mut pubkeys_arg: selected_contest_delay: selected_contest_delay_arg, })), is_owned: true } } +impl Clone for CounterpartyChannelTransactionParameters { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn CounterpartyChannelTransactionParameters_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCounterpartyChannelTransactionParameters)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn CounterpartyChannelTransactionParameters_clone(orig: &CounterpartyChannelTransactionParameters) -> CounterpartyChannelTransactionParameters { + orig.clone() +} /// Whether the late bound parameters are populated. #[must_use] #[no_mangle] @@ -811,35 +805,31 @@ pub extern "C" fn ChannelTransactionParameters_as_counterparty_broadcastable(thi #[no_mangle] pub extern "C" fn CounterpartyChannelTransactionParameters_write(obj: &CounterpartyChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn CounterpartyChannelTransactionParameters_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeCounterpartyChannelTransactionParameters) }) } #[no_mangle] -pub extern "C" fn CounterpartyChannelTransactionParameters_read(ser: crate::c_types::u8slice) -> CounterpartyChannelTransactionParameters { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - CounterpartyChannelTransactionParameters { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - CounterpartyChannelTransactionParameters { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn CounterpartyChannelTransactionParameters_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CounterpartyChannelTransactionParametersDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::CounterpartyChannelTransactionParameters { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn ChannelTransactionParameters_write(obj: &ChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn ChannelTransactionParameters_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTransactionParameters) }) } #[no_mangle] -pub extern "C" fn ChannelTransactionParameters_read(ser: crate::c_types::u8slice) -> ChannelTransactionParameters { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - ChannelTransactionParameters { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - ChannelTransactionParameters { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn ChannelTransactionParameters_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTransactionParametersDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::ChannelTransactionParameters { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } use lightning::ln::chan_utils::DirectedChannelTransactionParameters as nativeDirectedChannelTransactionParametersImport; @@ -967,6 +957,23 @@ impl HolderCommitmentTransaction { ret } } +/// Our counterparty's signature for the transaction +#[no_mangle] +pub extern "C" fn HolderCommitmentTransaction_get_counterparty_sig(this_ptr: &HolderCommitmentTransaction) -> crate::c_types::Signature { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.counterparty_sig; + crate::c_types::Signature::from_rust(&(*inner_val)) +} +/// Our counterparty's signature for the transaction +#[no_mangle] +pub extern "C" fn HolderCommitmentTransaction_set_counterparty_sig(this_ptr: &mut HolderCommitmentTransaction, mut val: crate::c_types::Signature) { + unsafe { &mut *this_ptr.inner }.counterparty_sig = val.into_rust(); +} +/// All non-dust counterparty HTLC signatures, in the order they appear in the transaction +#[no_mangle] +pub extern "C" fn HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_ptr: &mut HolderCommitmentTransaction, mut val: crate::c_types::derived::CVec_SignatureZ) { + let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_rust() }); }; + unsafe { &mut *this_ptr.inner }.counterparty_htlc_sigs = local_val; +} impl Clone for HolderCommitmentTransaction { fn clone(&self) -> Self { Self { @@ -985,38 +992,19 @@ pub(crate) extern "C" fn HolderCommitmentTransaction_clone_void(this_ptr: *const pub extern "C" fn HolderCommitmentTransaction_clone(orig: &HolderCommitmentTransaction) -> HolderCommitmentTransaction { orig.clone() } -/// Our counterparty's signature for the transaction -#[no_mangle] -pub extern "C" fn HolderCommitmentTransaction_get_counterparty_sig(this_ptr: &HolderCommitmentTransaction) -> crate::c_types::Signature { - let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.counterparty_sig; - crate::c_types::Signature::from_rust(&(*inner_val)) -} -/// Our counterparty's signature for the transaction -#[no_mangle] -pub extern "C" fn HolderCommitmentTransaction_set_counterparty_sig(this_ptr: &mut HolderCommitmentTransaction, mut val: crate::c_types::Signature) { - unsafe { &mut *this_ptr.inner }.counterparty_sig = val.into_rust(); -} -/// All non-dust counterparty HTLC signatures, in the order they appear in the transaction -#[no_mangle] -pub extern "C" fn HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_ptr: &mut HolderCommitmentTransaction, mut val: crate::c_types::derived::CVec_SignatureZ) { - let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_rust() }); }; - unsafe { &mut *this_ptr.inner }.counterparty_htlc_sigs = local_val; -} #[no_mangle] pub extern "C" fn HolderCommitmentTransaction_write(obj: &HolderCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn HolderCommitmentTransaction_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeHolderCommitmentTransaction) }) } #[no_mangle] -pub extern "C" fn HolderCommitmentTransaction_read(ser: crate::c_types::u8slice) -> HolderCommitmentTransaction { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - HolderCommitmentTransaction { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - HolderCommitmentTransaction { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn HolderCommitmentTransaction_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_HolderCommitmentTransactionDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::HolderCommitmentTransaction { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } /// Create a new holder transaction with the given counterparty signatures. /// The funding keys are used to figure out which signature should go first when building the transaction for broadcast. @@ -1066,24 +1054,6 @@ impl BuiltCommitmentTransaction { ret } } -impl Clone for BuiltCommitmentTransaction { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn BuiltCommitmentTransaction_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBuiltCommitmentTransaction)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn BuiltCommitmentTransaction_clone(orig: &BuiltCommitmentTransaction) -> BuiltCommitmentTransaction { - orig.clone() -} /// The commitment transaction #[no_mangle] pub extern "C" fn BuiltCommitmentTransaction_get_transaction(this_ptr: &BuiltCommitmentTransaction) -> crate::c_types::Transaction { @@ -1121,21 +1091,37 @@ pub extern "C" fn BuiltCommitmentTransaction_new(mut transaction_arg: crate::c_t txid: ::bitcoin::hash_types::Txid::from_slice(&txid_arg.data[..]).unwrap(), })), is_owned: true } } +impl Clone for BuiltCommitmentTransaction { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn BuiltCommitmentTransaction_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBuiltCommitmentTransaction)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn BuiltCommitmentTransaction_clone(orig: &BuiltCommitmentTransaction) -> BuiltCommitmentTransaction { + orig.clone() +} #[no_mangle] pub extern "C" fn BuiltCommitmentTransaction_write(obj: &BuiltCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn BuiltCommitmentTransaction_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBuiltCommitmentTransaction) }) } #[no_mangle] -pub extern "C" fn BuiltCommitmentTransaction_read(ser: crate::c_types::u8slice) -> BuiltCommitmentTransaction { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - BuiltCommitmentTransaction { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - BuiltCommitmentTransaction { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn BuiltCommitmentTransaction_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BuiltCommitmentTransactionDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::BuiltCommitmentTransaction { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } /// Get the SIGHASH_ALL sighash value of the transaction. /// @@ -1219,19 +1205,17 @@ pub extern "C" fn CommitmentTransaction_clone(orig: &CommitmentTransaction) -> C } #[no_mangle] pub extern "C" fn CommitmentTransaction_write(obj: &CommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn CommitmentTransaction_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeCommitmentTransaction) }) } #[no_mangle] -pub extern "C" fn CommitmentTransaction_read(ser: crate::c_types::u8slice) -> CommitmentTransaction { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - CommitmentTransaction { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - CommitmentTransaction { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn CommitmentTransaction_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CommitmentTransactionDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::CommitmentTransaction { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } /// The backwards-counting commitment number #[must_use] diff --git a/lightning-c-bindings/src/ln/channelmanager.rs b/lightning-c-bindings/src/ln/channelmanager.rs index d40fb891256..77c6b5aded5 100644 --- a/lightning-c-bindings/src/ln/channelmanager.rs +++ b/lightning-c-bindings/src/ln/channelmanager.rs @@ -124,24 +124,6 @@ impl ChannelDetails { ret } } -impl Clone for ChannelDetails { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelDetails_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelDetails)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelDetails_clone(orig: &ChannelDetails) -> ChannelDetails { - orig.clone() -} /// The channel's ID (prior to funding transaction generation, this is a random 32 bytes, /// thereafter this is the txid of the funding transaction xor the funding transaction output). /// Note that this means this value is *not* persistent - it can change once during the @@ -176,7 +158,7 @@ pub extern "C" fn ChannelDetails_set_remote_network_id(this_ptr: &mut ChannelDet #[no_mangle] pub extern "C" fn ChannelDetails_get_counterparty_features(this_ptr: &ChannelDetails) -> crate::ln::features::InitFeatures { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.counterparty_features; - crate::ln::features::InitFeatures { inner: &mut (*inner_val), is_owned: false } + crate::ln::features::InitFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false } } /// The Features the channel counterparty provided upon last connection. /// Useful for routing as it is the most up-to-date copy of the counterparty's features and @@ -256,6 +238,24 @@ pub extern "C" fn ChannelDetails_get_is_live(this_ptr: &ChannelDetails) -> bool pub extern "C" fn ChannelDetails_set_is_live(this_ptr: &mut ChannelDetails, mut val: bool) { unsafe { &mut *this_ptr.inner }.is_live = val; } +impl Clone for ChannelDetails { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelDetails_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelDetails)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelDetails_clone(orig: &ChannelDetails) -> ChannelDetails { + orig.clone() +} use lightning::ln::channelmanager::PaymentSendFailure as nativePaymentSendFailureImport; type nativePaymentSendFailure = nativePaymentSendFailureImport; diff --git a/lightning-c-bindings/src/ln/features.rs b/lightning-c-bindings/src/ln/features.rs index b01b011a5ae..71adebeb572 100644 --- a/lightning-c-bindings/src/ln/features.rs +++ b/lightning-c-bindings/src/ln/features.rs @@ -20,6 +20,60 @@ use std::ffi::c_void; use bitcoin::hashes::Hash; use crate::c_types::*; +impl Clone for InitFeatures { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures { + orig.clone() +} +impl Clone for NodeFeatures { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures { + orig.clone() +} +impl Clone for ChannelFeatures { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures { + orig.clone() +} use lightning::ln::features::InitFeatures as nativeInitFeaturesImport; type nativeInitFeatures = nativeInitFeaturesImport; @@ -134,3 +188,99 @@ impl ChannelFeatures { ret } } +/// Create a blank Features with no features set +#[must_use] +#[no_mangle] +pub extern "C" fn InitFeatures_empty() -> InitFeatures { + let mut ret = lightning::ln::features::InitFeatures::empty(); + InitFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true } +} + +/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. +/// +/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS +#[must_use] +#[no_mangle] +pub extern "C" fn InitFeatures_known() -> InitFeatures { + let mut ret = lightning::ln::features::InitFeatures::known(); + InitFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true } +} + +/// Create a blank Features with no features set +#[must_use] +#[no_mangle] +pub extern "C" fn NodeFeatures_empty() -> NodeFeatures { + let mut ret = lightning::ln::features::NodeFeatures::empty(); + NodeFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true } +} + +/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. +/// +/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS +#[must_use] +#[no_mangle] +pub extern "C" fn NodeFeatures_known() -> NodeFeatures { + let mut ret = lightning::ln::features::NodeFeatures::known(); + NodeFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true } +} + +/// Create a blank Features with no features set +#[must_use] +#[no_mangle] +pub extern "C" fn ChannelFeatures_empty() -> ChannelFeatures { + let mut ret = lightning::ln::features::ChannelFeatures::empty(); + ChannelFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true } +} + +/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`]. +/// +/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS +#[must_use] +#[no_mangle] +pub extern "C" fn ChannelFeatures_known() -> ChannelFeatures { + let mut ret = lightning::ln::features::ChannelFeatures::known(); + ChannelFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true } +} + +#[no_mangle] +pub extern "C" fn InitFeatures_write(obj: &InitFeatures) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) +} +#[no_mangle] +pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) }) +} +#[no_mangle] +pub extern "C" fn NodeFeatures_write(obj: &NodeFeatures) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) +} +#[no_mangle] +pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) }) +} +#[no_mangle] +pub extern "C" fn ChannelFeatures_write(obj: &ChannelFeatures) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) +} +#[no_mangle] +pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) }) +} +#[no_mangle] +pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::features::InitFeatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res +} +#[no_mangle] +pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::features::NodeFeatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res +} +#[no_mangle] +pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::features::ChannelFeatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res +} diff --git a/lightning-c-bindings/src/ln/msgs.rs b/lightning-c-bindings/src/ln/msgs.rs index 03cb1066d3e..308730f5350 100644 --- a/lightning-c-bindings/src/ln/msgs.rs +++ b/lightning-c-bindings/src/ln/msgs.rs @@ -169,24 +169,6 @@ impl ErrorMessage { ret } } -impl Clone for ErrorMessage { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ErrorMessage_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeErrorMessage)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ErrorMessage_clone(orig: &ErrorMessage) -> ErrorMessage { - orig.clone() -} /// The channel ID involved in the error #[no_mangle] pub extern "C" fn ErrorMessage_get_channel_id(this_ptr: &ErrorMessage) -> *const [u8; 32] { @@ -223,6 +205,24 @@ pub extern "C" fn ErrorMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwo data: String::from_utf8(data_arg.into_rust()).unwrap(), })), is_owned: true } } +impl Clone for ErrorMessage { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ErrorMessage_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeErrorMessage)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ErrorMessage_clone(orig: &ErrorMessage) -> ErrorMessage { + orig.clone() +} use lightning::ln::msgs::Ping as nativePingImport; type nativePing = nativePingImport; @@ -261,24 +261,6 @@ impl Ping { ret } } -impl Clone for Ping { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn Ping_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePing)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn Ping_clone(orig: &Ping) -> Ping { - orig.clone() -} /// The desired response length #[no_mangle] pub extern "C" fn Ping_get_ponglen(this_ptr: &Ping) -> u16 { @@ -311,6 +293,24 @@ pub extern "C" fn Ping_new(mut ponglen_arg: u16, mut byteslen_arg: u16) -> Ping byteslen: byteslen_arg, })), is_owned: true } } +impl Clone for Ping { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn Ping_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePing)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn Ping_clone(orig: &Ping) -> Ping { + orig.clone() +} use lightning::ln::msgs::Pong as nativePongImport; type nativePong = nativePongImport; @@ -349,24 +349,6 @@ impl Pong { ret } } -impl Clone for Pong { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn Pong_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePong)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn Pong_clone(orig: &Pong) -> Pong { - orig.clone() -} /// The pong packet size. /// This field is not sent on the wire. byteslen zeros are sent. #[no_mangle] @@ -387,6 +369,24 @@ pub extern "C" fn Pong_new(mut byteslen_arg: u16) -> Pong { byteslen: byteslen_arg, })), is_owned: true } } +impl Clone for Pong { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn Pong_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePong)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn Pong_clone(orig: &Pong) -> Pong { + orig.clone() +} use lightning::ln::msgs::OpenChannel as nativeOpenChannelImport; type nativeOpenChannel = nativeOpenChannelImport; @@ -425,24 +425,6 @@ impl OpenChannel { ret } } -impl Clone for OpenChannel { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn OpenChannel_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOpenChannel)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn OpenChannel_clone(orig: &OpenChannel) -> OpenChannel { - orig.clone() -} /// The genesis hash of the blockchain where the channel is to be opened #[no_mangle] pub extern "C" fn OpenChannel_get_chain_hash(this_ptr: &OpenChannel) -> *const [u8; 32] { @@ -641,6 +623,24 @@ pub extern "C" fn OpenChannel_get_channel_flags(this_ptr: &OpenChannel) -> u8 { pub extern "C" fn OpenChannel_set_channel_flags(this_ptr: &mut OpenChannel, mut val: u8) { unsafe { &mut *this_ptr.inner }.channel_flags = val; } +impl Clone for OpenChannel { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn OpenChannel_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOpenChannel)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn OpenChannel_clone(orig: &OpenChannel) -> OpenChannel { + orig.clone() +} use lightning::ln::msgs::AcceptChannel as nativeAcceptChannelImport; type nativeAcceptChannel = nativeAcceptChannelImport; @@ -679,24 +679,6 @@ impl AcceptChannel { ret } } -impl Clone for AcceptChannel { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn AcceptChannel_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAcceptChannel)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn AcceptChannel_clone(orig: &AcceptChannel) -> AcceptChannel { - orig.clone() -} /// A temporary channel ID, until the funding outpoint is announced #[no_mangle] pub extern "C" fn AcceptChannel_get_temporary_channel_id(this_ptr: &AcceptChannel) -> *const [u8; 32] { @@ -851,6 +833,24 @@ pub extern "C" fn AcceptChannel_get_first_per_commitment_point(this_ptr: &Accept pub extern "C" fn AcceptChannel_set_first_per_commitment_point(this_ptr: &mut AcceptChannel, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.first_per_commitment_point = val.into_rust(); } +impl Clone for AcceptChannel { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn AcceptChannel_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAcceptChannel)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn AcceptChannel_clone(orig: &AcceptChannel) -> AcceptChannel { + orig.clone() +} use lightning::ln::msgs::FundingCreated as nativeFundingCreatedImport; type nativeFundingCreated = nativeFundingCreatedImport; @@ -889,24 +889,6 @@ impl FundingCreated { ret } } -impl Clone for FundingCreated { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn FundingCreated_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingCreated)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn FundingCreated_clone(orig: &FundingCreated) -> FundingCreated { - orig.clone() -} /// A temporary channel ID, until the funding is established #[no_mangle] pub extern "C" fn FundingCreated_get_temporary_channel_id(this_ptr: &FundingCreated) -> *const [u8; 32] { @@ -961,6 +943,24 @@ pub extern "C" fn FundingCreated_new(mut temporary_channel_id_arg: crate::c_type signature: signature_arg.into_rust(), })), is_owned: true } } +impl Clone for FundingCreated { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn FundingCreated_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingCreated)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn FundingCreated_clone(orig: &FundingCreated) -> FundingCreated { + orig.clone() +} use lightning::ln::msgs::FundingSigned as nativeFundingSignedImport; type nativeFundingSigned = nativeFundingSignedImport; @@ -999,24 +999,6 @@ impl FundingSigned { ret } } -impl Clone for FundingSigned { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn FundingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingSigned)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn FundingSigned_clone(orig: &FundingSigned) -> FundingSigned { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn FundingSigned_get_channel_id(this_ptr: &FundingSigned) -> *const [u8; 32] { @@ -1047,6 +1029,24 @@ pub extern "C" fn FundingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw signature: signature_arg.into_rust(), })), is_owned: true } } +impl Clone for FundingSigned { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn FundingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingSigned)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn FundingSigned_clone(orig: &FundingSigned) -> FundingSigned { + orig.clone() +} use lightning::ln::msgs::FundingLocked as nativeFundingLockedImport; type nativeFundingLocked = nativeFundingLockedImport; @@ -1085,24 +1085,6 @@ impl FundingLocked { ret } } -impl Clone for FundingLocked { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn FundingLocked_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingLocked)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn FundingLocked_clone(orig: &FundingLocked) -> FundingLocked { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn FundingLocked_get_channel_id(this_ptr: &FundingLocked) -> *const [u8; 32] { @@ -1133,6 +1115,24 @@ pub extern "C" fn FundingLocked_new(mut channel_id_arg: crate::c_types::ThirtyTw next_per_commitment_point: next_per_commitment_point_arg.into_rust(), })), is_owned: true } } +impl Clone for FundingLocked { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn FundingLocked_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingLocked)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn FundingLocked_clone(orig: &FundingLocked) -> FundingLocked { + orig.clone() +} use lightning::ln::msgs::Shutdown as nativeShutdownImport; type nativeShutdown = nativeShutdownImport; @@ -1171,24 +1171,6 @@ impl Shutdown { ret } } -impl Clone for Shutdown { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn Shutdown_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeShutdown)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn Shutdown_clone(orig: &Shutdown) -> Shutdown { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn Shutdown_get_channel_id(this_ptr: &Shutdown) -> *const [u8; 32] { @@ -1221,6 +1203,24 @@ pub extern "C" fn Shutdown_new(mut channel_id_arg: crate::c_types::ThirtyTwoByte scriptpubkey: ::bitcoin::blockdata::script::Script::from(scriptpubkey_arg.into_rust()), })), is_owned: true } } +impl Clone for Shutdown { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn Shutdown_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeShutdown)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn Shutdown_clone(orig: &Shutdown) -> Shutdown { + orig.clone() +} use lightning::ln::msgs::ClosingSigned as nativeClosingSignedImport; type nativeClosingSigned = nativeClosingSignedImport; @@ -1259,24 +1259,6 @@ impl ClosingSigned { ret } } -impl Clone for ClosingSigned { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ClosingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeClosingSigned)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ClosingSigned_clone(orig: &ClosingSigned) -> ClosingSigned { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn ClosingSigned_get_channel_id(this_ptr: &ClosingSigned) -> *const [u8; 32] { @@ -1319,6 +1301,24 @@ pub extern "C" fn ClosingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw signature: signature_arg.into_rust(), })), is_owned: true } } +impl Clone for ClosingSigned { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ClosingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeClosingSigned)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ClosingSigned_clone(orig: &ClosingSigned) -> ClosingSigned { + orig.clone() +} use lightning::ln::msgs::UpdateAddHTLC as nativeUpdateAddHTLCImport; type nativeUpdateAddHTLC = nativeUpdateAddHTLCImport; @@ -1357,24 +1357,6 @@ impl UpdateAddHTLC { ret } } -impl Clone for UpdateAddHTLC { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UpdateAddHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateAddHTLC)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UpdateAddHTLC_clone(orig: &UpdateAddHTLC) -> UpdateAddHTLC { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn UpdateAddHTLC_get_channel_id(this_ptr: &UpdateAddHTLC) -> *const [u8; 32] { @@ -1430,6 +1412,24 @@ pub extern "C" fn UpdateAddHTLC_get_cltv_expiry(this_ptr: &UpdateAddHTLC) -> u32 pub extern "C" fn UpdateAddHTLC_set_cltv_expiry(this_ptr: &mut UpdateAddHTLC, mut val: u32) { unsafe { &mut *this_ptr.inner }.cltv_expiry = val; } +impl Clone for UpdateAddHTLC { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UpdateAddHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateAddHTLC)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UpdateAddHTLC_clone(orig: &UpdateAddHTLC) -> UpdateAddHTLC { + orig.clone() +} use lightning::ln::msgs::UpdateFulfillHTLC as nativeUpdateFulfillHTLCImport; type nativeUpdateFulfillHTLC = nativeUpdateFulfillHTLCImport; @@ -1468,24 +1468,6 @@ impl UpdateFulfillHTLC { ret } } -impl Clone for UpdateFulfillHTLC { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UpdateFulfillHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFulfillHTLC)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UpdateFulfillHTLC_clone(orig: &UpdateFulfillHTLC) -> UpdateFulfillHTLC { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn UpdateFulfillHTLC_get_channel_id(this_ptr: &UpdateFulfillHTLC) -> *const [u8; 32] { @@ -1528,6 +1510,24 @@ pub extern "C" fn UpdateFulfillHTLC_new(mut channel_id_arg: crate::c_types::Thir payment_preimage: ::lightning::ln::channelmanager::PaymentPreimage(payment_preimage_arg.data), })), is_owned: true } } +impl Clone for UpdateFulfillHTLC { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UpdateFulfillHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFulfillHTLC)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UpdateFulfillHTLC_clone(orig: &UpdateFulfillHTLC) -> UpdateFulfillHTLC { + orig.clone() +} use lightning::ln::msgs::UpdateFailHTLC as nativeUpdateFailHTLCImport; type nativeUpdateFailHTLC = nativeUpdateFailHTLCImport; @@ -1566,24 +1566,6 @@ impl UpdateFailHTLC { ret } } -impl Clone for UpdateFailHTLC { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UpdateFailHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailHTLC)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UpdateFailHTLC_clone(orig: &UpdateFailHTLC) -> UpdateFailHTLC { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn UpdateFailHTLC_get_channel_id(this_ptr: &UpdateFailHTLC) -> *const [u8; 32] { @@ -1606,6 +1588,24 @@ pub extern "C" fn UpdateFailHTLC_get_htlc_id(this_ptr: &UpdateFailHTLC) -> u64 { pub extern "C" fn UpdateFailHTLC_set_htlc_id(this_ptr: &mut UpdateFailHTLC, mut val: u64) { unsafe { &mut *this_ptr.inner }.htlc_id = val; } +impl Clone for UpdateFailHTLC { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UpdateFailHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailHTLC)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UpdateFailHTLC_clone(orig: &UpdateFailHTLC) -> UpdateFailHTLC { + orig.clone() +} use lightning::ln::msgs::UpdateFailMalformedHTLC as nativeUpdateFailMalformedHTLCImport; type nativeUpdateFailMalformedHTLC = nativeUpdateFailMalformedHTLCImport; @@ -1644,24 +1644,6 @@ impl UpdateFailMalformedHTLC { ret } } -impl Clone for UpdateFailMalformedHTLC { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UpdateFailMalformedHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailMalformedHTLC)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UpdateFailMalformedHTLC_clone(orig: &UpdateFailMalformedHTLC) -> UpdateFailMalformedHTLC { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn UpdateFailMalformedHTLC_get_channel_id(this_ptr: &UpdateFailMalformedHTLC) -> *const [u8; 32] { @@ -1695,6 +1677,24 @@ pub extern "C" fn UpdateFailMalformedHTLC_get_failure_code(this_ptr: &UpdateFail pub extern "C" fn UpdateFailMalformedHTLC_set_failure_code(this_ptr: &mut UpdateFailMalformedHTLC, mut val: u16) { unsafe { &mut *this_ptr.inner }.failure_code = val; } +impl Clone for UpdateFailMalformedHTLC { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UpdateFailMalformedHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailMalformedHTLC)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UpdateFailMalformedHTLC_clone(orig: &UpdateFailMalformedHTLC) -> UpdateFailMalformedHTLC { + orig.clone() +} use lightning::ln::msgs::CommitmentSigned as nativeCommitmentSignedImport; type nativeCommitmentSigned = nativeCommitmentSignedImport; @@ -1733,24 +1733,6 @@ impl CommitmentSigned { ret } } -impl Clone for CommitmentSigned { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn CommitmentSigned_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentSigned)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn CommitmentSigned_clone(orig: &CommitmentSigned) -> CommitmentSigned { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn CommitmentSigned_get_channel_id(this_ptr: &CommitmentSigned) -> *const [u8; 32] { @@ -1789,6 +1771,24 @@ pub extern "C" fn CommitmentSigned_new(mut channel_id_arg: crate::c_types::Thirt htlc_signatures: local_htlc_signatures_arg, })), is_owned: true } } +impl Clone for CommitmentSigned { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn CommitmentSigned_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentSigned)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn CommitmentSigned_clone(orig: &CommitmentSigned) -> CommitmentSigned { + orig.clone() +} use lightning::ln::msgs::RevokeAndACK as nativeRevokeAndACKImport; type nativeRevokeAndACK = nativeRevokeAndACKImport; @@ -1827,24 +1827,6 @@ impl RevokeAndACK { ret } } -impl Clone for RevokeAndACK { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn RevokeAndACK_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRevokeAndACK)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn RevokeAndACK_clone(orig: &RevokeAndACK) -> RevokeAndACK { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn RevokeAndACK_get_channel_id(this_ptr: &RevokeAndACK) -> *const [u8; 32] { @@ -1887,6 +1869,24 @@ pub extern "C" fn RevokeAndACK_new(mut channel_id_arg: crate::c_types::ThirtyTwo next_per_commitment_point: next_per_commitment_point_arg.into_rust(), })), is_owned: true } } +impl Clone for RevokeAndACK { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn RevokeAndACK_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRevokeAndACK)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn RevokeAndACK_clone(orig: &RevokeAndACK) -> RevokeAndACK { + orig.clone() +} use lightning::ln::msgs::UpdateFee as nativeUpdateFeeImport; type nativeUpdateFee = nativeUpdateFeeImport; @@ -1925,24 +1925,6 @@ impl UpdateFee { ret } } -impl Clone for UpdateFee { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UpdateFee_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFee)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UpdateFee_clone(orig: &UpdateFee) -> UpdateFee { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn UpdateFee_get_channel_id(this_ptr: &UpdateFee) -> *const [u8; 32] { @@ -1973,6 +1955,24 @@ pub extern "C" fn UpdateFee_new(mut channel_id_arg: crate::c_types::ThirtyTwoByt feerate_per_kw: feerate_per_kw_arg, })), is_owned: true } } +impl Clone for UpdateFee { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UpdateFee_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFee)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UpdateFee_clone(orig: &UpdateFee) -> UpdateFee { + orig.clone() +} use lightning::ln::msgs::DataLossProtect as nativeDataLossProtectImport; type nativeDataLossProtect = nativeDataLossProtectImport; @@ -2014,24 +2014,6 @@ impl DataLossProtect { ret } } -impl Clone for DataLossProtect { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn DataLossProtect_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDataLossProtect)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn DataLossProtect_clone(orig: &DataLossProtect) -> DataLossProtect { - orig.clone() -} /// Proof that the sender knows the per-commitment secret of a specific commitment transaction /// belonging to the recipient #[no_mangle] @@ -2064,6 +2046,24 @@ pub extern "C" fn DataLossProtect_new(mut your_last_per_commitment_secret_arg: c my_current_per_commitment_point: my_current_per_commitment_point_arg.into_rust(), })), is_owned: true } } +impl Clone for DataLossProtect { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn DataLossProtect_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDataLossProtect)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn DataLossProtect_clone(orig: &DataLossProtect) -> DataLossProtect { + orig.clone() +} use lightning::ln::msgs::ChannelReestablish as nativeChannelReestablishImport; type nativeChannelReestablish = nativeChannelReestablishImport; @@ -2102,24 +2102,6 @@ impl ChannelReestablish { ret } } -impl Clone for ChannelReestablish { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelReestablish_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelReestablish)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelReestablish_clone(orig: &ChannelReestablish) -> ChannelReestablish { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn ChannelReestablish_get_channel_id(this_ptr: &ChannelReestablish) -> *const [u8; 32] { @@ -2153,6 +2135,24 @@ pub extern "C" fn ChannelReestablish_get_next_remote_commitment_number(this_ptr: pub extern "C" fn ChannelReestablish_set_next_remote_commitment_number(this_ptr: &mut ChannelReestablish, mut val: u64) { unsafe { &mut *this_ptr.inner }.next_remote_commitment_number = val; } +impl Clone for ChannelReestablish { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelReestablish_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelReestablish)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelReestablish_clone(orig: &ChannelReestablish) -> ChannelReestablish { + orig.clone() +} use lightning::ln::msgs::AnnouncementSignatures as nativeAnnouncementSignaturesImport; type nativeAnnouncementSignatures = nativeAnnouncementSignaturesImport; @@ -2191,24 +2191,6 @@ impl AnnouncementSignatures { ret } } -impl Clone for AnnouncementSignatures { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn AnnouncementSignatures_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAnnouncementSignatures)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn AnnouncementSignatures_clone(orig: &AnnouncementSignatures) -> AnnouncementSignatures { - orig.clone() -} /// The channel ID #[no_mangle] pub extern "C" fn AnnouncementSignatures_get_channel_id(this_ptr: &AnnouncementSignatures) -> *const [u8; 32] { @@ -2263,6 +2245,24 @@ pub extern "C" fn AnnouncementSignatures_new(mut channel_id_arg: crate::c_types: bitcoin_signature: bitcoin_signature_arg.into_rust(), })), is_owned: true } } +impl Clone for AnnouncementSignatures { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn AnnouncementSignatures_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAnnouncementSignatures)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn AnnouncementSignatures_clone(orig: &AnnouncementSignatures) -> AnnouncementSignatures { + orig.clone() +} /// An address which can be used to connect to a remote peer #[must_use] #[derive(Clone)] @@ -2494,24 +2494,6 @@ impl UnsignedNodeAnnouncement { ret } } -impl Clone for UnsignedNodeAnnouncement { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UnsignedNodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedNodeAnnouncement)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UnsignedNodeAnnouncement_clone(orig: &UnsignedNodeAnnouncement) -> UnsignedNodeAnnouncement { - orig.clone() -} /// The advertised features #[no_mangle] pub extern "C" fn UnsignedNodeAnnouncement_get_features(this_ptr: &UnsignedNodeAnnouncement) -> crate::ln::features::NodeFeatures { @@ -2571,11 +2553,29 @@ pub extern "C" fn UnsignedNodeAnnouncement_get_alias(this_ptr: &UnsignedNodeAnno pub extern "C" fn UnsignedNodeAnnouncement_set_alias(this_ptr: &mut UnsignedNodeAnnouncement, mut val: crate::c_types::ThirtyTwoBytes) { unsafe { &mut *this_ptr.inner }.alias = val.data; } -/// List of addresses on which this node is reachable +/// List of addresses on which this node is reachable +#[no_mangle] +pub extern "C" fn UnsignedNodeAnnouncement_set_addresses(this_ptr: &mut UnsignedNodeAnnouncement, mut val: crate::c_types::derived::CVec_NetAddressZ) { + let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_native() }); }; + unsafe { &mut *this_ptr.inner }.addresses = local_val; +} +impl Clone for UnsignedNodeAnnouncement { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UnsignedNodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedNodeAnnouncement)).clone() })) as *mut c_void +} #[no_mangle] -pub extern "C" fn UnsignedNodeAnnouncement_set_addresses(this_ptr: &mut UnsignedNodeAnnouncement, mut val: crate::c_types::derived::CVec_NetAddressZ) { - let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_native() }); }; - unsafe { &mut *this_ptr.inner }.addresses = local_val; +pub extern "C" fn UnsignedNodeAnnouncement_clone(orig: &UnsignedNodeAnnouncement) -> UnsignedNodeAnnouncement { + orig.clone() } use lightning::ln::msgs::NodeAnnouncement as nativeNodeAnnouncementImport; @@ -2615,24 +2615,6 @@ impl NodeAnnouncement { ret } } -impl Clone for NodeAnnouncement { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn NodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncement)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn NodeAnnouncement_clone(orig: &NodeAnnouncement) -> NodeAnnouncement { - orig.clone() -} /// The signature by the node key #[no_mangle] pub extern "C" fn NodeAnnouncement_get_signature(this_ptr: &NodeAnnouncement) -> crate::c_types::Signature { @@ -2663,6 +2645,24 @@ pub extern "C" fn NodeAnnouncement_new(mut signature_arg: crate::c_types::Signat contents: *unsafe { Box::from_raw(contents_arg.take_inner()) }, })), is_owned: true } } +impl Clone for NodeAnnouncement { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn NodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncement)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn NodeAnnouncement_clone(orig: &NodeAnnouncement) -> NodeAnnouncement { + orig.clone() +} use lightning::ln::msgs::UnsignedChannelAnnouncement as nativeUnsignedChannelAnnouncementImport; type nativeUnsignedChannelAnnouncement = nativeUnsignedChannelAnnouncementImport; @@ -2701,24 +2701,6 @@ impl UnsignedChannelAnnouncement { ret } } -impl Clone for UnsignedChannelAnnouncement { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UnsignedChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelAnnouncement)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UnsignedChannelAnnouncement_clone(orig: &UnsignedChannelAnnouncement) -> UnsignedChannelAnnouncement { - orig.clone() -} /// The advertised channel features #[no_mangle] pub extern "C" fn UnsignedChannelAnnouncement_get_features(this_ptr: &UnsignedChannelAnnouncement) -> crate::ln::features::ChannelFeatures { @@ -2796,6 +2778,24 @@ pub extern "C" fn UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr: &Unsig pub extern "C" fn UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr: &mut UnsignedChannelAnnouncement, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.bitcoin_key_2 = val.into_rust(); } +impl Clone for UnsignedChannelAnnouncement { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UnsignedChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelAnnouncement)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UnsignedChannelAnnouncement_clone(orig: &UnsignedChannelAnnouncement) -> UnsignedChannelAnnouncement { + orig.clone() +} use lightning::ln::msgs::ChannelAnnouncement as nativeChannelAnnouncementImport; type nativeChannelAnnouncement = nativeChannelAnnouncementImport; @@ -2834,24 +2834,6 @@ impl ChannelAnnouncement { ret } } -impl Clone for ChannelAnnouncement { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelAnnouncement)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelAnnouncement_clone(orig: &ChannelAnnouncement) -> ChannelAnnouncement { - orig.clone() -} /// Authentication of the announcement by the first public node #[no_mangle] pub extern "C" fn ChannelAnnouncement_get_node_signature_1(this_ptr: &ChannelAnnouncement) -> crate::c_types::Signature { @@ -2918,6 +2900,24 @@ pub extern "C" fn ChannelAnnouncement_new(mut node_signature_1_arg: crate::c_typ contents: *unsafe { Box::from_raw(contents_arg.take_inner()) }, })), is_owned: true } } +impl Clone for ChannelAnnouncement { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelAnnouncement)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelAnnouncement_clone(orig: &ChannelAnnouncement) -> ChannelAnnouncement { + orig.clone() +} use lightning::ln::msgs::UnsignedChannelUpdate as nativeUnsignedChannelUpdateImport; type nativeUnsignedChannelUpdate = nativeUnsignedChannelUpdateImport; @@ -2956,24 +2956,6 @@ impl UnsignedChannelUpdate { ret } } -impl Clone for UnsignedChannelUpdate { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UnsignedChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelUpdate)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UnsignedChannelUpdate_clone(orig: &UnsignedChannelUpdate) -> UnsignedChannelUpdate { - orig.clone() -} /// The genesis hash of the blockchain where the channel is to be opened #[no_mangle] pub extern "C" fn UnsignedChannelUpdate_get_chain_hash(this_ptr: &UnsignedChannelUpdate) -> *const [u8; 32] { @@ -3062,6 +3044,24 @@ pub extern "C" fn UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr pub extern "C" fn UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr: &mut UnsignedChannelUpdate, mut val: u32) { unsafe { &mut *this_ptr.inner }.fee_proportional_millionths = val; } +impl Clone for UnsignedChannelUpdate { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UnsignedChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelUpdate)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UnsignedChannelUpdate_clone(orig: &UnsignedChannelUpdate) -> UnsignedChannelUpdate { + orig.clone() +} use lightning::ln::msgs::ChannelUpdate as nativeChannelUpdateImport; type nativeChannelUpdate = nativeChannelUpdateImport; @@ -3100,24 +3100,6 @@ impl ChannelUpdate { ret } } -impl Clone for ChannelUpdate { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelUpdate)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelUpdate_clone(orig: &ChannelUpdate) -> ChannelUpdate { - orig.clone() -} /// A signature of the channel update #[no_mangle] pub extern "C" fn ChannelUpdate_get_signature(this_ptr: &ChannelUpdate) -> crate::c_types::Signature { @@ -3148,6 +3130,24 @@ pub extern "C" fn ChannelUpdate_new(mut signature_arg: crate::c_types::Signature contents: *unsafe { Box::from_raw(contents_arg.take_inner()) }, })), is_owned: true } } +impl Clone for ChannelUpdate { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelUpdate)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelUpdate_clone(orig: &ChannelUpdate) -> ChannelUpdate { + orig.clone() +} use lightning::ln::msgs::QueryChannelRange as nativeQueryChannelRangeImport; type nativeQueryChannelRange = nativeQueryChannelRangeImport; @@ -3189,24 +3189,6 @@ impl QueryChannelRange { ret } } -impl Clone for QueryChannelRange { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn QueryChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryChannelRange)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn QueryChannelRange_clone(orig: &QueryChannelRange) -> QueryChannelRange { - orig.clone() -} /// The genesis hash of the blockchain being queried #[no_mangle] pub extern "C" fn QueryChannelRange_get_chain_hash(this_ptr: &QueryChannelRange) -> *const [u8; 32] { @@ -3249,6 +3231,24 @@ pub extern "C" fn QueryChannelRange_new(mut chain_hash_arg: crate::c_types::Thir number_of_blocks: number_of_blocks_arg, })), is_owned: true } } +impl Clone for QueryChannelRange { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn QueryChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryChannelRange)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn QueryChannelRange_clone(orig: &QueryChannelRange) -> QueryChannelRange { + orig.clone() +} use lightning::ln::msgs::ReplyChannelRange as nativeReplyChannelRangeImport; type nativeReplyChannelRange = nativeReplyChannelRangeImport; @@ -3293,24 +3293,6 @@ impl ReplyChannelRange { ret } } -impl Clone for ReplyChannelRange { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ReplyChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyChannelRange)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ReplyChannelRange_clone(orig: &ReplyChannelRange) -> ReplyChannelRange { - orig.clone() -} /// The genesis hash of the blockchain being queried #[no_mangle] pub extern "C" fn ReplyChannelRange_get_chain_hash(this_ptr: &ReplyChannelRange) -> *const [u8; 32] { @@ -3373,6 +3355,24 @@ pub extern "C" fn ReplyChannelRange_new(mut chain_hash_arg: crate::c_types::Thir short_channel_ids: local_short_channel_ids_arg, })), is_owned: true } } +impl Clone for ReplyChannelRange { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ReplyChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyChannelRange)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ReplyChannelRange_clone(orig: &ReplyChannelRange) -> ReplyChannelRange { + orig.clone() +} use lightning::ln::msgs::QueryShortChannelIds as nativeQueryShortChannelIdsImport; type nativeQueryShortChannelIds = nativeQueryShortChannelIdsImport; @@ -3418,24 +3418,6 @@ impl QueryShortChannelIds { ret } } -impl Clone for QueryShortChannelIds { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn QueryShortChannelIds_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryShortChannelIds)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn QueryShortChannelIds_clone(orig: &QueryShortChannelIds) -> QueryShortChannelIds { - orig.clone() -} /// The genesis hash of the blockchain being queried #[no_mangle] pub extern "C" fn QueryShortChannelIds_get_chain_hash(this_ptr: &QueryShortChannelIds) -> *const [u8; 32] { @@ -3462,6 +3444,24 @@ pub extern "C" fn QueryShortChannelIds_new(mut chain_hash_arg: crate::c_types::T short_channel_ids: local_short_channel_ids_arg, })), is_owned: true } } +impl Clone for QueryShortChannelIds { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn QueryShortChannelIds_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryShortChannelIds)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_clone(orig: &QueryShortChannelIds) -> QueryShortChannelIds { + orig.clone() +} use lightning::ln::msgs::ReplyShortChannelIdsEnd as nativeReplyShortChannelIdsEndImport; type nativeReplyShortChannelIdsEnd = nativeReplyShortChannelIdsEndImport; @@ -3503,24 +3503,6 @@ impl ReplyShortChannelIdsEnd { ret } } -impl Clone for ReplyShortChannelIdsEnd { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ReplyShortChannelIdsEnd_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyShortChannelIdsEnd)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ReplyShortChannelIdsEnd_clone(orig: &ReplyShortChannelIdsEnd) -> ReplyShortChannelIdsEnd { - orig.clone() -} /// The genesis hash of the blockchain that was queried #[no_mangle] pub extern "C" fn ReplyShortChannelIdsEnd_get_chain_hash(this_ptr: &ReplyShortChannelIdsEnd) -> *const [u8; 32] { @@ -3553,6 +3535,24 @@ pub extern "C" fn ReplyShortChannelIdsEnd_new(mut chain_hash_arg: crate::c_types full_information: full_information_arg, })), is_owned: true } } +impl Clone for ReplyShortChannelIdsEnd { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ReplyShortChannelIdsEnd_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyShortChannelIdsEnd)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_clone(orig: &ReplyShortChannelIdsEnd) -> ReplyShortChannelIdsEnd { + orig.clone() +} use lightning::ln::msgs::GossipTimestampFilter as nativeGossipTimestampFilterImport; type nativeGossipTimestampFilter = nativeGossipTimestampFilterImport; @@ -3593,24 +3593,6 @@ impl GossipTimestampFilter { ret } } -impl Clone for GossipTimestampFilter { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn GossipTimestampFilter_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeGossipTimestampFilter)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn GossipTimestampFilter_clone(orig: &GossipTimestampFilter) -> GossipTimestampFilter { - orig.clone() -} /// The genesis hash of the blockchain for channel and node information #[no_mangle] pub extern "C" fn GossipTimestampFilter_get_chain_hash(this_ptr: &GossipTimestampFilter) -> *const [u8; 32] { @@ -3653,6 +3635,24 @@ pub extern "C" fn GossipTimestampFilter_new(mut chain_hash_arg: crate::c_types:: timestamp_range: timestamp_range_arg, })), is_owned: true } } +impl Clone for GossipTimestampFilter { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn GossipTimestampFilter_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeGossipTimestampFilter)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_clone(orig: &GossipTimestampFilter) -> GossipTimestampFilter { + orig.clone() +} /// Used to put an error message in a LightningError #[must_use] #[derive(Clone)] @@ -3788,24 +3788,6 @@ impl LightningError { ret } } -impl Clone for LightningError { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn LightningError_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeLightningError)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn LightningError_clone(orig: &LightningError) -> LightningError { - orig.clone() -} /// A human-readable message describing the error #[no_mangle] pub extern "C" fn LightningError_get_err(this_ptr: &LightningError) -> crate::c_types::Str { @@ -3836,6 +3818,24 @@ pub extern "C" fn LightningError_new(mut err_arg: crate::c_types::derived::CVec_ action: action_arg.into_native(), })), is_owned: true } } +impl Clone for LightningError { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn LightningError_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeLightningError)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn LightningError_clone(orig: &LightningError) -> LightningError { + orig.clone() +} use lightning::ln::msgs::CommitmentUpdate as nativeCommitmentUpdateImport; type nativeCommitmentUpdate = nativeCommitmentUpdateImport; @@ -3875,24 +3875,6 @@ impl CommitmentUpdate { ret } } -impl Clone for CommitmentUpdate { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn CommitmentUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentUpdate)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn CommitmentUpdate_clone(orig: &CommitmentUpdate) -> CommitmentUpdate { - orig.clone() -} /// update_add_htlc messages which should be sent #[no_mangle] pub extern "C" fn CommitmentUpdate_set_update_add_htlcs(this_ptr: &mut CommitmentUpdate, mut val: crate::c_types::derived::CVec_UpdateAddHTLCZ) { @@ -3958,6 +3940,24 @@ pub extern "C" fn CommitmentUpdate_new(mut update_add_htlcs_arg: crate::c_types: commitment_signed: *unsafe { Box::from_raw(commitment_signed_arg.take_inner()) }, })), is_owned: true } } +impl Clone for CommitmentUpdate { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn CommitmentUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentUpdate)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn CommitmentUpdate_clone(orig: &CommitmentUpdate) -> CommitmentUpdate { + orig.clone() +} /// The information we received from a peer along the route of a payment we originated. This is /// returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into /// RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map. @@ -4370,35 +4370,31 @@ impl Drop for RoutingMessageHandler { } #[no_mangle] pub extern "C" fn AcceptChannel_write(obj: &AcceptChannel) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn AcceptChannel_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeAcceptChannel) }) } #[no_mangle] -pub extern "C" fn AcceptChannel_read(ser: crate::c_types::u8slice) -> AcceptChannel { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - AcceptChannel { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - AcceptChannel { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn AcceptChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AcceptChannelDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::AcceptChannel { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn AnnouncementSignatures_write(obj: &AnnouncementSignatures) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn AnnouncementSignatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeAnnouncementSignatures) }) } #[no_mangle] -pub extern "C" fn AnnouncementSignatures_read(ser: crate::c_types::u8slice) -> AnnouncementSignatures { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - AnnouncementSignatures { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - AnnouncementSignatures { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn AnnouncementSignatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AnnouncementSignaturesDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::AnnouncementSignatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn ChannelReestablish_write(obj: &ChannelReestablish) -> crate::c_types::derived::CVec_u8Z { @@ -4416,83 +4412,73 @@ pub extern "C" fn ChannelReestablish_read(ser: crate::c_types::u8slice) -> crate } #[no_mangle] pub extern "C" fn ClosingSigned_write(obj: &ClosingSigned) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn ClosingSigned_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeClosingSigned) }) } #[no_mangle] -pub extern "C" fn ClosingSigned_read(ser: crate::c_types::u8slice) -> ClosingSigned { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - ClosingSigned { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - ClosingSigned { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn ClosingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ClosingSignedDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ClosingSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn CommitmentSigned_write(obj: &CommitmentSigned) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn CommitmentSigned_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeCommitmentSigned) }) } #[no_mangle] -pub extern "C" fn CommitmentSigned_read(ser: crate::c_types::u8slice) -> CommitmentSigned { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - CommitmentSigned { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - CommitmentSigned { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn CommitmentSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CommitmentSignedDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::CommitmentSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn FundingCreated_write(obj: &FundingCreated) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn FundingCreated_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingCreated) }) } #[no_mangle] -pub extern "C" fn FundingCreated_read(ser: crate::c_types::u8slice) -> FundingCreated { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - FundingCreated { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - FundingCreated { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn FundingCreated_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingCreatedDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingCreated { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn FundingSigned_write(obj: &FundingSigned) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn FundingSigned_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingSigned) }) } #[no_mangle] -pub extern "C" fn FundingSigned_read(ser: crate::c_types::u8slice) -> FundingSigned { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - FundingSigned { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - FundingSigned { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn FundingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingSignedDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn FundingLocked_write(obj: &FundingLocked) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn FundingLocked_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingLocked) }) } #[no_mangle] -pub extern "C" fn FundingLocked_read(ser: crate::c_types::u8slice) -> FundingLocked { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - FundingLocked { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - FundingLocked { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn FundingLocked_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingLockedDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingLocked { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn Init_write(obj: &Init) -> crate::c_types::derived::CVec_u8Z { @@ -4510,131 +4496,115 @@ pub extern "C" fn Init_read(ser: crate::c_types::u8slice) -> crate::c_types::der } #[no_mangle] pub extern "C" fn OpenChannel_write(obj: &OpenChannel) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn OpenChannel_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeOpenChannel) }) } #[no_mangle] -pub extern "C" fn OpenChannel_read(ser: crate::c_types::u8slice) -> OpenChannel { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - OpenChannel { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - OpenChannel { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn OpenChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OpenChannelDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::OpenChannel { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn RevokeAndACK_write(obj: &RevokeAndACK) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn RevokeAndACK_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeRevokeAndACK) }) } #[no_mangle] -pub extern "C" fn RevokeAndACK_read(ser: crate::c_types::u8slice) -> RevokeAndACK { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - RevokeAndACK { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - RevokeAndACK { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn RevokeAndACK_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RevokeAndACKDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::RevokeAndACK { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn Shutdown_write(obj: &Shutdown) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn Shutdown_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeShutdown) }) } #[no_mangle] -pub extern "C" fn Shutdown_read(ser: crate::c_types::u8slice) -> Shutdown { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - Shutdown { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - Shutdown { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn Shutdown_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ShutdownDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Shutdown { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn UpdateFailHTLC_write(obj: &UpdateFailHTLC) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn UpdateFailHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFailHTLC) }) } #[no_mangle] -pub extern "C" fn UpdateFailHTLC_read(ser: crate::c_types::u8slice) -> UpdateFailHTLC { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - UpdateFailHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - UpdateFailHTLC { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn UpdateFailHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailHTLCDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFailHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn UpdateFailMalformedHTLC_write(obj: &UpdateFailMalformedHTLC) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn UpdateFailMalformedHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFailMalformedHTLC) }) } #[no_mangle] -pub extern "C" fn UpdateFailMalformedHTLC_read(ser: crate::c_types::u8slice) -> UpdateFailMalformedHTLC { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - UpdateFailMalformedHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - UpdateFailMalformedHTLC { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn UpdateFailMalformedHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailMalformedHTLCDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFailMalformedHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn UpdateFee_write(obj: &UpdateFee) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn UpdateFee_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFee) }) } #[no_mangle] -pub extern "C" fn UpdateFee_read(ser: crate::c_types::u8slice) -> UpdateFee { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - UpdateFee { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - UpdateFee { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn UpdateFee_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFeeDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFee { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn UpdateFulfillHTLC_write(obj: &UpdateFulfillHTLC) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn UpdateFulfillHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFulfillHTLC) }) } #[no_mangle] -pub extern "C" fn UpdateFulfillHTLC_read(ser: crate::c_types::u8slice) -> UpdateFulfillHTLC { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - UpdateFulfillHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - UpdateFulfillHTLC { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn UpdateFulfillHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFulfillHTLCDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFulfillHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn UpdateAddHTLC_write(obj: &UpdateAddHTLC) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn UpdateAddHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateAddHTLC) }) } #[no_mangle] -pub extern "C" fn UpdateAddHTLC_read(ser: crate::c_types::u8slice) -> UpdateAddHTLC { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - UpdateAddHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - UpdateAddHTLC { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn UpdateAddHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateAddHTLCDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateAddHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn Ping_write(obj: &Ping) -> crate::c_types::derived::CVec_u8Z { @@ -4680,19 +4650,17 @@ pub extern "C" fn UnsignedChannelAnnouncement_read(ser: crate::c_types::u8slice) } #[no_mangle] pub extern "C" fn ChannelAnnouncement_write(obj: &ChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn ChannelAnnouncement_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelAnnouncement) }) } #[no_mangle] -pub extern "C" fn ChannelAnnouncement_read(ser: crate::c_types::u8slice) -> ChannelAnnouncement { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - ChannelAnnouncement { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - ChannelAnnouncement { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn ChannelAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelAnnouncementDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn UnsignedChannelUpdate_write(obj: &UnsignedChannelUpdate) -> crate::c_types::derived::CVec_u8Z { @@ -4710,19 +4678,17 @@ pub extern "C" fn UnsignedChannelUpdate_read(ser: crate::c_types::u8slice) -> cr } #[no_mangle] pub extern "C" fn ChannelUpdate_write(obj: &ChannelUpdate) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn ChannelUpdate_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelUpdate) }) } #[no_mangle] -pub extern "C" fn ChannelUpdate_read(ser: crate::c_types::u8slice) -> ChannelUpdate { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - ChannelUpdate { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - ChannelUpdate { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn ChannelUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelUpdateDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn ErrorMessage_write(obj: &ErrorMessage) -> crate::c_types::derived::CVec_u8Z { @@ -4754,19 +4720,17 @@ pub extern "C" fn UnsignedNodeAnnouncement_read(ser: crate::c_types::u8slice) -> } #[no_mangle] pub extern "C" fn NodeAnnouncement_write(obj: &NodeAnnouncement) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn NodeAnnouncement_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeAnnouncement) }) } #[no_mangle] -pub extern "C" fn NodeAnnouncement_read(ser: crate::c_types::u8slice) -> NodeAnnouncement { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - NodeAnnouncement { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - NodeAnnouncement { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn NodeAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeAnnouncementDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::NodeAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } #[no_mangle] pub extern "C" fn QueryShortChannelIds_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryShortChannelIdsDecodeErrorZ { diff --git a/lightning-c-bindings/src/ln/peer_handler.rs b/lightning-c-bindings/src/ln/peer_handler.rs index d901385eb4a..e9894dd9b72 100644 --- a/lightning-c-bindings/src/ln/peer_handler.rs +++ b/lightning-c-bindings/src/ln/peer_handler.rs @@ -218,24 +218,6 @@ impl PeerHandleError { ret } } -impl Clone for PeerHandleError { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn PeerHandleError_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePeerHandleError)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn PeerHandleError_clone(orig: &PeerHandleError) -> PeerHandleError { - orig.clone() -} /// Used to indicate that we probably can't make any future connections to this peer, implying /// we should go ahead and force-close any channels we have with it. #[no_mangle] @@ -256,6 +238,24 @@ pub extern "C" fn PeerHandleError_new(mut no_connection_possible_arg: bool) -> P no_connection_possible: no_connection_possible_arg, })), is_owned: true } } +impl Clone for PeerHandleError { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn PeerHandleError_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePeerHandleError)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn PeerHandleError_clone(orig: &PeerHandleError) -> PeerHandleError { + orig.clone() +} use lightning::ln::peer_handler::PeerManager as nativePeerManagerImport; type nativePeerManager = nativePeerManagerImport; diff --git a/lightning-c-bindings/src/routing/network_graph.rs b/lightning-c-bindings/src/routing/network_graph.rs index c994beb7d10..ecd7e187d33 100644 --- a/lightning-c-bindings/src/routing/network_graph.rs +++ b/lightning-c-bindings/src/routing/network_graph.rs @@ -334,24 +334,6 @@ impl DirectionalChannelInfo { ret } } -impl Clone for DirectionalChannelInfo { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn DirectionalChannelInfo_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDirectionalChannelInfo)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn DirectionalChannelInfo_clone(orig: &DirectionalChannelInfo) -> DirectionalChannelInfo { - orig.clone() -} /// When the last update to the channel direction was issued. /// Value is opaque, as set in the announcement. #[no_mangle] @@ -428,21 +410,37 @@ pub extern "C" fn DirectionalChannelInfo_set_last_update_message(this_ptr: &mut let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) }; unsafe { &mut *this_ptr.inner }.last_update_message = local_val; } +impl Clone for DirectionalChannelInfo { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn DirectionalChannelInfo_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDirectionalChannelInfo)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn DirectionalChannelInfo_clone(orig: &DirectionalChannelInfo) -> DirectionalChannelInfo { + orig.clone() +} #[no_mangle] pub extern "C" fn DirectionalChannelInfo_write(obj: &DirectionalChannelInfo) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn DirectionalChannelInfo_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeDirectionalChannelInfo) }) } #[no_mangle] -pub extern "C" fn DirectionalChannelInfo_read(ser: crate::c_types::u8slice) -> DirectionalChannelInfo { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - DirectionalChannelInfo { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - DirectionalChannelInfo { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn DirectionalChannelInfo_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_DirectionalChannelInfoDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::DirectionalChannelInfo { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } use lightning::routing::network_graph::ChannelInfo as nativeChannelInfoImport; @@ -563,19 +561,17 @@ pub extern "C" fn ChannelInfo_set_announcement_message(this_ptr: &mut ChannelInf } #[no_mangle] pub extern "C" fn ChannelInfo_write(obj: &ChannelInfo) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn ChannelInfo_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelInfo) }) } #[no_mangle] -pub extern "C" fn ChannelInfo_read(ser: crate::c_types::u8slice) -> ChannelInfo { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - ChannelInfo { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - ChannelInfo { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn ChannelInfo_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelInfoDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::ChannelInfo { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } use lightning::routing::network_graph::RoutingFees as nativeRoutingFeesImport; @@ -615,24 +611,6 @@ impl RoutingFees { ret } } -impl Clone for RoutingFees { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn RoutingFees_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoutingFees)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn RoutingFees_clone(orig: &RoutingFees) -> RoutingFees { - orig.clone() -} /// Flat routing fee in satoshis #[no_mangle] pub extern "C" fn RoutingFees_get_base_msat(this_ptr: &RoutingFees) -> u32 { @@ -665,6 +643,24 @@ pub extern "C" fn RoutingFees_new(mut base_msat_arg: u32, mut proportional_milli proportional_millionths: proportional_millionths_arg, })), is_owned: true } } +impl Clone for RoutingFees { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn RoutingFees_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoutingFees)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn RoutingFees_clone(orig: &RoutingFees) -> RoutingFees { + orig.clone() +} #[no_mangle] pub extern "C" fn RoutingFees_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RoutingFeesDecodeErrorZ { let res = crate::c_types::deserialize_obj(ser); @@ -717,24 +713,6 @@ impl NodeAnnouncementInfo { ret } } -impl Clone for NodeAnnouncementInfo { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn NodeAnnouncementInfo_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncementInfo)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn NodeAnnouncementInfo_clone(orig: &NodeAnnouncementInfo) -> NodeAnnouncementInfo { - orig.clone() -} /// Protocol features the node announced support for #[no_mangle] pub extern "C" fn NodeAnnouncementInfo_get_features(this_ptr: &NodeAnnouncementInfo) -> crate::ln::features::NodeFeatures { @@ -824,6 +802,24 @@ pub extern "C" fn NodeAnnouncementInfo_new(mut features_arg: crate::ln::features announcement_message: local_announcement_message_arg, })), is_owned: true } } +impl Clone for NodeAnnouncementInfo { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn NodeAnnouncementInfo_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncementInfo)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn NodeAnnouncementInfo_clone(orig: &NodeAnnouncementInfo) -> NodeAnnouncementInfo { + orig.clone() +} #[no_mangle] pub extern "C" fn NodeAnnouncementInfo_write(obj: &NodeAnnouncementInfo) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) @@ -876,24 +872,6 @@ impl NodeInfo { ret } } -impl Clone for NodeInfo { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn NodeInfo_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeInfo)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn NodeInfo_clone(orig: &NodeInfo) -> NodeInfo { - orig.clone() -} /// All valid channels a node has announced #[no_mangle] pub extern "C" fn NodeInfo_set_channels(this_ptr: &mut NodeInfo, mut val: crate::c_types::derived::CVec_u64Z) { @@ -946,6 +924,24 @@ pub extern "C" fn NodeInfo_new(mut channels_arg: crate::c_types::derived::CVec_u announcement_info: local_announcement_info_arg, })), is_owned: true } } +impl Clone for NodeInfo { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn NodeInfo_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeInfo)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn NodeInfo_clone(orig: &NodeInfo) -> NodeInfo { + orig.clone() +} #[no_mangle] pub extern "C" fn NodeInfo_write(obj: &NodeInfo) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) diff --git a/lightning-c-bindings/src/routing/router.rs b/lightning-c-bindings/src/routing/router.rs index 11e026347a3..ba1a18bb8a6 100644 --- a/lightning-c-bindings/src/routing/router.rs +++ b/lightning-c-bindings/src/routing/router.rs @@ -45,24 +45,6 @@ impl RouteHop { ret } } -impl Clone for RouteHop { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn RouteHop_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHop)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn RouteHop_clone(orig: &RouteHop) -> RouteHop { - orig.clone() -} /// The node_id of the node at this hop. #[no_mangle] pub extern "C" fn RouteHop_get_pubkey(this_ptr: &RouteHop) -> crate::c_types::PublicKey { @@ -147,6 +129,24 @@ pub extern "C" fn RouteHop_new(mut pubkey_arg: crate::c_types::PublicKey, mut no cltv_expiry_delta: cltv_expiry_delta_arg, })), is_owned: true } } +impl Clone for RouteHop { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn RouteHop_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHop)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn RouteHop_clone(orig: &RouteHop) -> RouteHop { + orig.clone() +} use lightning::routing::router::Route as nativeRouteImport; type nativeRoute = nativeRouteImport; @@ -186,24 +186,6 @@ impl Route { ret } } -impl Clone for Route { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn Route_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoute)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn Route_clone(orig: &Route) -> Route { - orig.clone() -} /// The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the /// last RouteHop in each path must be the same. /// Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the @@ -223,6 +205,24 @@ pub extern "C" fn Route_new(mut paths_arg: crate::c_types::derived::CVec_CVec_Ro paths: local_paths_arg, })), is_owned: true } } +impl Clone for Route { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn Route_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoute)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn Route_clone(orig: &Route) -> Route { + orig.clone() +} #[no_mangle] pub extern "C" fn Route_write(obj: &Route) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) @@ -275,24 +275,6 @@ impl RouteHint { ret } } -impl Clone for RouteHint { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn RouteHint_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHint)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn RouteHint_clone(orig: &RouteHint) -> RouteHint { - orig.clone() -} /// The node_id of the non-target end of the route #[no_mangle] pub extern "C" fn RouteHint_get_src_node_id(this_ptr: &RouteHint) -> crate::c_types::PublicKey { @@ -359,6 +341,24 @@ pub extern "C" fn RouteHint_new(mut src_node_id_arg: crate::c_types::PublicKey, htlc_minimum_msat: htlc_minimum_msat_arg, })), is_owned: true } } +impl Clone for RouteHint { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn RouteHint_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHint)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn RouteHint_clone(orig: &RouteHint) -> RouteHint { + orig.clone() +} /// Gets a route from us to the given target node. /// /// Extra routing hops between known nodes and the target will be used if they are included in diff --git a/lightning-c-bindings/src/util/config.rs b/lightning-c-bindings/src/util/config.rs index f71c73f83b0..78e837485c6 100644 --- a/lightning-c-bindings/src/util/config.rs +++ b/lightning-c-bindings/src/util/config.rs @@ -45,24 +45,6 @@ impl ChannelHandshakeConfig { ret } } -impl Clone for ChannelHandshakeConfig { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelHandshakeConfig_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeConfig)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelHandshakeConfig_clone(orig: &ChannelHandshakeConfig) -> ChannelHandshakeConfig { - orig.clone() -} /// Confirmations we will wait for before considering the channel locked in. /// Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the /// equivalent limit applied to outbound channels). @@ -147,6 +129,24 @@ pub extern "C" fn ChannelHandshakeConfig_new(mut minimum_depth_arg: u32, mut our our_htlc_minimum_msat: our_htlc_minimum_msat_arg, })), is_owned: true } } +impl Clone for ChannelHandshakeConfig { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelHandshakeConfig_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeConfig)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelHandshakeConfig_clone(orig: &ChannelHandshakeConfig) -> ChannelHandshakeConfig { + orig.clone() +} #[must_use] #[no_mangle] pub extern "C" fn ChannelHandshakeConfig_default() -> ChannelHandshakeConfig { @@ -200,24 +200,6 @@ impl ChannelHandshakeLimits { ret } } -impl Clone for ChannelHandshakeLimits { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelHandshakeLimits_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeLimits)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelHandshakeLimits_clone(orig: &ChannelHandshakeLimits) -> ChannelHandshakeLimits { - orig.clone() -} /// Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so /// only applies to inbound channels. /// @@ -430,6 +412,24 @@ pub extern "C" fn ChannelHandshakeLimits_new(mut min_funding_satoshis_arg: u64, their_to_self_delay: their_to_self_delay_arg, })), is_owned: true } } +impl Clone for ChannelHandshakeLimits { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelHandshakeLimits_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeLimits)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelHandshakeLimits_clone(orig: &ChannelHandshakeLimits) -> ChannelHandshakeLimits { + orig.clone() +} #[must_use] #[no_mangle] pub extern "C" fn ChannelHandshakeLimits_default() -> ChannelHandshakeLimits { @@ -474,24 +474,6 @@ impl ChannelConfig { ret } } -impl Clone for ChannelConfig { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn ChannelConfig_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelConfig)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn ChannelConfig_clone(orig: &ChannelConfig) -> ChannelConfig { - orig.clone() -} /// Amount (in millionths of a satoshi) the channel will charge per transferred satoshi. /// This may be allowed to change at runtime in a later update, however doing so must result in /// update messages sent to notify all nodes of our updated relay fee. @@ -582,6 +564,24 @@ pub extern "C" fn ChannelConfig_new(mut fee_proportional_millionths_arg: u32, mu commit_upfront_shutdown_pubkey: commit_upfront_shutdown_pubkey_arg, })), is_owned: true } } +impl Clone for ChannelConfig { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn ChannelConfig_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelConfig)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn ChannelConfig_clone(orig: &ChannelConfig) -> ChannelConfig { + orig.clone() +} #[must_use] #[no_mangle] pub extern "C" fn ChannelConfig_default() -> ChannelConfig { @@ -589,19 +589,17 @@ pub extern "C" fn ChannelConfig_default() -> ChannelConfig { } #[no_mangle] pub extern "C" fn ChannelConfig_write(obj: &ChannelConfig) -> crate::c_types::derived::CVec_u8Z { - crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) + crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] pub(crate) extern "C" fn ChannelConfig_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelConfig) }) } #[no_mangle] -pub extern "C" fn ChannelConfig_read(ser: crate::c_types::u8slice) -> ChannelConfig { - if let Ok(res) = crate::c_types::deserialize_obj(ser) { - ChannelConfig { inner: Box::into_raw(Box::new(res)), is_owned: true } - } else { - ChannelConfig { inner: std::ptr::null_mut(), is_owned: true } - } +pub extern "C" fn ChannelConfig_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelConfigDecodeErrorZ { + let res = crate::c_types::deserialize_obj(ser); + let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::util::config::ChannelConfig { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; + local_res } use lightning::util::config::UserConfig as nativeUserConfigImport; @@ -644,24 +642,6 @@ impl UserConfig { ret } } -impl Clone for UserConfig { - 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)] -/// Used only if an object of this type is returned as a trait impl by a method -pub(crate) extern "C" fn UserConfig_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUserConfig)).clone() })) as *mut c_void -} -#[no_mangle] -pub extern "C" fn UserConfig_clone(orig: &UserConfig) -> UserConfig { - orig.clone() -} /// Channel config that we propose to our counterparty. #[no_mangle] pub extern "C" fn UserConfig_get_own_channel_config(this_ptr: &UserConfig) -> crate::util::config::ChannelHandshakeConfig { @@ -704,6 +684,24 @@ pub extern "C" fn UserConfig_new(mut own_channel_config_arg: crate::util::config channel_options: *unsafe { Box::from_raw(channel_options_arg.take_inner()) }, })), is_owned: true } } +impl Clone for UserConfig { + 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)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn UserConfig_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUserConfig)).clone() })) as *mut c_void +} +#[no_mangle] +pub extern "C" fn UserConfig_clone(orig: &UserConfig) -> UserConfig { + orig.clone() +} #[must_use] #[no_mangle] pub extern "C" fn UserConfig_default() -> UserConfig {