X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Fc_types%2Fderived.rs;h=0660e2603e9c03db869ab4af06fae338aa00a49f;hp=259416e250eb1caae07647c9b14e3f884c961ce0;hb=a0762e60278ee25dd39ce1c880f23e95329e90ea;hpb=ad7f77cab2212da7216591c7f3936cd6893dfff0 diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index 259416e..0660e26 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -329,6 +329,24 @@ impl From bool { + if let Self::Some(_) = self { true } else { false } + } + #[allow(unused)] pub(crate) fn take(mut self) -> u32 { + if let Self::Some(v) = self { v } else { unreachable!() } + } +} +#[no_mangle] +pub extern "C" fn COption_u32Z_free(_res: COption_u32Z) { } +#[no_mangle] +pub extern "C" fn COption_u32Z_clone(orig: &COption_u32Z) -> COption_u32Z { orig.clone() } +#[repr(C)] pub union CResult_HTLCOutputInCommitmentDecodeErrorZPtr { pub result: *mut crate::ln::chan_utils::HTLCOutputInCommitment, pub err: *mut crate::ln::msgs::DecodeError, @@ -1866,6 +1884,24 @@ impl Clone for CResult_ChannelConfigDecodeErrorZ { #[no_mangle] pub extern "C" fn CResult_ChannelConfigDecodeErrorZ_clone(orig: &CResult_ChannelConfigDecodeErrorZ) -> CResult_ChannelConfigDecodeErrorZ { orig.clone() } #[repr(C)] +#[derive(Clone)] +pub enum COption_u64Z { + Some(u64), + None +} +impl COption_u64Z { + #[allow(unused)] pub(crate) fn is_some(&self) -> bool { + if let Self::Some(_) = self { true } else { false } + } + #[allow(unused)] pub(crate) fn take(mut self) -> u64 { + if let Self::Some(v) = self { v } else { unreachable!() } + } +} +#[no_mangle] +pub extern "C" fn COption_u64Z_free(_res: COption_u64Z) { } +#[no_mangle] +pub extern "C" fn COption_u64Z_clone(orig: &COption_u64Z) -> COption_u64Z { orig.clone() } +#[repr(C)] pub union CResult_DirectionalChannelInfoDecodeErrorZPtr { pub result: *mut crate::routing::network_graph::DirectionalChannelInfo, pub err: *mut crate::ln::msgs::DecodeError,