+
+use alloc::str::FromStr;
+use core::ffi::c_void;
+use core::convert::Infallible;
+use bitcoin::hashes::Hash;
+use crate::c_types::*;
+#[cfg(feature="no-std")]
+use alloc::{vec::Vec, boxed::Box};
+
#[repr(C)]
/// The contents of CResult_SecretKeyErrorZ
pub union CResult_SecretKeyErrorZPtr {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::SecretKey, crate::c_types::Secp256k1Error>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_SecretKeyErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_SecretKeyErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::PublicKey, crate::c_types::Secp256k1Error>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PublicKeyErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PublicKeyErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::TxCreationKeys, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_TxCreationKeysDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_TxCreationKeysDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::ChannelPublicKeys, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelPublicKeysDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelPublicKeysDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::TxCreationKeys, crate::c_types::Secp256k1Error>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_TxCreationKeysErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_TxCreationKeysErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::HTLCOutputInCommitment, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_HTLCOutputInCommitmentDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_HTLCOutputInCommitmentDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::ChannelTransactionParameters, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelTransactionParametersDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelTransactionParametersDecodeErrorZPtr { err }
};
Self {
impl CVec_SignatureZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::Signature> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Signature] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::Signature>> for CVec_SignatureZ {
impl Drop for CVec_SignatureZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_SignatureZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::HolderCommitmentTransaction, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_HolderCommitmentTransactionDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_HolderCommitmentTransactionDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::BuiltCommitmentTransaction, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_BuiltCommitmentTransactionDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_BuiltCommitmentTransactionDecodeErrorZPtr { err }
};
Self {
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::lightning::ln::chan_utils::TrustedClosingTransaction,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_TrustedClosingTransactionNoneZ_err() -> CResult_TrustedClosingTransactionNoneZ {
CResult_TrustedClosingTransactionNoneZ {
contents: CResult_TrustedClosingTransactionNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::TrustedClosingTransaction, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_TrustedClosingTransactionNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_TrustedClosingTransactionNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_TrustedClosingTransactionNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::CommitmentTransaction, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_CommitmentTransactionDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_CommitmentTransactionDecodeErrorZPtr { err }
};
Self {
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::lightning::ln::chan_utils::TrustedCommitmentTransaction,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_TrustedCommitmentTransactionNoneZ_err() -> CResult_TrustedCommitmentTransactionNoneZ {
CResult_TrustedCommitmentTransactionNoneZ {
contents: CResult_TrustedCommitmentTransactionNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::chan_utils::TrustedCommitmentTransaction, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_TrustedCommitmentTransactionNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_TrustedCommitmentTransactionNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_TrustedCommitmentTransactionNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::derived::CVec_SignatureZ,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_CVec_SignatureZNoneZ_err() -> CResult_CVec_SignatureZNoneZ {
CResult_CVec_SignatureZNoneZ {
contents: CResult_CVec_SignatureZNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_SignatureZ, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_CVec_SignatureZNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_CVec_SignatureZNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_CVec_SignatureZNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_CVec_SignatureZNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::script::ShutdownScript, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ShutdownScriptDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ShutdownScriptDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::script::ShutdownScript, crate::lightning::ln::script::InvalidShutdownScript>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ShutdownScriptInvalidShutdownScriptZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ShutdownScriptInvalidShutdownScriptZPtr { err }
};
Self {
/// The contents of CResult_NoneErrorZ
pub union CResult_NoneErrorZPtr {
/// Note that this value is always NULL, as there are no contents in the OK variant
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// A pointer to the contents in the error state.
/// Reading from this pointer when `result_ok` is set is undefined.
pub err: *mut crate::c_types::IOError,
pub extern "C" fn CResult_NoneErrorZ_ok() -> CResult_NoneErrorZ {
CResult_NoneErrorZ {
contents: CResult_NoneErrorZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
fn from(mut o: crate::c_types::CResultTempl<(), crate::c_types::IOError>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NoneErrorZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NoneErrorZPtr { result: core::ptr::null_mut() }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NoneErrorZPtr { err }
};
Self {
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NoneErrorZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NoneErrorZPtr {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::router::RouteHop, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RouteHopDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RouteHopDecodeErrorZPtr { err }
};
Self {
impl CVec_RouteHopZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::routing::router::RouteHop> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::routing::router::RouteHop] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::routing::router::RouteHop>> for CVec_RouteHopZ {
impl Drop for CVec_RouteHopZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_RouteHopZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_CVec_RouteHopZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CVec_RouteHopZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_RouteHopZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::CVec_RouteHopZ>> for CVec_CVec_RouteHopZZ {
impl Drop for CVec_CVec_RouteHopZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_CVec_RouteHopZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::router::Route, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RouteDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RouteDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::router::RouteParameters, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RouteParametersDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RouteParametersDecodeErrorZPtr { err }
};
Self {
impl CVec_RouteHintZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::routing::router::RouteHint> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::routing::router::RouteHint] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::routing::router::RouteHint>> for CVec_RouteHintZ {
impl Drop for CVec_RouteHintZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_RouteHintZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::router::Payee, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PayeeDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PayeeDecodeErrorZPtr { err }
};
Self {
impl CVec_RouteHintHopZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::routing::router::RouteHintHop> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::routing::router::RouteHintHop] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::routing::router::RouteHintHop>> for CVec_RouteHintHopZ {
impl Drop for CVec_RouteHintHopZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_RouteHintHopZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::router::RouteHint, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RouteHintDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RouteHintDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::router::RouteHintHop, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RouteHintHopDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RouteHintHopDecodeErrorZPtr { err }
};
Self {
impl CVec_ChannelDetailsZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::channelmanager::ChannelDetails> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::ln::channelmanager::ChannelDetails] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::ln::channelmanager::ChannelDetails>> for CVec_ChannelDetailsZ {
impl Drop for CVec_ChannelDetailsZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_ChannelDetailsZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::router::Route, crate::lightning::ln::msgs::LightningError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RouteLightningErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RouteLightningErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::TxOut, crate::lightning::chain::AccessError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_TxOutAccessErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_TxOutAccessErrorZPtr { err }
};
Self {
impl CVec_C2Tuple_usizeTransactionZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_usizeTransactionZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C2Tuple_usizeTransactionZ>> for CVec_C2Tuple_usizeTransactionZZ {
impl Drop for CVec_C2Tuple_usizeTransactionZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_C2Tuple_usizeTransactionZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_TxidZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::ThirtyTwoBytes> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::ThirtyTwoBytes] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::ThirtyTwoBytes>> for CVec_TxidZ {
impl Drop for CVec_TxidZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_TxidZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
/// The contents of CResult_NoneChannelMonitorUpdateErrZ
pub union CResult_NoneChannelMonitorUpdateErrZPtr {
/// Note that this value is always NULL, as there are no contents in the OK variant
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// A pointer to the contents in the error state.
/// Reading from this pointer when `result_ok` is set is undefined.
pub err: *mut crate::lightning::chain::ChannelMonitorUpdateErr,
pub extern "C" fn CResult_NoneChannelMonitorUpdateErrZ_ok() -> CResult_NoneChannelMonitorUpdateErrZ {
CResult_NoneChannelMonitorUpdateErrZ {
contents: CResult_NoneChannelMonitorUpdateErrZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
fn from(mut o: crate::c_types::CResultTempl<(), crate::lightning::chain::ChannelMonitorUpdateErr>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NoneChannelMonitorUpdateErrZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NoneChannelMonitorUpdateErrZPtr { result: core::ptr::null_mut() }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NoneChannelMonitorUpdateErrZPtr { err }
};
Self {
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NoneChannelMonitorUpdateErrZPtr {
impl CVec_MonitorEventZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::chain::channelmonitor::MonitorEvent> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::chain::channelmonitor::MonitorEvent] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::chain::channelmonitor::MonitorEvent>> for CVec_MonitorEventZ {
impl Drop for CVec_MonitorEventZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_MonitorEventZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::COption_ClosureReasonZ, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_COption_ClosureReasonZDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_COption_ClosureReasonZDecodeErrorZPtr { err }
};
Self {
impl CVec_SpendableOutputDescriptorZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::chain::keysinterface::SpendableOutputDescriptor> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::chain::keysinterface::SpendableOutputDescriptor] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::chain::keysinterface::SpendableOutputDescriptor>> for CVec_SpendableOutputDescriptorZ {
impl Drop for CVec_SpendableOutputDescriptorZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_SpendableOutputDescriptorZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::COption_EventZ, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_COption_EventZDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_COption_EventZDecodeErrorZPtr { err }
};
Self {
impl CVec_MessageSendEventZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::util::events::MessageSendEvent> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::util::events::MessageSendEvent] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::util::events::MessageSendEvent>> for CVec_MessageSendEventZ {
impl Drop for CVec_MessageSendEventZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_MessageSendEventZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::scoring::ScoringParameters, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ScoringParametersDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ScoringParametersDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::scoring::Scorer, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ScorerDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ScorerDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::InitFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_InitFeaturesDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_InitFeaturesDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelFeaturesDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelFeaturesDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::NodeFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_NodeFeaturesDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NodeFeaturesDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::InvoiceFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_InvoiceFeaturesDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_InvoiceFeaturesDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelTypeFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelTypeFeaturesDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelTypeFeaturesDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_StaticPaymentOutputDescriptorDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_StaticPaymentOutputDescriptorDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::keysinterface::SpendableOutputDescriptor, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_SpendableOutputDescriptorDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_SpendableOutputDescriptorDecodeErrorZPtr { err }
};
Self {
/// The contents of CResult_NoneNoneZ
pub union CResult_NoneNoneZPtr {
/// Note that this value is always NULL, as there are no contents in the OK variant
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_NoneNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_NoneNoneZ_ok() -> CResult_NoneNoneZ {
CResult_NoneNoneZ {
contents: CResult_NoneNoneZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
pub extern "C" fn CResult_NoneNoneZ_err() -> CResult_NoneNoneZ {
CResult_NoneNoneZ {
contents: CResult_NoneNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<(), ()>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NoneNoneZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NoneNoneZPtr { result: core::ptr::null_mut() }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_NoneNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_NoneNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NoneNoneZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NoneNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() -> CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::Signature,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_SignatureNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_SignatureNoneZ_err() -> CResult_SignatureNoneZ {
CResult_SignatureNoneZ {
contents: CResult_SignatureNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Signature, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_SignatureNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_SignatureNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_SignatureNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_SignatureNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::keysinterface::Sign, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_SignDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_SignDecodeErrorZPtr { err }
};
Self {
impl CVec_u8Z {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<u8> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[u8] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<u8>> for CVec_u8Z {
impl Drop for CVec_u8Z {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_u8Z {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::RecoverableSignature,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_RecoverableSignatureNoneZ_err() -> CResult_RecoverableSignatureNoneZ {
CResult_RecoverableSignatureNoneZ {
contents: CResult_RecoverableSignatureNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::RecoverableSignature, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RecoverableSignatureNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_RecoverableSignatureNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_RecoverableSignatureNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_RecoverableSignatureNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
impl CVec_CVec_u8ZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CVec_u8Z> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CVec_u8Z] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::CVec_u8Z>> for CVec_CVec_u8ZZ {
impl Drop for CVec_CVec_u8ZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_CVec_u8ZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::derived::CVec_CVec_u8ZZ,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_CVec_CVec_u8ZZNoneZ_err() -> CResult_CVec_CVec_u8ZZNoneZ {
CResult_CVec_CVec_u8ZZNoneZ {
contents: CResult_CVec_CVec_u8ZZNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_CVec_u8ZZ, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_CVec_CVec_u8ZZNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_CVec_CVec_u8ZZNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_CVec_CVec_u8ZZNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_CVec_CVec_u8ZZNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::keysinterface::InMemorySigner, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_InMemorySignerDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_InMemorySignerDecodeErrorZPtr { err }
};
Self {
impl CVec_TxOutZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::TxOut> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::TxOut] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::TxOut>> for CVec_TxOutZ {
impl Drop for CVec_TxOutZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_TxOutZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::Transaction,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_TransactionNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_TransactionNoneZ_err() -> CResult_TransactionNoneZ {
CResult_TransactionNoneZ {
contents: CResult_TransactionNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Transaction, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_TransactionNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_TransactionNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_TransactionNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_TransactionNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
impl CVec_C2Tuple_BlockHashChannelMonitorZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ>> for CVec_C2Tuple_BlockHashChannelMonitorZZ {
impl Drop for CVec_C2Tuple_BlockHashChannelMonitorZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
#[repr(C)]
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ, crate::c_types::IOError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr { err }
};
Self {
/// 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
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// A pointer to the contents in the error state.
/// Reading from this pointer when `result_ok` is set is undefined.
pub err: *mut crate::lightning::util::errors::APIError,
pub extern "C" fn CResult_NoneAPIErrorZ_ok() -> CResult_NoneAPIErrorZ {
CResult_NoneAPIErrorZ {
contents: CResult_NoneAPIErrorZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
fn from(mut o: crate::c_types::CResultTempl<(), crate::lightning::util::errors::APIError>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NoneAPIErrorZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NoneAPIErrorZPtr { result: core::ptr::null_mut() }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NoneAPIErrorZPtr { err }
};
Self {
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NoneAPIErrorZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NoneAPIErrorZPtr {
impl CVec_CResult_NoneAPIErrorZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::CResult_NoneAPIErrorZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::CResult_NoneAPIErrorZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::CResult_NoneAPIErrorZ>> for CVec_CResult_NoneAPIErrorZZ {
impl Drop for CVec_CResult_NoneAPIErrorZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_CResult_NoneAPIErrorZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_APIErrorZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::util::errors::APIError> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::util::errors::APIError] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::util::errors::APIError>> for CVec_APIErrorZ {
impl Drop for CVec_APIErrorZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_APIErrorZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, crate::lightning::util::errors::APIError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult__u832APIErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult__u832APIErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, crate::lightning::ln::channelmanager::PaymentSendFailure>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PaymentIdPaymentSendFailureZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PaymentIdPaymentSendFailureZPtr { err }
};
Self {
/// The contents of CResult_NonePaymentSendFailureZ
pub union CResult_NonePaymentSendFailureZPtr {
/// Note that this value is always NULL, as there are no contents in the OK variant
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// A pointer to the contents in the error state.
/// Reading from this pointer when `result_ok` is set is undefined.
pub err: *mut crate::lightning::ln::channelmanager::PaymentSendFailure,
pub extern "C" fn CResult_NonePaymentSendFailureZ_ok() -> CResult_NonePaymentSendFailureZ {
CResult_NonePaymentSendFailureZ {
contents: CResult_NonePaymentSendFailureZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
fn from(mut o: crate::c_types::CResultTempl<(), crate::lightning::ln::channelmanager::PaymentSendFailure>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NonePaymentSendFailureZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NonePaymentSendFailureZPtr { result: core::ptr::null_mut() }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NonePaymentSendFailureZPtr { err }
};
Self {
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NonePaymentSendFailureZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NonePaymentSendFailureZPtr {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ, crate::lightning::ln::channelmanager::PaymentSendFailure>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr { err }
};
Self {
impl CVec_NetAddressZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::NetAddress> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::ln::msgs::NetAddress] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::ln::msgs::NetAddress>> for CVec_NetAddressZ {
impl Drop for CVec_NetAddressZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_NetAddressZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() -> CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
contents: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ, crate::lightning::util::errors::APIError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr { err }
};
Self {
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::c_types::ThirtyTwoBytes,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_PaymentSecretNoneZ_err() -> CResult_PaymentSecretNoneZ {
CResult_PaymentSecretNoneZ {
contents: CResult_PaymentSecretNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PaymentSecretNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_PaymentSecretNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_PaymentSecretNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_PaymentSecretNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, crate::lightning::util::errors::APIError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PaymentSecretAPIErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PaymentSecretAPIErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, crate::lightning::util::errors::APIError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PaymentPreimageAPIErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PaymentPreimageAPIErrorZPtr { err }
};
Self {
impl CVec_ChannelMonitorZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::chain::channelmonitor::ChannelMonitor> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::chain::channelmonitor::ChannelMonitor] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::chain::channelmonitor::ChannelMonitor>> for CVec_ChannelMonitorZ {
impl Drop for CVec_ChannelMonitorZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
#[repr(C)]
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::util::config::ChannelConfig, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelConfigDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelConfigDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::transaction::OutPoint, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_OutPointDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_OutPointDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::COption_TypeZ, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_COption_TypeZDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_COption_TypeZDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, crate::lightning_invoice::payment::PaymentError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PaymentIdPaymentErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PaymentIdPaymentErrorZPtr { err }
};
Self {
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::lightning_invoice::SiPrefix,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_SiPrefixNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_SiPrefixNoneZ_err() -> CResult_SiPrefixNoneZ {
CResult_SiPrefixNoneZ {
contents: CResult_SiPrefixNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::SiPrefix, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_SiPrefixNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_SiPrefixNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_SiPrefixNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_SiPrefixNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::lightning_invoice::Invoice,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_InvoiceNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_InvoiceNoneZ_err() -> CResult_InvoiceNoneZ {
CResult_InvoiceNoneZ {
contents: CResult_InvoiceNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::Invoice, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_InvoiceNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_InvoiceNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_InvoiceNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_InvoiceNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::lightning_invoice::SignedRawInvoice,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_SignedRawInvoiceNoneZ_err() -> CResult_SignedRawInvoiceNoneZ {
CResult_SignedRawInvoiceNoneZ {
contents: CResult_SignedRawInvoiceNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::SignedRawInvoice, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_SignedRawInvoiceNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_SignedRawInvoiceNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_SignedRawInvoiceNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
} }
} else {
Self { result_ok: false, contents: CResult_SignedRawInvoiceNoneZPtr {
- err: std::ptr::null_mut()
+ err: core::ptr::null_mut()
} }
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::PayeePubKey, crate::c_types::Secp256k1Error>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PayeePubKeyErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PayeePubKeyErrorZPtr { err }
};
Self {
impl CVec_PrivateRouteZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning_invoice::PrivateRoute> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning_invoice::PrivateRoute] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning_invoice::PrivateRoute>> for CVec_PrivateRouteZ {
impl Drop for CVec_PrivateRouteZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_PrivateRouteZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::PositiveTimestamp, crate::lightning_invoice::CreationError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PositiveTimestampCreationErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PositiveTimestampCreationErrorZPtr { err }
};
Self {
/// The contents of CResult_NoneSemanticErrorZ
pub union CResult_NoneSemanticErrorZPtr {
/// Note that this value is always NULL, as there are no contents in the OK variant
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// A pointer to the contents in the error state.
/// Reading from this pointer when `result_ok` is set is undefined.
pub err: *mut crate::lightning_invoice::SemanticError,
pub extern "C" fn CResult_NoneSemanticErrorZ_ok() -> CResult_NoneSemanticErrorZ {
CResult_NoneSemanticErrorZ {
contents: CResult_NoneSemanticErrorZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
fn from(mut o: crate::c_types::CResultTempl<(), crate::lightning_invoice::SemanticError>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NoneSemanticErrorZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NoneSemanticErrorZPtr { result: core::ptr::null_mut() }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NoneSemanticErrorZPtr { err }
};
Self {
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NoneSemanticErrorZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NoneSemanticErrorZPtr {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::Invoice, crate::lightning_invoice::SemanticError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_InvoiceSemanticErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_InvoiceSemanticErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::Description, crate::lightning_invoice::CreationError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_DescriptionCreationErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_DescriptionCreationErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::ExpiryTime, crate::lightning_invoice::CreationError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ExpiryTimeCreationErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ExpiryTimeCreationErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::PrivateRoute, crate::lightning_invoice::CreationError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PrivateRouteCreationErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PrivateRouteCreationErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::Str, crate::c_types::Secp256k1Error>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_StringErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_StringErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::channelmonitor::ChannelMonitorUpdate, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelMonitorUpdateDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelMonitorUpdateDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::COption_MonitorEventZ, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_COption_MonitorEventZDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_COption_MonitorEventZDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::channelmonitor::HTLCUpdate, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_HTLCUpdateDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_HTLCUpdateDecodeErrorZPtr { err }
};
Self {
impl CVec_C2Tuple_u32ScriptZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_u32ScriptZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_u32ScriptZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C2Tuple_u32ScriptZ>> for CVec_C2Tuple_u32ScriptZZ {
impl Drop for CVec_C2Tuple_u32ScriptZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_C2Tuple_u32ScriptZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ>> for CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
impl Drop for CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_EventZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::util::events::Event> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::util::events::Event] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::util::events::Event>> for CVec_EventZ {
impl Drop for CVec_EventZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_EventZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_TransactionZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::Transaction> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::Transaction] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::Transaction>> for CVec_TransactionZ {
impl Drop for CVec_TransactionZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_TransactionZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_C2Tuple_u32TxOutZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_u32TxOutZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_u32TxOutZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C2Tuple_u32TxOutZ>> for CVec_C2Tuple_u32TxOutZZ {
impl Drop for CVec_C2Tuple_u32TxOutZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_C2Tuple_u32TxOutZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_TransactionOutputsZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ>> for CVec_TransactionOutputsZ {
impl Drop for CVec_TransactionOutputsZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_TransactionOutputsZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_BalanceZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::chain::channelmonitor::Balance> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::chain::channelmonitor::Balance] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::chain::channelmonitor::Balance>> for CVec_BalanceZ {
impl Drop for CVec_BalanceZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_BalanceZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr { err }
};
Self {
/// The contents of CResult_NoneLightningErrorZ
pub union CResult_NoneLightningErrorZPtr {
/// Note that this value is always NULL, as there are no contents in the OK variant
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// A pointer to the contents in the error state.
/// Reading from this pointer when `result_ok` is set is undefined.
pub err: *mut crate::lightning::ln::msgs::LightningError,
pub extern "C" fn CResult_NoneLightningErrorZ_ok() -> CResult_NoneLightningErrorZ {
CResult_NoneLightningErrorZ {
contents: CResult_NoneLightningErrorZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
fn from(mut o: crate::c_types::CResultTempl<(), crate::lightning::ln::msgs::LightningError>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NoneLightningErrorZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NoneLightningErrorZPtr { result: core::ptr::null_mut() }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NoneLightningErrorZPtr { err }
};
Self {
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NoneLightningErrorZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NoneLightningErrorZPtr {
impl CVec_C2Tuple_PublicKeyTypeZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C2Tuple_PublicKeyTypeZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C2Tuple_PublicKeyTypeZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C2Tuple_PublicKeyTypeZ>> for CVec_C2Tuple_PublicKeyTypeZZ {
impl Drop for CVec_C2Tuple_PublicKeyTypeZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
#[repr(C)]
fn from(mut o: crate::c_types::CResultTempl<bool, crate::lightning::ln::msgs::LightningError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_boolLightningErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_boolLightningErrorZPtr { err }
};
Self {
impl CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ>> for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
impl Drop for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_NodeAnnouncementZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::NodeAnnouncement> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::ln::msgs::NodeAnnouncement] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::ln::msgs::NodeAnnouncement>> for CVec_NodeAnnouncementZ {
impl Drop for CVec_NodeAnnouncementZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_NodeAnnouncementZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_PublicKeyZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::c_types::PublicKey> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::c_types::PublicKey] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::c_types::PublicKey>> for CVec_PublicKeyZ {
impl Drop for CVec_PublicKeyZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_PublicKeyZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::CVec_u8Z, crate::lightning::ln::peer_handler::PeerHandleError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_CVec_u8ZPeerHandleErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_CVec_u8ZPeerHandleErrorZPtr { err }
};
Self {
/// The contents of CResult_NonePeerHandleErrorZ
pub union CResult_NonePeerHandleErrorZPtr {
/// Note that this value is always NULL, as there are no contents in the OK variant
- pub result: *mut std::ffi::c_void,
+ pub result: *mut core::ffi::c_void,
/// A pointer to the contents in the error state.
/// Reading from this pointer when `result_ok` is set is undefined.
pub err: *mut crate::lightning::ln::peer_handler::PeerHandleError,
pub extern "C" fn CResult_NonePeerHandleErrorZ_ok() -> CResult_NonePeerHandleErrorZ {
CResult_NonePeerHandleErrorZ {
contents: CResult_NonePeerHandleErrorZPtr {
- result: std::ptr::null_mut(),
+ result: core::ptr::null_mut(),
},
result_ok: true,
}
fn from(mut o: crate::c_types::CResultTempl<(), crate::lightning::ln::peer_handler::PeerHandleError>) -> Self {
let contents = if o.result_ok {
let _ = unsafe { Box::from_raw(o.contents.result) };
- o.contents.result = std::ptr::null_mut();
- CResult_NonePeerHandleErrorZPtr { result: std::ptr::null_mut() }
+ o.contents.result = core::ptr::null_mut();
+ CResult_NonePeerHandleErrorZPtr { result: core::ptr::null_mut() }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NonePeerHandleErrorZPtr { err }
};
Self {
fn clone(&self) -> Self {
if self.result_ok {
Self { result_ok: true, contents: CResult_NonePeerHandleErrorZPtr {
- result: std::ptr::null_mut()
+ result: core::ptr::null_mut()
} }
} else {
Self { result_ok: false, contents: CResult_NonePeerHandleErrorZPtr {
fn from(mut o: crate::c_types::CResultTempl<bool, crate::lightning::ln::peer_handler::PeerHandleError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_boolPeerHandleErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_boolPeerHandleErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::network_graph::NodeId, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_NodeIdDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NodeIdDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::COption_NetworkUpdateZ, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_COption_NetworkUpdateZDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_COption_NetworkUpdateZDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::network_graph::DirectionalChannelInfo, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_DirectionalChannelInfoDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_DirectionalChannelInfoDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::network_graph::ChannelInfo, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelInfoDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelInfoDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::network_graph::RoutingFees, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RoutingFeesDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RoutingFeesDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::network_graph::NodeAnnouncementInfo, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_NodeAnnouncementInfoDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NodeAnnouncementInfoDecodeErrorZPtr { err }
};
Self {
impl CVec_u64Z {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<u64> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[u64] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<u64>> for CVec_u64Z {
impl Drop for CVec_u64Z {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_u64Z {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::network_graph::NodeInfo, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_NodeInfoDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NodeInfoDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::network_graph::NetworkGraph, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_NetworkGraphDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NetworkGraphDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::NetAddress, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_NetAddressDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NetAddressDecodeErrorZPtr { err }
};
Self {
impl CVec_UpdateAddHTLCZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::UpdateAddHTLC> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::ln::msgs::UpdateAddHTLC] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::ln::msgs::UpdateAddHTLC>> for CVec_UpdateAddHTLCZ {
impl Drop for CVec_UpdateAddHTLCZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_UpdateAddHTLCZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_UpdateFulfillHTLCZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::UpdateFulfillHTLC> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::ln::msgs::UpdateFulfillHTLC] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::ln::msgs::UpdateFulfillHTLC>> for CVec_UpdateFulfillHTLCZ {
impl Drop for CVec_UpdateFulfillHTLCZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_UpdateFulfillHTLCZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_UpdateFailHTLCZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::UpdateFailHTLC> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::ln::msgs::UpdateFailHTLC] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::ln::msgs::UpdateFailHTLC>> for CVec_UpdateFailHTLCZ {
impl Drop for CVec_UpdateFailHTLCZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_UpdateFailHTLCZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
impl CVec_UpdateFailMalformedHTLCZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::UpdateFailMalformedHTLC> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::ln::msgs::UpdateFailMalformedHTLC] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::ln::msgs::UpdateFailMalformedHTLC>> for CVec_UpdateFailMalformedHTLCZ {
impl Drop for CVec_UpdateFailMalformedHTLCZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_UpdateFailMalformedHTLCZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::AcceptChannel, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_AcceptChannelDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_AcceptChannelDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::AnnouncementSignatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_AnnouncementSignaturesDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_AnnouncementSignaturesDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ChannelReestablish, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelReestablishDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelReestablishDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ClosingSigned, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ClosingSignedDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ClosingSignedDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ClosingSignedFeeRange, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ClosingSignedFeeRangeDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ClosingSignedFeeRangeDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::CommitmentSigned, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_CommitmentSignedDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_CommitmentSignedDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::FundingCreated, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_FundingCreatedDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_FundingCreatedDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::FundingSigned, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_FundingSignedDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_FundingSignedDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::FundingLocked, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_FundingLockedDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_FundingLockedDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::Init, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_InitDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_InitDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::OpenChannel, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_OpenChannelDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_OpenChannelDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::RevokeAndACK, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_RevokeAndACKDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_RevokeAndACKDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::Shutdown, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ShutdownDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ShutdownDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UpdateFailHTLC, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UpdateFailHTLCDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UpdateFailHTLCDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UpdateFailMalformedHTLC, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UpdateFailMalformedHTLCDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UpdateFee, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UpdateFeeDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UpdateFeeDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UpdateFulfillHTLC, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UpdateFulfillHTLCDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UpdateFulfillHTLCDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UpdateAddHTLC, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UpdateAddHTLCDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UpdateAddHTLCDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::Ping, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PingDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PingDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::Pong, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_PongDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_PongDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UnsignedChannelAnnouncement, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UnsignedChannelAnnouncementDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ChannelAnnouncement, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelAnnouncementDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelAnnouncementDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UnsignedChannelUpdate, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UnsignedChannelUpdateDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UnsignedChannelUpdateDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ChannelUpdate, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ChannelUpdateDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ChannelUpdateDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ErrorMessage, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ErrorMessageDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ErrorMessageDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::UnsignedNodeAnnouncement, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_UnsignedNodeAnnouncementDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::NodeAnnouncement, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_NodeAnnouncementDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_NodeAnnouncementDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::QueryShortChannelIds, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_QueryShortChannelIdsDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_QueryShortChannelIdsDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ReplyShortChannelIdsEnd, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ReplyShortChannelIdsEndDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::QueryChannelRange, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_QueryChannelRangeDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_QueryChannelRangeDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::ReplyChannelRange, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_ReplyChannelRangeDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_ReplyChannelRangeDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::msgs::GossipTimestampFilter, crate::lightning::ln::msgs::DecodeError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_GossipTimestampFilterDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_GossipTimestampFilterDecodeErrorZPtr { err }
};
Self {
fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::Invoice, crate::lightning_invoice::SignOrCreationError>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_InvoiceSignOrCreationErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
- unsafe { o.contents.err = std::ptr::null_mut(); }
+ unsafe { o.contents.err = core::ptr::null_mut(); }
CResult_InvoiceSignOrCreationErrorZPtr { err }
};
Self {
/// Reading from this pointer when `result_ok` is not set is undefined.
pub result: *mut crate::lightning::chain::chainmonitor::LockedChannelMonitor,
/// Note that this value is always NULL, as there are no contents in the Err variant
- pub err: *mut std::ffi::c_void,
+ pub err: *mut core::ffi::c_void,
}
#[repr(C)]
/// A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
pub extern "C" fn CResult_LockedChannelMonitorNoneZ_err() -> CResult_LockedChannelMonitorNoneZ {
CResult_LockedChannelMonitorNoneZ {
contents: CResult_LockedChannelMonitorNoneZPtr {
- err: std::ptr::null_mut(),
+ err: core::ptr::null_mut(),
},
result_ok: false,
}
fn from(mut o: crate::c_types::CResultTempl<crate::lightning::chain::chainmonitor::LockedChannelMonitor, ()>) -> Self {
let contents = if o.result_ok {
let result = unsafe { o.contents.result };
- unsafe { o.contents.result = std::ptr::null_mut() };
+ unsafe { o.contents.result = core::ptr::null_mut() };
CResult_LockedChannelMonitorNoneZPtr { result }
} else {
let _ = unsafe { Box::from_raw(o.contents.err) };
- o.contents.err = std::ptr::null_mut();
- CResult_LockedChannelMonitorNoneZPtr { err: std::ptr::null_mut() }
+ o.contents.err = core::ptr::null_mut();
+ CResult_LockedChannelMonitorNoneZPtr { err: core::ptr::null_mut() }
};
Self {
contents,
impl CVec_OutPointZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::chain::transaction::OutPoint> {
if self.datalen == 0 { return Vec::new(); }
- let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
- self.data = std::ptr::null_mut();
+ let ret = unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
+ self.data = core::ptr::null_mut();
self.datalen = 0;
ret
}
#[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::chain::transaction::OutPoint] {
- unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
+ unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) }
}
}
impl From<Vec<crate::lightning::chain::transaction::OutPoint>> for CVec_OutPointZ {
impl Drop for CVec_OutPointZ {
fn drop(&mut self) {
if self.datalen == 0 { return; }
- unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
+ unsafe { Box::from_raw(core::slice::from_raw_parts_mut(self.data, self.datalen)) };
}
}
impl Clone for CVec_OutPointZ {
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) });
+ res.extend_from_slice(unsafe { core::slice::from_raw_parts_mut(self.data, self.datalen) });
Self::from(res)
}
}