DecodeError::ShortRead => nativeDecodeError::ShortRead,
DecodeError::BadLengthDescriptor => nativeDecodeError::BadLengthDescriptor,
DecodeError::Io (ref a, ) => {
DecodeError::ShortRead => nativeDecodeError::ShortRead,
DecodeError::BadLengthDescriptor => nativeDecodeError::BadLengthDescriptor,
DecodeError::Io (ref a, ) => {
nativeDecodeError::ShortRead => DecodeError::ShortRead,
nativeDecodeError::BadLengthDescriptor => DecodeError::BadLengthDescriptor,
nativeDecodeError::Io (ref a, ) => {
nativeDecodeError::ShortRead => DecodeError::ShortRead,
nativeDecodeError::BadLengthDescriptor => DecodeError::BadLengthDescriptor,
nativeDecodeError::Io (ref a, ) => {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Init_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Init_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ErrorMessage_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ErrorMessage_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn WarningMessage_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn WarningMessage_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Ping_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Ping_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Pong_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Pong_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn OpenChannel_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn OpenChannel_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn AcceptChannel_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn AcceptChannel_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn FundingCreated_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn FundingCreated_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn FundingSigned_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn FundingSigned_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelReady_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelReady_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Shutdown_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Shutdown_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ClosingSignedFeeRange_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ClosingSignedFeeRange_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ClosingSigned_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ClosingSigned_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateAddHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateAddHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn OnionMessage_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn OnionMessage_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFulfillHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFulfillHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFailHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFailHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFailMalformedHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFailMalformedHTLC_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn CommitmentSigned_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn CommitmentSigned_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn RevokeAndACK_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn RevokeAndACK_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFee_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UpdateFee_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn DataLossProtect_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn DataLossProtect_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelReestablish_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelReestablish_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn AnnouncementSignatures_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn AnnouncementSignatures_free_void(this_ptr: *mut c_void) {
pub(crate) fn to_native(&self) -> nativeNetAddress {
match self {
NetAddress::IPv4 {ref addr, ref port, } => {
pub(crate) fn to_native(&self) -> nativeNetAddress {
match self {
NetAddress::IPv4 {ref addr, ref port, } => {
nativeNetAddress::OnionV2 (
a_nonref.data,
)
},
NetAddress::OnionV3 {ref ed25519_pubkey, ref checksum, ref version, ref port, } => {
nativeNetAddress::OnionV2 (
a_nonref.data,
)
},
NetAddress::OnionV3 {ref ed25519_pubkey, ref checksum, ref version, ref port, } => {
- let mut ed25519_pubkey_nonref = (*ed25519_pubkey).clone();
- let mut checksum_nonref = (*checksum).clone();
- let mut version_nonref = (*version).clone();
- let mut port_nonref = (*port).clone();
+ let mut ed25519_pubkey_nonref = Clone::clone(ed25519_pubkey);
+ let mut checksum_nonref = Clone::clone(checksum);
+ let mut version_nonref = Clone::clone(version);
+ let mut port_nonref = Clone::clone(port);
nativeNetAddress::OnionV3 {
ed25519_pubkey: ed25519_pubkey_nonref.data,
checksum: checksum_nonref,
nativeNetAddress::OnionV3 {
ed25519_pubkey: ed25519_pubkey_nonref.data,
checksum: checksum_nonref,
nativeNetAddress::Hostname {
hostname: *unsafe { Box::from_raw(hostname_nonref.take_inner()) },
port: port_nonref,
nativeNetAddress::Hostname {
hostname: *unsafe { Box::from_raw(hostname_nonref.take_inner()) },
port: port_nonref,
pub(crate) fn from_native(native: &nativeNetAddress) -> Self {
match native {
nativeNetAddress::IPv4 {ref addr, ref port, } => {
pub(crate) fn from_native(native: &nativeNetAddress) -> Self {
match native {
nativeNetAddress::IPv4 {ref addr, ref port, } => {
NetAddress::IPv4 {
addr: crate::c_types::FourBytes { data: addr_nonref },
port: port_nonref,
}
},
nativeNetAddress::IPv6 {ref addr, ref port, } => {
NetAddress::IPv4 {
addr: crate::c_types::FourBytes { data: addr_nonref },
port: port_nonref,
}
},
nativeNetAddress::IPv6 {ref addr, ref port, } => {
NetAddress::IPv6 {
addr: crate::c_types::SixteenBytes { data: addr_nonref },
port: port_nonref,
}
},
nativeNetAddress::OnionV2 (ref a, ) => {
NetAddress::IPv6 {
addr: crate::c_types::SixteenBytes { data: addr_nonref },
port: port_nonref,
}
},
nativeNetAddress::OnionV2 (ref a, ) => {
NetAddress::OnionV2 (
crate::c_types::TwelveBytes { data: a_nonref },
)
},
nativeNetAddress::OnionV3 {ref ed25519_pubkey, ref checksum, ref version, ref port, } => {
NetAddress::OnionV2 (
crate::c_types::TwelveBytes { data: a_nonref },
)
},
nativeNetAddress::OnionV3 {ref ed25519_pubkey, ref checksum, ref version, ref port, } => {
- let mut ed25519_pubkey_nonref = (*ed25519_pubkey).clone();
- let mut checksum_nonref = (*checksum).clone();
- let mut version_nonref = (*version).clone();
- let mut port_nonref = (*port).clone();
+ let mut ed25519_pubkey_nonref = Clone::clone(ed25519_pubkey);
+ let mut checksum_nonref = Clone::clone(checksum);
+ let mut version_nonref = Clone::clone(version);
+ let mut port_nonref = Clone::clone(port);
NetAddress::OnionV3 {
ed25519_pubkey: crate::c_types::ThirtyTwoBytes { data: ed25519_pubkey_nonref },
checksum: checksum_nonref,
NetAddress::OnionV3 {
ed25519_pubkey: crate::c_types::ThirtyTwoBytes { data: ed25519_pubkey_nonref },
checksum: checksum_nonref,
NetAddress::Hostname {
hostname: crate::lightning::util::ser::Hostname { inner: ObjOps::heap_alloc(hostname_nonref), is_owned: true },
port: port_nonref,
NetAddress::Hostname {
hostname: crate::lightning::util::ser::Hostname { inner: ObjOps::heap_alloc(hostname_nonref), is_owned: true },
port: port_nonref,
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UnsignedNodeAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UnsignedNodeAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn NodeAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn NodeAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UnsignedChannelAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UnsignedChannelAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelAnnouncement_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UnsignedChannelUpdate_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn UnsignedChannelUpdate_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelUpdate_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ChannelUpdate_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn QueryChannelRange_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn QueryChannelRange_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ReplyChannelRange_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ReplyChannelRange_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn QueryShortChannelIds_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn QueryShortChannelIds_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ReplyShortChannelIdsEnd_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn ReplyShortChannelIdsEnd_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn GossipTimestampFilter_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn GossipTimestampFilter_free_void(this_ptr: *mut c_void) {
pub(crate) fn to_native(&self) -> nativeErrorAction {
match self {
ErrorAction::DisconnectPeer {ref msg, } => {
pub(crate) fn to_native(&self) -> nativeErrorAction {
match self {
ErrorAction::DisconnectPeer {ref msg, } => {
let mut local_msg_nonref = if msg_nonref.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(msg_nonref.take_inner()) } }) };
nativeErrorAction::DisconnectPeer {
msg: local_msg_nonref,
let mut local_msg_nonref = if msg_nonref.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(msg_nonref.take_inner()) } }) };
nativeErrorAction::DisconnectPeer {
msg: local_msg_nonref,
},
ErrorAction::IgnoreError => nativeErrorAction::IgnoreError,
ErrorAction::IgnoreAndLog (ref a, ) => {
},
ErrorAction::IgnoreError => nativeErrorAction::IgnoreError,
ErrorAction::IgnoreAndLog (ref a, ) => {
nativeErrorAction::IgnoreAndLog (
a_nonref.into_native(),
)
},
ErrorAction::IgnoreDuplicateGossip => nativeErrorAction::IgnoreDuplicateGossip,
ErrorAction::SendErrorMessage {ref msg, } => {
nativeErrorAction::IgnoreAndLog (
a_nonref.into_native(),
)
},
ErrorAction::IgnoreDuplicateGossip => nativeErrorAction::IgnoreDuplicateGossip,
ErrorAction::SendErrorMessage {ref msg, } => {
nativeErrorAction::SendErrorMessage {
msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
ErrorAction::SendWarningMessage {ref msg, ref log_level, } => {
nativeErrorAction::SendErrorMessage {
msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
ErrorAction::SendWarningMessage {ref msg, ref log_level, } => {
nativeErrorAction::SendWarningMessage {
msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
log_level: log_level_nonref.into_native(),
nativeErrorAction::SendWarningMessage {
msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
log_level: log_level_nonref.into_native(),
pub(crate) fn from_native(native: &nativeErrorAction) -> Self {
match native {
nativeErrorAction::DisconnectPeer {ref msg, } => {
pub(crate) fn from_native(native: &nativeErrorAction) -> Self {
match native {
nativeErrorAction::DisconnectPeer {ref msg, } => {
let mut local_msg_nonref = crate::lightning::ln::msgs::ErrorMessage { inner: if msg_nonref.is_none() { core::ptr::null_mut() } else { { ObjOps::heap_alloc((msg_nonref.unwrap())) } }, is_owned: true };
ErrorAction::DisconnectPeer {
msg: local_msg_nonref,
let mut local_msg_nonref = crate::lightning::ln::msgs::ErrorMessage { inner: if msg_nonref.is_none() { core::ptr::null_mut() } else { { ObjOps::heap_alloc((msg_nonref.unwrap())) } }, is_owned: true };
ErrorAction::DisconnectPeer {
msg: local_msg_nonref,
},
nativeErrorAction::IgnoreError => ErrorAction::IgnoreError,
nativeErrorAction::IgnoreAndLog (ref a, ) => {
},
nativeErrorAction::IgnoreError => ErrorAction::IgnoreError,
nativeErrorAction::IgnoreAndLog (ref a, ) => {
ErrorAction::IgnoreAndLog (
crate::lightning::util::logger::Level::native_into(a_nonref),
)
},
nativeErrorAction::IgnoreDuplicateGossip => ErrorAction::IgnoreDuplicateGossip,
nativeErrorAction::SendErrorMessage {ref msg, } => {
ErrorAction::IgnoreAndLog (
crate::lightning::util::logger::Level::native_into(a_nonref),
)
},
nativeErrorAction::IgnoreDuplicateGossip => ErrorAction::IgnoreDuplicateGossip,
nativeErrorAction::SendErrorMessage {ref msg, } => {
ErrorAction::SendErrorMessage {
msg: crate::lightning::ln::msgs::ErrorMessage { inner: ObjOps::heap_alloc(msg_nonref), is_owned: true },
}
},
nativeErrorAction::SendWarningMessage {ref msg, ref log_level, } => {
ErrorAction::SendErrorMessage {
msg: crate::lightning::ln::msgs::ErrorMessage { inner: ObjOps::heap_alloc(msg_nonref), is_owned: true },
}
},
nativeErrorAction::SendWarningMessage {ref msg, ref log_level, } => {
ErrorAction::SendWarningMessage {
msg: crate::lightning::ln::msgs::WarningMessage { inner: ObjOps::heap_alloc(msg_nonref), is_owned: true },
log_level: crate::lightning::util::logger::Level::native_into(log_level_nonref),
ErrorAction::SendWarningMessage {
msg: crate::lightning::ln::msgs::WarningMessage { inner: ObjOps::heap_alloc(msg_nonref), is_owned: true },
log_level: crate::lightning::util::logger::Level::native_into(log_level_nonref),
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn LightningError_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn LightningError_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn CommitmentUpdate_free_void(this_ptr: *mut c_void) {
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn CommitmentUpdate_free_void(this_ptr: *mut c_void) {