[bindings] Add additional clone methods on manually-defined types
authorMatt Corallo <git@bluematt.me>
Sat, 30 Jan 2021 22:19:33 +0000 (17:19 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 11 Feb 2021 03:24:16 +0000 (22:24 -0500)
lightning-c-bindings/src/c_types/mod.rs

index dcb8d3078bb84bca61f42ef3a2c50b00b0d0becf..90f86f18f38335dcfc2e5691beb856dadb1b0b43 100644 (file)
@@ -45,6 +45,7 @@ impl SecretKey {
 }
 
 #[repr(C)]
+#[derive(Clone)]
 pub struct Signature {
        pub compact_form: [u8; 64],
 }
@@ -163,6 +164,8 @@ impl TxOut {
 }
 #[no_mangle]
 pub extern "C" fn TxOut_free(_res: TxOut) { }
+#[no_mangle]
+pub extern "C" fn TxOut_clone(orig: &TxOut) -> TxOut { orig.clone() }
 
 #[repr(C)]
 pub struct u8slice {