- bindings updates
[rust-lightning] / lightning-c-bindings / src / c_types / derived.rs
index d76374ae64c2631fc6991aa80e99116951d8f309..a418ccc2a8c2abf464e622412cda8d4cc4b9db59 100644 (file)
@@ -3430,6 +3430,14 @@ impl Drop for CVec_ChannelMonitorZ {
                unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
        }
 }
+impl Clone for CVec_ChannelMonitorZ {
+       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_BlockHashChannelManagerZ {
        pub a: crate::c_types::ThirtyTwoBytes,