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=c9d57ee472888560d5a470b9ee28c8168970690a;hp=33325e2539e0ccd77c66e9a00d2e62138211ab16;hb=033f4f3b2750dcd5afc8b158d7474242b29b24f3;hpb=b89fb1fb79be4af261c968bd8cb22739a13e7f1b diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index 33325e2..c9d57ee 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -3790,6 +3790,40 @@ impl From bool { + if let Self::Some(_) = self { true } else { false } + } + #[allow(unused)] pub(crate) fn take(mut self) -> u16 { + if let Self::Some(v) = self { v } else { unreachable!() } + } +} +#[no_mangle] +/// Constructs a new COption_u16Z containing a u16 +pub extern "C" fn COption_u16Z_some(o: u16) -> COption_u16Z { + COption_u16Z::Some(o) +} +#[no_mangle] +/// Constructs a new COption_u16Z containing nothing +pub extern "C" fn COption_u16Z_none() -> COption_u16Z { + COption_u16Z::None +} +#[no_mangle] +/// Frees any resources associated with the u16, if we are in the Some state +pub extern "C" fn COption_u16Z_free(_res: COption_u16Z) { } +#[no_mangle] +/// Creates a new COption_u16Z which has the same data as `orig` +/// but with all dynamically-allocated buffers duplicated in new buffers. +pub extern "C" fn COption_u16Z_clone(orig: &COption_u16Z) -> COption_u16Z { orig.clone() } +#[repr(C)] /// The contents of CResult_NoneAPIErrorZ pub union CResult_NoneAPIErrorZPtr { /// Note that this value is always NULL, as there are no contents in the OK variant