Update auto-generated bindings to 0.0.113
[ldk-c-bindings] / lightning-c-bindings / src / lightning / util / ser.rs
index 23890d863974dff8669b0e8c21b6ac3f0323eed7..241033d5191f7b92679e9b0584df229afe6aed5a 100644 (file)
@@ -60,7 +60,7 @@ pub extern "C" fn BigSize_free(this_obj: BigSize) { }
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn BigSize_free_void(this_ptr: *mut c_void) {
-       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeBigSize); }
+       let _ = unsafe { Box::from_raw(this_ptr as *mut nativeBigSize) };
 }
 #[allow(unused)]
 impl BigSize {
@@ -132,7 +132,7 @@ pub extern "C" fn Hostname_free(this_obj: Hostname) { }
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Hostname_free_void(this_ptr: *mut c_void) {
-       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeHostname); }
+       let _ = unsafe { Box::from_raw(this_ptr as *mut nativeHostname) };
 }
 #[allow(unused)]
 impl Hostname {
@@ -169,6 +169,15 @@ pub(crate) extern "C" fn Hostname_clone_void(this_ptr: *const c_void) -> *mut c_
 pub extern "C" fn Hostname_clone(orig: &Hostname) -> Hostname {
        orig.clone()
 }
+/// Checks if two Hostnames contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+/// Two objects with NULL inner values will be considered "equal" here.
+#[no_mangle]
+pub extern "C" fn Hostname_eq(a: &Hostname, b: &Hostname) -> bool {
+       if a.inner == b.inner { return true; }
+       if a.inner.is_null() || b.inner.is_null() { return false; }
+       if a.get_native_ref() == b.get_native_ref() { true } else { false }
+}
 /// Returns the length of the hostname.
 #[must_use]
 #[no_mangle]