*/
typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeTxCreationKeys *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKTxCreationKeys;
*/
typedef struct MUST_USE_STRUCT LDKDecodeError {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDecodeError *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKDecodeError;
*/
typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelPublicKeys *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelPublicKeys;
*/
typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeHTLCOutputInCommitment *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKHTLCOutputInCommitment;
*/
typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeCounterpartyChannelTransactionParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKCounterpartyChannelTransactionParameters;
*/
typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelTransactionParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelTransactionParameters;
*/
typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeHolderCommitmentTransaction *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKHolderCommitmentTransaction;
*/
typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeBuiltCommitmentTransaction *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKBuiltCommitmentTransaction;
*/
typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeCommitmentTransaction *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKCommitmentTransaction;
*/
typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeTrustedCommitmentTransaction *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKTrustedCommitmentTransaction;
*/
typedef struct MUST_USE_STRUCT LDKAcceptChannel {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeAcceptChannel *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKAcceptChannel;
*/
typedef struct MUST_USE_STRUCT LDKOpenChannel {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeOpenChannel *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKOpenChannel;
*/
typedef struct MUST_USE_STRUCT LDKFundingCreated {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeFundingCreated *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKFundingCreated;
*/
typedef struct MUST_USE_STRUCT LDKFundingSigned {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeFundingSigned *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKFundingSigned;
*/
typedef struct MUST_USE_STRUCT LDKFundingLocked {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeFundingLocked *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKFundingLocked;
*/
typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeAnnouncementSignatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKAnnouncementSignatures;
*/
typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeCommitmentUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKCommitmentUpdate;
*/
typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRevokeAndACK *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKRevokeAndACK;
*/
typedef struct MUST_USE_STRUCT LDKClosingSigned {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeClosingSigned *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKClosingSigned;
*/
typedef struct MUST_USE_STRUCT LDKShutdown {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeShutdown *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKShutdown;
*/
typedef struct MUST_USE_STRUCT LDKChannelReestablish {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelReestablish *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelReestablish;
*/
typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelAnnouncement *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelAnnouncement;
*/
typedef struct MUST_USE_STRUCT LDKChannelUpdate {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelUpdate;
*/
typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeAnnouncement *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKNodeAnnouncement;
*/
typedef struct MUST_USE_STRUCT LDKErrorMessage {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeErrorMessage *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKErrorMessage;
} LDKErrorAction_Tag;
typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
+ /**
+ * An error message which we should make an effort to send before we disconnect.
+ */
struct LDKErrorMessage msg;
} LDKErrorAction_LDKDisconnectPeer_Body;
typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
+ /**
+ * The message to send.
+ */
struct LDKErrorMessage msg;
} LDKErrorAction_LDKSendErrorMessage_Body;
} LDKHTLCFailChannelUpdate_Tag;
typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
+ /**
+ * The unwrapped message we received
+ */
struct LDKChannelUpdate msg;
} LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
+ /**
+ * The short_channel_id which has now closed.
+ */
uint64_t short_channel_id;
+ /**
+ * when this true, this channel should be permanently removed from the
+ * consideration. Otherwise, this channel can be restored as new channel_update is received
+ */
bool is_permanent;
} LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
+ /**
+ * The node_id that has failed.
+ */
struct LDKPublicKey node_id;
+ /**
+ * when this true, node should be permanently removed from the
+ * consideration. Otherwise, the channels connected to this node can be
+ * restored as new channel_update is received
+ */
bool is_permanent;
} LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
*/
typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeQueryChannelRange *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKQueryChannelRange;
*/
typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeQueryShortChannelIds *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKQueryShortChannelIds;
} LDKMessageSendEvent_Tag;
typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKAcceptChannel msg;
} LDKMessageSendEvent_LDKSendAcceptChannel_Body;
typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKOpenChannel msg;
} LDKMessageSendEvent_LDKSendOpenChannel_Body;
typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKFundingCreated msg;
} LDKMessageSendEvent_LDKSendFundingCreated_Body;
typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKFundingSigned msg;
} LDKMessageSendEvent_LDKSendFundingSigned_Body;
typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
+ /**
+ * The node_id of the node which should receive these message(s)
+ */
struct LDKPublicKey node_id;
+ /**
+ * The funding_locked message which should be sent.
+ */
struct LDKFundingLocked msg;
} LDKMessageSendEvent_LDKSendFundingLocked_Body;
typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
+ /**
+ * The node_id of the node which should receive these message(s)
+ */
struct LDKPublicKey node_id;
+ /**
+ * The announcement_signatures message which should be sent.
+ */
struct LDKAnnouncementSignatures msg;
} LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
+ /**
+ * The node_id of the node which should receive these message(s)
+ */
struct LDKPublicKey node_id;
+ /**
+ * The update messages which should be sent. ALL messages in the struct should be sent!
+ */
struct LDKCommitmentUpdate updates;
} LDKMessageSendEvent_LDKUpdateHTLCs_Body;
typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKRevokeAndACK msg;
} LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKClosingSigned msg;
} LDKMessageSendEvent_LDKSendClosingSigned_Body;
typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKShutdown msg;
} LDKMessageSendEvent_LDKSendShutdown_Body;
typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The message which should be sent.
+ */
struct LDKChannelReestablish msg;
} LDKMessageSendEvent_LDKSendChannelReestablish_Body;
typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
+ /**
+ * The channel_announcement which should be sent.
+ */
struct LDKChannelAnnouncement msg;
+ /**
+ * The followup channel_update which should be sent.
+ */
struct LDKChannelUpdate update_msg;
} LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
+ /**
+ * The node_announcement which should be sent.
+ */
struct LDKNodeAnnouncement msg;
} LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
+ /**
+ * The channel_update which should be sent.
+ */
struct LDKChannelUpdate msg;
} LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
typedef struct LDKMessageSendEvent_LDKHandleError_Body {
+ /**
+ * The node_id of the node which should receive this message
+ */
struct LDKPublicKey node_id;
+ /**
+ * The action which should be taken.
+ */
struct LDKErrorAction action;
} LDKMessageSendEvent_LDKHandleError_Body;
typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
+ /**
+ * The channel/node update which should be sent to NetGraphMsgHandler
+ */
struct LDKHTLCFailChannelUpdate update;
} LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
+ /**
+ * The node_id of this message recipient
+ */
struct LDKPublicKey node_id;
+ /**
+ * The query_channel_range which should be sent.
+ */
struct LDKQueryChannelRange msg;
} LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
+ /**
+ * The node_id of this message recipient
+ */
struct LDKPublicKey node_id;
+ /**
+ * The query_short_channel_ids which should be sent.
+ */
struct LDKQueryShortChannelIds msg;
} LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
*/
typedef struct MUST_USE_STRUCT LDKLightningError {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeLightningError *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKLightningError;
*/
typedef struct MUST_USE_STRUCT LDKPeerHandleError {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePeerHandleError *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKPeerHandleError;
*/
typedef struct MUST_USE_STRUCT LDKInitFeatures {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeInitFeatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKInitFeatures;
*/
typedef struct MUST_USE_STRUCT LDKNodeFeatures {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeFeatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKNodeFeatures;
*/
typedef struct MUST_USE_STRUCT LDKChannelFeatures {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelFeatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelFeatures;
+/**
+ * Features used within an invoice.
+ */
+typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInvoiceFeatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInvoiceFeatures;
+
+typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
+ struct LDKInvoiceFeatures *result;
+ struct LDKDecodeError *err;
+} LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
+
+typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
+ union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
+ bool result_ok;
+} LDKCResult_InvoiceFeaturesDecodeErrorZ;
+
+
+
/**
* Options which apply on a per-channel basis and may change at runtime or based on negotiation
* with our counterparty.
*/
typedef struct MUST_USE_STRUCT LDKChannelConfig {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelConfig *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelConfig;
*/
typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDirectionalChannelInfo *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKDirectionalChannelInfo;
*/
typedef struct MUST_USE_STRUCT LDKChannelInfo {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelInfo *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelInfo;
*/
typedef struct MUST_USE_STRUCT LDKRoutingFees {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRoutingFees *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKRoutingFees;
} LDKNetAddress_Tag;
typedef struct LDKNetAddress_LDKIPv4_Body {
+ /**
+ * The 4-byte IPv4 address
+ */
struct LDKFourBytes addr;
+ /**
+ * The port on which the node is listening
+ */
uint16_t port;
} LDKNetAddress_LDKIPv4_Body;
typedef struct LDKNetAddress_LDKIPv6_Body {
+ /**
+ * The 16-byte IPv6 address
+ */
struct LDKSixteenBytes addr;
+ /**
+ * The port on which the node is listening
+ */
uint16_t port;
} LDKNetAddress_LDKIPv6_Body;
typedef struct LDKNetAddress_LDKOnionV2_Body {
+ /**
+ * The bytes (usually encoded in base32 with \".onion\" appended)
+ */
struct LDKTenBytes addr;
+ /**
+ * The port on which the node is listening
+ */
uint16_t port;
} LDKNetAddress_LDKOnionV2_Body;
typedef struct LDKNetAddress_LDKOnionV3_Body {
+ /**
+ * The ed25519 long-term public key of the peer
+ */
struct LDKThirtyTwoBytes ed25519_pubkey;
+ /**
+ * The checksum of the pubkey and version, as included in the onion address
+ */
uint16_t checksum;
+ /**
+ * The version byte, as defined by the Tor Onion v3 spec.
+ */
uint8_t version;
+ /**
+ * The port on which the node is listening
+ */
uint16_t port;
} LDKNetAddress_LDKOnionV3_Body;
*/
typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeAnnouncementInfo *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKNodeAnnouncementInfo;
*/
typedef struct MUST_USE_STRUCT LDKNodeInfo {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeInfo *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKNodeInfo;
*/
typedef struct MUST_USE_STRUCT LDKNetworkGraph {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNetworkGraph *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKNetworkGraph;
*/
typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeHTLCUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKHTLCUpdate;
*/
typedef struct MUST_USE_STRUCT LDKOutPoint {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeOutPoint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKOutPoint;
*/
typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDelayedPaymentOutputDescriptor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKDelayedPaymentOutputDescriptor;
*/
typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeStaticPaymentOutputDescriptor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKStaticPaymentOutputDescriptor;
} LDKSpendableOutputDescriptor_Tag;
typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
+ /**
+ * The outpoint which is spendable
+ */
struct LDKOutPoint outpoint;
+ /**
+ * The output which is referenced by the given outpoint.
+ */
struct LDKTxOut output;
} LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
} LDKEvent_Tag;
typedef struct LDKEvent_LDKFundingGenerationReady_Body {
+ /**
+ * The random channel_id we picked which you'll need to pass into
+ * ChannelManager::funding_transaction_generated.
+ */
struct LDKThirtyTwoBytes temporary_channel_id;
+ /**
+ * The value, in satoshis, that the output should have.
+ */
uint64_t channel_value_satoshis;
+ /**
+ * The script which should be used in the transaction output.
+ */
struct LDKCVec_u8Z output_script;
+ /**
+ * The value passed in to ChannelManager::create_channel
+ */
uint64_t user_channel_id;
} LDKEvent_LDKFundingGenerationReady_Body;
typedef struct LDKEvent_LDKFundingBroadcastSafe_Body {
+ /**
+ * The output, which was passed to ChannelManager::funding_transaction_generated, which is
+ * now safe to broadcast.
+ */
struct LDKOutPoint funding_txo;
+ /**
+ * The value passed in to ChannelManager::create_channel
+ */
uint64_t user_channel_id;
} LDKEvent_LDKFundingBroadcastSafe_Body;
typedef struct LDKEvent_LDKPaymentReceived_Body {
+ /**
+ * The hash for which the preimage should be handed to the ChannelManager.
+ */
struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * The \"payment secret\". This authenticates the sender to the recipient, preventing a
+ * number of deanonymization attacks during the routing process.
+ * As nodes upgrade, the invoices you provide should likely migrate to setting the
+ * payment_secret feature to required, at which point you should fail_backwards any HTLCs
+ * which have a None here.
+ * Until then, however, values of None should be ignored, and only incorrect Some values
+ * should result in an HTLC fail_backwards.
+ * Note that, in any case, this value must be passed as-is to any fail or claim calls as
+ * the HTLC index includes this value.
+ */
struct LDKThirtyTwoBytes payment_secret;
+ /**
+ * The value, in thousandths of a satoshi, that this payment is for. Note that you must
+ * compare this to the expected value before accepting the payment (as otherwise you are
+ * providing proof-of-payment for less than the value you expected!).
+ */
uint64_t amt;
} LDKEvent_LDKPaymentReceived_Body;
typedef struct LDKEvent_LDKPaymentSent_Body {
+ /**
+ * The preimage to the hash given to ChannelManager::send_payment.
+ * Note that this serves as a payment receipt, if you wish to have such a thing, you must
+ * store it somehow!
+ */
struct LDKThirtyTwoBytes payment_preimage;
} LDKEvent_LDKPaymentSent_Body;
typedef struct LDKEvent_LDKPaymentFailed_Body {
+ /**
+ * The hash which was given to ChannelManager::send_payment.
+ */
struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * Indicates the payment was rejected for some reason by the recipient. This implies that
+ * the payment has failed, not just the route in question. If this is not set, you may
+ * retry the payment via a different route.
+ */
bool rejected_by_dest;
} LDKEvent_LDKPaymentFailed_Body;
typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
+ /**
+ * The minimum amount of time that should be waited prior to calling
+ * process_pending_htlc_forwards. To increase the effort required to correlate payments,
+ * you should wait a random amount of time in roughly the range (now + time_forwardable,
+ * now + 5*time_forwardable).
+ */
uint64_t time_forwardable;
} LDKEvent_LDKPendingHTLCsForwardable_Body;
typedef struct LDKEvent_LDKSpendableOutputs_Body {
+ /**
+ * The outputs which you should store as spendable by you.
+ */
struct LDKCVec_SpendableOutputDescriptorZ outputs;
} LDKEvent_LDKSpendableOutputs_Body;
*/
typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelMonitorUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelMonitorUpdate;
*/
typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeMonitorUpdateError *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKMonitorUpdateError;
struct LDKCVec_u8Z b;
} LDKC2Tuple_OutPointScriptZ;
+typedef struct LDKC2Tuple_u32ScriptZ {
+ uint32_t a;
+ struct LDKCVec_u8Z b;
+} LDKC2Tuple_u32ScriptZ;
+
+typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
+ struct LDKC2Tuple_u32ScriptZ *data;
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_u32ScriptZZ;
+
+typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
+ struct LDKThirtyTwoBytes a;
+ struct LDKCVec_C2Tuple_u32ScriptZZ b;
+} LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
+
+typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
+ struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
+
typedef struct LDKCVec_TransactionZ {
struct LDKTransaction *data;
uintptr_t datalen;
*/
typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUnsignedChannelAnnouncement *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUnsignedChannelAnnouncement;
* of LN security model, orthogonal of key management issues.
*/
typedef struct LDKSign {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Gets the per-commitment point for a specific commitment number
* Will be called before any signatures are applied.
*/
void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
+ /**
+ * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
+ * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
+ * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
+ */
void *(*clone)(const void *this_arg);
+ /**
+ * Serialize the object into a byte array
+ */
struct LDKCVec_u8Z (*write)(const void *this_arg);
- void (*free)(void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
} LDKSign;
*/
typedef struct MUST_USE_STRUCT LDKChannelMonitor {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelMonitor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelMonitor;
} LDKAPIError_Tag;
typedef struct LDKAPIError_LDKAPIMisuseError_Body {
+ /**
+ * A human-readable error message
+ */
struct LDKCVec_u8Z err;
} LDKAPIError_LDKAPIMisuseError_Body;
typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
+ /**
+ * A human-readable error message
+ */
struct LDKCVec_u8Z err;
+ /**
+ * The feerate which was too high.
+ */
uint32_t feerate;
} LDKAPIError_LDKFeeRateTooHigh_Body;
typedef struct LDKAPIError_LDKRouteError_Body {
+ /**
+ * A human-readable error message
+ */
struct LDKStr err;
} LDKAPIError_LDKRouteError_Body;
typedef struct LDKAPIError_LDKChannelUnavailable_Body {
+ /**
+ * A human-readable error message
+ */
struct LDKCVec_u8Z err;
} LDKAPIError_LDKChannelUnavailable_Body;
*/
typedef struct MUST_USE_STRUCT LDKChannelDetails {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelDetails *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelDetails;
* [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
*/
typedef struct LDKWatch {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Watches a channel identified by `funding_txo` using `monitor`.
* events.
*/
struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKWatch;
* An interface to send a transaction to the Bitcoin network.
*/
typedef struct LDKBroadcasterInterface {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Sends a transaction out to (hopefully) be mined.
*/
void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKBroadcasterInterface;
* A trait to describe an object which can get user secrets and key material.
*/
typedef struct LDKKeysInterface {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Get node secret key (aka node_id or network_key).
* you've read all of the provided bytes to ensure no corruption occurred.
*/
struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKKeysInterface;
* called from inside the library in response to chain events, P2P events, or timer events).
*/
typedef struct LDKFeeEstimator {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Gets estimated satoshis of fee required per 1000 Weight-Units.
* * ceil(satoshis-per-kbyte / 4)
*/
uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKFeeEstimator;
* A trait encapsulating the operations required of a logger
*/
typedef struct LDKLogger {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Logs the `Record`
*/
void (*log)(const void *this_arg, const char *record);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKLogger;
*/
typedef struct MUST_USE_STRUCT LDKChannelManager {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelManager *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelManager;
*/
typedef struct MUST_USE_STRUCT LDKInMemorySigner {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeInMemorySigner *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKInMemorySigner;
*/
typedef struct MUST_USE_STRUCT LDKRouteHop {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRouteHop *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKRouteHop;
*/
typedef struct MUST_USE_STRUCT LDKRoute {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRoute *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKRoute;
*/
typedef struct MUST_USE_STRUCT LDKRouteHint {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRouteHint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKRouteHint;
*/
typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateAddHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUpdateAddHTLC;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFulfillHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUpdateFulfillHTLC;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFailHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUpdateFailHTLC;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFailMalformedHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUpdateFailMalformedHTLC;
*/
typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeCommitmentSigned *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKCommitmentSigned;
*/
typedef struct MUST_USE_STRUCT LDKInit {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeInit *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKInit;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFee {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFee *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUpdateFee;
*/
typedef struct MUST_USE_STRUCT LDKPing {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePing *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKPing;
*/
typedef struct MUST_USE_STRUCT LDKPong {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePong *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKPong;
*/
typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUnsignedChannelUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUnsignedChannelUpdate;
*/
typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUnsignedNodeAnnouncement *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUnsignedNodeAnnouncement;
*/
typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeReplyShortChannelIdsEnd *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKReplyShortChannelIdsEnd;
*/
typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeReplyChannelRange *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKReplyChannelRange;
*/
typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeGossipTimestampFilter *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKGossipTimestampFilter;
* A trait indicating an object may generate message send events
*/
typedef struct LDKMessageSendEventsProvider {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Gets the list of pending events which were generated by previous actions, clearing the list
* in the process.
*/
struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKMessageSendEventsProvider;
* A trait indicating an object may generate events
*/
typedef struct LDKEventsProvider {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Gets the list of pending events which were generated by previous actions, clearing the list
* in the process.
*/
struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKEventsProvider;
*/
typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelHandshakeConfig *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelHandshakeConfig;
*/
typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelHandshakeLimits *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelHandshakeLimits;
*/
typedef struct MUST_USE_STRUCT LDKUserConfig {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUserConfig *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKUserConfig;
* UTXOs.
*/
typedef struct LDKAccess {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
* [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
*/
struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKAccess;
* Useful when needing to replay chain data upon startup or as new chain events occur.
*/
typedef struct LDKListen {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Notifies the listener that a block was added at the given height.
* Notifies the listener that a block was removed at the given height.
*/
void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKListen;
* [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
*/
typedef struct LDKFilter {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
* `script_pubkey` as the spending condition.
*/
void (*register_output)(const void *this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKFilter;
* kept up-to-date.
*/
typedef struct LDKPersist {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Persist a new channel's data. The data can be stored any way you want, but
* [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
*/
struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKPersist;
*/
typedef struct MUST_USE_STRUCT LDKChainMonitor {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChainMonitor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChainMonitor;
*/
typedef struct MUST_USE_STRUCT LDKKeysManager {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeKeysManager *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKKeysManager;
*/
typedef struct MUST_USE_STRUCT LDKChainParameters {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChainParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChainParameters;
* they MUST NOT be called in parallel when the two calls have the same their_node_id.
*/
typedef struct LDKChannelMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Handle an incoming open_channel message from the given peer.
* Handle an incoming error message from the given peer.
*/
void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
+ /**
+ * Implementation of MessageSendEventsProvider for this object.
+ */
struct LDKMessageSendEventsProvider MessageSendEventsProvider;
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKChannelMessageHandler;
*/
typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelManagerReadArgs *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKChannelManagerReadArgs;
*/
typedef struct MUST_USE_STRUCT LDKDataLossProtect {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDataLossProtect *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKDataLossProtect;
* repeated disk I/O for queries accessing different parts of the network graph.
*/
typedef struct LDKRoutingMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Handle an incoming node_announcement message, returning true if it should be forwarded on,
* list of short_channel_ids.
*/
struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
+ /**
+ * Implementation of MessageSendEventsProvider for this object.
+ */
struct LDKMessageSendEventsProvider MessageSendEventsProvider;
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKRoutingMessageHandler;
*/
typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeIgnoringMessageHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKIgnoringMessageHandler;
*/
typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeErroringMessageHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKErroringMessageHandler;
*/
typedef struct MUST_USE_STRUCT LDKMessageHandler {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeMessageHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKMessageHandler;
* PeerManager::socket_disconnected().
*/
typedef struct LDKSocketDescriptor {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
void *this_arg;
/**
* Attempts to send some data from the given slice to the peer.
* socket_disconnected but prior to socket_disconnected returning.
*/
void (*disconnect_socket)(void *this_arg);
+ /**
+ * Checks if two objects are equal given this object's this_arg pointer and another object.
+ */
bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
+ /**
+ * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
+ * This is used, for example, for inclusion of this object in a hash map.
+ */
uint64_t (*hash)(const void *this_arg);
+ /**
+ * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
+ * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
+ * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
+ */
void *(*clone)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
void (*free)(void *this_arg);
} LDKSocketDescriptor;
*/
typedef struct MUST_USE_STRUCT LDKPeerManager {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePeerManager *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKPeerManager;
*/
typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDirectedChannelTransactionParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKDirectedChannelTransactionParameters;
*/
typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeLockedNetworkGraph *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKLockedNetworkGraph;
*/
typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
/**
+ * A pointer to the opaque Rust object.
* Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNetGraphMsgHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
bool is_owned;
} LDKNetGraphMsgHandler;
void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
+struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
+
+struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
+
struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
+struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
+
+struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
+
+void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
+
+void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
+
+struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
+
+void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
+
+void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
+
void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
+/**
+ * Frees any resources used by the Event
+ */
void Event_free(struct LDKEvent this_ptr);
+/**
+ * Creates a copy of the Event
+ */
struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
+/**
+ * Serialize the Event object into a byte array which can be read by Event_read
+ */
struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
+/**
+ * Frees any resources used by the MessageSendEvent
+ */
void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
+/**
+ * Creates a copy of the MessageSendEvent
+ */
struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
/**
*/
void EventsProvider_free(struct LDKEventsProvider this_ptr);
+/**
+ * Frees any resources used by the APIError
+ */
void APIError_free(struct LDKAPIError this_ptr);
+/**
+ * Creates a copy of the APIError
+ */
struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
+/**
+ * Creates a copy of the Level
+ */
enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
/**
*/
void Logger_free(struct LDKLogger this_ptr);
-void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr);
+/**
+ * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
+ */
+void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
/**
* Confirmations we will wait for before considering the channel locked in.
*/
void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
+/**
+ * Constructs a new ChannelHandshakeConfig given each field
+ */
MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg);
+/**
+ * Creates a copy of the ChannelHandshakeConfig
+ */
struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
+/**
+ * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
+ */
MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
-void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr);
+/**
+ * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
+ */
+void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
/**
* Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
* Not checking this value would be a security issue, as our peer would be able to set it to
* max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
*
- * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
- * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
+ * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+ * reduce the loss of having useless locked funds (if your peer accepts)
*/
uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
* Not checking this value would be a security issue, as our peer would be able to set it to
* max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
*
- * Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
- * so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
+ * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+ * reduce the loss of having useless locked funds (if your peer accepts)
*/
void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
+/**
+ * Constructs a new ChannelHandshakeLimits given each field
+ */
MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint64_t min_dust_limit_satoshis_arg, uint64_t max_dust_limit_satoshis_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
+/**
+ * Creates a copy of the ChannelHandshakeLimits
+ */
struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
+/**
+ * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
+ */
MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
-void ChannelConfig_free(struct LDKChannelConfig this_ptr);
+/**
+ * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
+ */
+void ChannelConfig_free(struct LDKChannelConfig this_obj);
/**
* Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
*/
void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
+/**
+ * Constructs a new ChannelConfig given each field
+ */
MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
+/**
+ * Creates a copy of the ChannelConfig
+ */
struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
+/**
+ * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
+ */
MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
+/**
+ * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
+ */
struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
+/**
+ * Read a ChannelConfig from a byte array, created by ChannelConfig_write
+ */
struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
-void UserConfig_free(struct LDKUserConfig this_ptr);
+/**
+ * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
+ */
+void UserConfig_free(struct LDKUserConfig this_obj);
/**
* Channel config that we propose to our counterparty.
*/
void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
+/**
+ * Constructs a new UserConfig given each field
+ */
MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg);
+/**
+ * Creates a copy of the UserConfig
+ */
struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
+/**
+ * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
+ */
MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
+/**
+ * Creates a copy of the AccessError
+ */
enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
/**
*/
void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
+/**
+ * Creates a copy of the ConfirmationTarget
+ */
enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
/**
*/
void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
-void ChainMonitor_free(struct LDKChainMonitor this_ptr);
+/**
+ * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
+ */
+void ChainMonitor_free(struct LDKChainMonitor this_obj);
/**
* Dispatches to per-channel monitors, which are responsible for updating their on-chain view
*/
MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
+/**
+ * Constructs a new Watch which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
+ */
struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+/**
+ * Constructs a new EventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
+ */
struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
-void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr);
+/**
+ * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
+ */
+void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
/**
* The sequence number of this update. Updates *must* be replayed in-order according to this
*/
void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
+/**
+ * Creates a copy of the ChannelMonitorUpdate
+ */
struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
+/**
+ * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
+ */
struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
+/**
+ * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
+ */
struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
+/**
+ * Creates a copy of the ChannelMonitorUpdateErr
+ */
enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
-void MonitorUpdateError_free(struct LDKMonitorUpdateError this_ptr);
+/**
+ * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
+ */
+void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
+/**
+ * Creates a copy of the MonitorUpdateError
+ */
struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
+/**
+ * Frees any resources used by the MonitorEvent
+ */
void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
+/**
+ * Creates a copy of the MonitorEvent
+ */
struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
-void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr);
+/**
+ * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
+ */
+void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
+/**
+ * Creates a copy of the HTLCUpdate
+ */
struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
+/**
+ * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
+ */
struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
+/**
+ * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
+ */
struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
-void ChannelMonitor_free(struct LDKChannelMonitor this_ptr);
+/**
+ * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
+ */
+void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
+/**
+ * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
+ */
struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
/**
MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
/**
- * Get the list of HTLCs who's status has been updated on chain. This should be called by
- * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
- *
+ * Gets a list of txids, with their output scripts (in the order they appear in the
+ * transaction), which we must learn about spends of via block_connected().
+ */
+MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
+ * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
+ * have been registered.
+ */
+void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
+
+/**
+ * Get the list of HTLCs who's status has been updated on chain. This should be called by
+ * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
+ *
* [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
*/
MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
*/
void Persist_free(struct LDKPersist this_ptr);
+/**
+ * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
+ */
struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
-void OutPoint_free(struct LDKOutPoint this_ptr);
+/**
+ * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
+ */
+void OutPoint_free(struct LDKOutPoint this_obj);
/**
* The referenced transaction's txid.
*/
void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
+/**
+ * Constructs a new OutPoint given each field
+ */
MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
+/**
+ * Creates a copy of the OutPoint
+ */
struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
/**
*/
MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
+/**
+ * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
+ */
struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
+/**
+ * Read a OutPoint from a byte array, created by OutPoint_write
+ */
struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
-void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_ptr);
+/**
+ * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
+ */
+void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
/**
* The outpoint which is spendable
*/
void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+/**
+ * Constructs a new DelayedPaymentOutputDescriptor given each field
+ */
MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
+/**
+ * Creates a copy of the DelayedPaymentOutputDescriptor
+ */
struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
-void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_ptr);
+/**
+ * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
+ */
+void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
/**
* The outpoint which is spendable
*/
void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+/**
+ * Constructs a new StaticPaymentOutputDescriptor given each field
+ */
MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
+/**
+ * Creates a copy of the StaticPaymentOutputDescriptor
+ */
struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
+/**
+ * Frees any resources used by the SpendableOutputDescriptor
+ */
void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
+/**
+ * Creates a copy of the SpendableOutputDescriptor
+ */
struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
+/**
+ * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
+ */
struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
+/**
+ * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
+ */
struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
+/**
+ * Creates a copy of a Sign
+ */
struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
/**
*/
void KeysInterface_free(struct LDKKeysInterface this_ptr);
-void InMemorySigner_free(struct LDKInMemorySigner this_ptr);
+/**
+ * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
+ */
+void InMemorySigner_free(struct LDKInMemorySigner this_obj);
/**
* Private key of anchor tx
*/
void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+/**
+ * Creates a copy of the InMemorySigner
+ */
struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
/**
*/
MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
+/**
+ * Constructs a new Sign which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
+ */
struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+/**
+ * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
+ */
struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
+/**
+ * Read a InMemorySigner from a byte array, created by InMemorySigner_write
+ */
struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
-void KeysManager_free(struct LDKKeysManager this_ptr);
+/**
+ * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
+ */
+void KeysManager_free(struct LDKKeysManager this_obj);
/**
* Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
*/
MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight);
+/**
+ * Constructs a new KeysInterface which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
+ */
struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
-void ChannelManager_free(struct LDKChannelManager this_ptr);
+/**
+ * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
+ */
+void ChannelManager_free(struct LDKChannelManager this_obj);
-void ChainParameters_free(struct LDKChainParameters this_ptr);
+/**
+ * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
+ */
+void ChainParameters_free(struct LDKChainParameters this_obj);
/**
* The network for determining the `chain_hash` in Lightning messages.
*/
void ChainParameters_set_latest_height(struct LDKChainParameters *NONNULL_PTR this_ptr, uintptr_t val);
+/**
+ * Constructs a new ChainParameters given each field
+ */
MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKThirtyTwoBytes latest_hash_arg, uintptr_t latest_height_arg);
-void ChannelDetails_free(struct LDKChannelDetails this_ptr);
+/**
+ * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
+ */
+void ChannelDetails_free(struct LDKChannelDetails this_obj);
/**
* The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
*/
void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+/**
+ * Creates a copy of the ChannelDetails
+ */
struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
+/**
+ * Frees any resources used by the PaymentSendFailure
+ */
void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
+/**
+ * Creates a copy of the PaymentSendFailure
+ */
struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
/**
*/
void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id);
+/**
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ */
struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
+/**
+ * Constructs a new EventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
+ */
struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
+/**
+ * Constructs a new Listen which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
+ */
struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
/**
*/
void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
+/**
+ * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
+ */
struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
+/**
+ * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
+ */
struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
-void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_ptr);
+/**
+ * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
+ */
+void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
/**
* The keys provider which will give us relevant keys. Some keys will be loaded during
*/
MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
+/**
+ * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
+ */
struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
-void DecodeError_free(struct LDKDecodeError this_ptr);
+/**
+ * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
+ */
+void DecodeError_free(struct LDKDecodeError this_obj);
+/**
+ * Creates a copy of the DecodeError
+ */
struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
-void Init_free(struct LDKInit this_ptr);
+/**
+ * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
+ */
+void Init_free(struct LDKInit this_obj);
/**
* The relevant features which the sender supports
*/
void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+/**
+ * Constructs a new Init given each field
+ */
MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
+/**
+ * Creates a copy of the Init
+ */
struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
-void ErrorMessage_free(struct LDKErrorMessage this_ptr);
+/**
+ * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
+ */
+void ErrorMessage_free(struct LDKErrorMessage this_obj);
/**
* The channel ID involved in the error
*/
void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+/**
+ * Constructs a new ErrorMessage given each field
+ */
MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
+/**
+ * Creates a copy of the ErrorMessage
+ */
struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
-void Ping_free(struct LDKPing this_ptr);
+/**
+ * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
+ */
+void Ping_free(struct LDKPing this_obj);
/**
* The desired response length
*/
void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
+/**
+ * Constructs a new Ping given each field
+ */
MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
+/**
+ * Creates a copy of the Ping
+ */
struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
-void Pong_free(struct LDKPong this_ptr);
+/**
+ * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
+ */
+void Pong_free(struct LDKPong this_obj);
/**
* The pong packet size.
*/
void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
+/**
+ * Constructs a new Pong given each field
+ */
MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
+/**
+ * Creates a copy of the Pong
+ */
struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
-void OpenChannel_free(struct LDKOpenChannel this_ptr);
+/**
+ * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
+ */
+void OpenChannel_free(struct LDKOpenChannel this_obj);
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
+/**
+ * Creates a copy of the OpenChannel
+ */
struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
-void AcceptChannel_free(struct LDKAcceptChannel this_ptr);
+/**
+ * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
+ */
+void AcceptChannel_free(struct LDKAcceptChannel this_obj);
/**
* A temporary channel ID, until the funding outpoint is announced
*/
void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Creates a copy of the AcceptChannel
+ */
struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
-void FundingCreated_free(struct LDKFundingCreated this_ptr);
+/**
+ * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
+ */
+void FundingCreated_free(struct LDKFundingCreated this_obj);
/**
* A temporary channel ID, until the funding is established
*/
void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
+/**
+ * Constructs a new FundingCreated given each field
+ */
MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg);
+/**
+ * Creates a copy of the FundingCreated
+ */
struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
-void FundingSigned_free(struct LDKFundingSigned this_ptr);
+/**
+ * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
+ */
+void FundingSigned_free(struct LDKFundingSigned this_obj);
/**
* The channel ID
*/
void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
+/**
+ * Constructs a new FundingSigned given each field
+ */
MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
+/**
+ * Creates a copy of the FundingSigned
+ */
struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
-void FundingLocked_free(struct LDKFundingLocked this_ptr);
+/**
+ * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
+ */
+void FundingLocked_free(struct LDKFundingLocked this_obj);
/**
* The channel ID
*/
void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Constructs a new FundingLocked given each field
+ */
MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
+/**
+ * Creates a copy of the FundingLocked
+ */
struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
-void Shutdown_free(struct LDKShutdown this_ptr);
+/**
+ * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
+ */
+void Shutdown_free(struct LDKShutdown this_obj);
/**
* The channel ID
*/
void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+/**
+ * Constructs a new Shutdown given each field
+ */
MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
+/**
+ * Creates a copy of the Shutdown
+ */
struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
-void ClosingSigned_free(struct LDKClosingSigned this_ptr);
+/**
+ * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
+ */
+void ClosingSigned_free(struct LDKClosingSigned this_obj);
/**
* The channel ID
*/
void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
+/**
+ * Constructs a new ClosingSigned given each field
+ */
MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
+/**
+ * Creates a copy of the ClosingSigned
+ */
struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
-void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr);
+/**
+ * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
/**
* The channel ID
*/
void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
+/**
+ * Creates a copy of the UpdateAddHTLC
+ */
struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
-void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr);
+/**
+ * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
/**
* The channel ID
*/
void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+/**
+ * Constructs a new UpdateFulfillHTLC given each field
+ */
MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
+/**
+ * Creates a copy of the UpdateFulfillHTLC
+ */
struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
-void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr);
+/**
+ * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
/**
* The channel ID
*/
void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
+/**
+ * Creates a copy of the UpdateFailHTLC
+ */
struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
-void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr);
+/**
+ * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
/**
* The channel ID
*/
void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
+/**
+ * Creates a copy of the UpdateFailMalformedHTLC
+ */
struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
-void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr);
+/**
+ * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
+ */
+void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
/**
* The channel ID
*/
void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
+/**
+ * Constructs a new CommitmentSigned given each field
+ */
MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
+/**
+ * Creates a copy of the CommitmentSigned
+ */
struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
-void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr);
+/**
+ * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
+ */
+void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
/**
* The channel ID
*/
void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Constructs a new RevokeAndACK given each field
+ */
MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
+/**
+ * Creates a copy of the RevokeAndACK
+ */
struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
-void UpdateFee_free(struct LDKUpdateFee this_ptr);
+/**
+ * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFee_free(struct LDKUpdateFee this_obj);
/**
* The channel ID
*/
void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
+/**
+ * Constructs a new UpdateFee given each field
+ */
MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
+/**
+ * Creates a copy of the UpdateFee
+ */
struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
-void DataLossProtect_free(struct LDKDataLossProtect this_ptr);
+/**
+ * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
+ */
+void DataLossProtect_free(struct LDKDataLossProtect this_obj);
/**
* Proof that the sender knows the per-commitment secret of a specific commitment transaction
*/
void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Constructs a new DataLossProtect given each field
+ */
MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
+/**
+ * Creates a copy of the DataLossProtect
+ */
struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
-void ChannelReestablish_free(struct LDKChannelReestablish this_ptr);
+/**
+ * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
+ */
+void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
/**
* The channel ID
*/
void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
+/**
+ * Creates a copy of the ChannelReestablish
+ */
struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
-void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr);
+/**
+ * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
+ */
+void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
/**
* The channel ID
*/
void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
+/**
+ * Constructs a new AnnouncementSignatures given each field
+ */
MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg);
+/**
+ * Creates a copy of the AnnouncementSignatures
+ */
struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
+/**
+ * Frees any resources used by the NetAddress
+ */
void NetAddress_free(struct LDKNetAddress this_ptr);
+/**
+ * Creates a copy of the NetAddress
+ */
struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
+/**
+ * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
+ */
struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
+/**
+ * Read a Result from a byte array, created by Result_write
+ */
struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
-void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr);
+/**
+ * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
/**
* The advertised features
*/
void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
+/**
+ * Creates a copy of the UnsignedNodeAnnouncement
+ */
struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
-void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr);
+/**
+ * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
/**
* The signature by the node key
*/
void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
+/**
+ * Constructs a new NodeAnnouncement given each field
+ */
MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
+/**
+ * Creates a copy of the NodeAnnouncement
+ */
struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
-void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr);
+/**
+ * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
/**
* The advertised channel features
*/
void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Creates a copy of the UnsignedChannelAnnouncement
+ */
struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
-void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr);
+/**
+ * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
/**
* Authentication of the announcement by the first public node
*/
void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
+/**
+ * Constructs a new ChannelAnnouncement given each field
+ */
MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
+/**
+ * Creates a copy of the ChannelAnnouncement
+ */
struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
-void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr);
+/**
+ * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
+ */
+void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
+/**
+ * Creates a copy of the UnsignedChannelUpdate
+ */
struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
-void ChannelUpdate_free(struct LDKChannelUpdate this_ptr);
+/**
+ * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
+ */
+void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
/**
* A signature of the channel update
*/
void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
+/**
+ * Constructs a new ChannelUpdate given each field
+ */
MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
+/**
+ * Creates a copy of the ChannelUpdate
+ */
struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
-void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr);
+/**
+ * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
+ */
+void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
/**
* The genesis hash of the blockchain being queried
*/
void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+/**
+ * Constructs a new QueryChannelRange given each field
+ */
MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
+/**
+ * Creates a copy of the QueryChannelRange
+ */
struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
-void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr);
+/**
+ * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
+ */
+void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
/**
* The genesis hash of the blockchain being queried
*/
void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+/**
+ * Constructs a new ReplyChannelRange given each field
+ */
MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg);
+/**
+ * Creates a copy of the ReplyChannelRange
+ */
struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
-void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr);
+/**
+ * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
+ */
+void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
/**
* The genesis hash of the blockchain being queried
*/
void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
-MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
+/**
+ * Constructs a new QueryShortChannelIds given each field
+ */
+MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
+/**
+ * Creates a copy of the QueryShortChannelIds
+ */
struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
-void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr);
+/**
+ * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
+ */
+void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
/**
* The genesis hash of the blockchain that was queried
*/
void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
+/**
+ * Constructs a new ReplyShortChannelIdsEnd given each field
+ */
MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
+/**
+ * Creates a copy of the ReplyShortChannelIdsEnd
+ */
struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
-void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr);
+/**
+ * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
+ */
+void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
/**
* The genesis hash of the blockchain for channel and node information
*/
void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
+/**
+ * Constructs a new GossipTimestampFilter given each field
+ */
MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
+/**
+ * Creates a copy of the GossipTimestampFilter
+ */
struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
+/**
+ * Frees any resources used by the ErrorAction
+ */
void ErrorAction_free(struct LDKErrorAction this_ptr);
+/**
+ * Creates a copy of the ErrorAction
+ */
struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
-void LightningError_free(struct LDKLightningError this_ptr);
+/**
+ * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
+ */
+void LightningError_free(struct LDKLightningError this_obj);
/**
* A human-readable message describing the error
*/
void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
+/**
+ * Constructs a new LightningError given each field
+ */
MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
+/**
+ * Creates a copy of the LightningError
+ */
struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
-void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr);
+/**
+ * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
+ */
+void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
/**
* update_add_htlc messages which should be sent
*/
void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
+/**
+ * Constructs a new CommitmentUpdate given each field
+ */
MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg);
+/**
+ * Creates a copy of the CommitmentUpdate
+ */
struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
+/**
+ * Frees any resources used by the HTLCFailChannelUpdate
+ */
void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
+/**
+ * Creates a copy of the HTLCFailChannelUpdate
+ */
struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
/**
*/
void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
+/**
+ * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
+ */
struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
+/**
+ * Read a AcceptChannel from a byte array, created by AcceptChannel_write
+ */
struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
+/**
+ * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
+ */
struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
+/**
+ * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
+ */
struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
+/**
+ * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
+ */
struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
+/**
+ * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
+ */
struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
+/**
+ * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
+ */
struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
+/**
+ * Read a ClosingSigned from a byte array, created by ClosingSigned_write
+ */
struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
+/**
+ * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
+ */
struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
+/**
+ * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
+ */
struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
+/**
+ * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
+ */
struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
+/**
+ * Read a FundingCreated from a byte array, created by FundingCreated_write
+ */
struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
+/**
+ * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
+ */
struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
+/**
+ * Read a FundingSigned from a byte array, created by FundingSigned_write
+ */
struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
+/**
+ * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
+ */
struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
+/**
+ * Read a FundingLocked from a byte array, created by FundingLocked_write
+ */
struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
+/**
+ * Serialize the Init object into a byte array which can be read by Init_read
+ */
struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
+/**
+ * Read a Init from a byte array, created by Init_write
+ */
struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
+/**
+ * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
+ */
struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
+/**
+ * Read a OpenChannel from a byte array, created by OpenChannel_write
+ */
struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
+/**
+ * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
+ */
struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
+/**
+ * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
+ */
struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
+/**
+ * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
+ */
struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
+/**
+ * Read a Shutdown from a byte array, created by Shutdown_write
+ */
struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
+/**
+ * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
+ */
struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
+/**
+ * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
+ */
struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
+/**
+ * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
+ */
struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
+/**
+ * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
+ */
struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
+/**
+ * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
+ */
struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
+/**
+ * Read a UpdateFee from a byte array, created by UpdateFee_write
+ */
struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
+/**
+ * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
+ */
struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
+/**
+ * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
+ */
struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
+/**
+ * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
+ */
struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
+/**
+ * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
+ */
struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
+/**
+ * Serialize the Ping object into a byte array which can be read by Ping_read
+ */
struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
+/**
+ * Read a Ping from a byte array, created by Ping_write
+ */
struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
+/**
+ * Serialize the Pong object into a byte array which can be read by Pong_read
+ */
struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
+/**
+ * Read a Pong from a byte array, created by Pong_write
+ */
struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
+/**
+ * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
+ */
struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
+/**
+ * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
+ */
struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
+/**
+ * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
+ */
struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
+/**
+ * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
+ */
struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
+/**
+ * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
+ */
struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
+/**
+ * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
+ */
struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
+/**
+ * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
+ */
struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
+/**
+ * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
+ */
struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
+/**
+ * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
+ */
struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
+/**
+ * Read a ErrorMessage from a byte array, created by ErrorMessage_write
+ */
struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
+/**
+ * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
+ */
struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
+/**
+ * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
+ */
struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
+/**
+ * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
+ */
struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
+/**
+ * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
+ */
struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
+/**
+ * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
+ */
struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
+/**
+ * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
+ */
struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
+/**
+ * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
+ */
struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
+/**
+ * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
+ */
struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
+/**
+ * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
+ */
struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
+/**
+ * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
+ */
struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
+/**
+ * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
+ */
struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
+/**
+ * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
+ */
struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
+/**
+ * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
+ */
struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
+/**
+ * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
+ */
struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
-void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_ptr);
+/**
+ * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
+ */
+void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
+/**
+ * Constructs a new IgnoringMessageHandler given each field
+ */
MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
+/**
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ */
struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+/**
+ * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
+ */
struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
-void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_ptr);
+/**
+ * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
+ */
+void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
/**
* Constructs a new ErroringMessageHandler
*/
MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
+/**
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ */
struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
+/**
+ * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
+ */
struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
-void MessageHandler_free(struct LDKMessageHandler this_ptr);
+/**
+ * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
+ */
+void MessageHandler_free(struct LDKMessageHandler this_obj);
/**
* A message handler which handles messages specific to channels. Usually this is just a
*/
void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
+/**
+ * Constructs a new MessageHandler given each field
+ */
MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
+/**
+ * Creates a copy of a SocketDescriptor
+ */
struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
/**
*/
void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
-void PeerHandleError_free(struct LDKPeerHandleError this_ptr);
+/**
+ * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
+ */
+void PeerHandleError_free(struct LDKPeerHandleError this_obj);
/**
* Used to indicate that we probably can't make any future connections to this peer, implying
*/
void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
+/**
+ * Constructs a new PeerHandleError given each field
+ */
MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
+/**
+ * Creates a copy of the PeerHandleError
+ */
struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
-void PeerManager_free(struct LDKPeerManager this_ptr);
+/**
+ * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
+ */
+void PeerManager_free(struct LDKPeerManager this_obj);
/**
* Constructs a new PeerManager with the given message handlers and node_id secret key
*/
struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
-void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr);
+/**
+ * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
+ */
+void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
/**
* The broadcaster's per-commitment public key which was used to derive the other keys.
*/
void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Constructs a new TxCreationKeys given each field
+ */
MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg);
+/**
+ * Creates a copy of the TxCreationKeys
+ */
struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
+/**
+ * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
+ */
struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
+/**
+ * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
+ */
struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
-void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr);
+/**
+ * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
+ */
+void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
/**
* The public key which is used to sign all commitment transactions, as it appears in the
*/
void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+/**
+ * Constructs a new ChannelPublicKeys given each field
+ */
MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg);
+/**
+ * Creates a copy of the ChannelPublicKeys
+ */
struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
+/**
+ * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
+ */
struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
+/**
+ * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
+ */
struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
/**
*/
struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
-void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr);
+/**
+ * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
+ */
+void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
/**
* Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
*/
void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+/**
+ * Creates a copy of the HTLCOutputInCommitment
+ */
struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
+/**
+ * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
+ */
struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
+/**
+ * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
+ */
struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
/**
*/
struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
-void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr);
+/**
+ * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
+ */
+void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
/**
* Holder public keys
*/
void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+/**
+ * Constructs a new ChannelTransactionParameters given each field
+ */
MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg);
+/**
+ * Creates a copy of the ChannelTransactionParameters
+ */
struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
-void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr);
+/**
+ * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
+ */
+void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
/**
* Counter-party public keys
*/
void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
+/**
+ * Constructs a new CounterpartyChannelTransactionParameters given each field
+ */
MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
+/**
+ * Creates a copy of the CounterpartyChannelTransactionParameters
+ */
struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
/**
*/
MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
+/**
+ * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
+ */
struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
+/**
+ * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
+ */
struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
+/**
+ * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
+ */
struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
+/**
+ * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
+ */
struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
-void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr);
+/**
+ * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
+ */
+void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
/**
* Get the channel pubkeys for the broadcaster
*/
MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
-void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr);
+/**
+ * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
+ */
+void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
/**
* Our counterparty's signature for the transaction
*/
void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
+/**
+ * Creates a copy of the HolderCommitmentTransaction
+ */
struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
+/**
+ * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
+ */
struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
+/**
+ * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
+ */
struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
/**
*/
MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
-void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr);
+/**
+ * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
+ */
+void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
/**
* The commitment transaction
*/
void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+/**
+ * Constructs a new BuiltCommitmentTransaction given each field
+ */
MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
+/**
+ * Creates a copy of the BuiltCommitmentTransaction
+ */
struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
+/**
+ * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
+ */
struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
+/**
+ * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
+ */
struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
/**
*/
MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
-void CommitmentTransaction_free(struct LDKCommitmentTransaction this_ptr);
+/**
+ * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
+ */
+void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
+/**
+ * Creates a copy of the CommitmentTransaction
+ */
struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
+/**
+ * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
+ */
struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
+/**
+ * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
+ */
struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
/**
*/
MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
-void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_ptr);
+/**
+ * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
+ */
+void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
/**
* The transaction ID of the built Bitcoin transaction
*/
uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
+/**
+ * Creates a copy of the InitFeatures
+ */
struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
+/**
+ * Creates a copy of the NodeFeatures
+ */
struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
+/**
+ * Creates a copy of the ChannelFeatures
+ */
struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
-void InitFeatures_free(struct LDKInitFeatures this_ptr);
+/**
+ * Creates a copy of the InvoiceFeatures
+ */
+struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
+ */
+void InitFeatures_free(struct LDKInitFeatures this_obj);
+
+/**
+ * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
+ */
+void NodeFeatures_free(struct LDKNodeFeatures this_obj);
-void NodeFeatures_free(struct LDKNodeFeatures this_ptr);
+/**
+ * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
+ */
+void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
-void ChannelFeatures_free(struct LDKChannelFeatures this_ptr);
+/**
+ * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
+ */
+void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
/**
* Create a blank Features with no features set
*/
MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
+/**
+ * Create a blank Features with no features set
+ */
+MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
+
+/**
+ * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
+ *
+ * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ */
+MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
+
+/**
+ * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
+ */
struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
+/**
+ * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
+ */
struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
+/**
+ * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
+ */
struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
+/**
+ * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
+ */
+struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
+
+/**
+ * Read a InitFeatures from a byte array, created by InitFeatures_write
+ */
struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
+/**
+ * Read a NodeFeatures from a byte array, created by NodeFeatures_write
+ */
struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
+/**
+ * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
+ */
struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
-void RouteHop_free(struct LDKRouteHop this_ptr);
+/**
+ * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
+ */
+struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
+ */
+void RouteHop_free(struct LDKRouteHop this_obj);
/**
* The node_id of the node at this hop.
*/
void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
+/**
+ * Constructs a new RouteHop given each field
+ */
MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg);
+/**
+ * Creates a copy of the RouteHop
+ */
struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
-void Route_free(struct LDKRoute this_ptr);
+/**
+ * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
+ */
+void Route_free(struct LDKRoute this_obj);
/**
* The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
*/
void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
+/**
+ * Constructs a new Route given each field
+ */
MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
+/**
+ * Creates a copy of the Route
+ */
struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
+/**
+ * Serialize the Route object into a byte array which can be read by Route_read
+ */
struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
+/**
+ * Read a Route from a byte array, created by Route_write
+ */
struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
-void RouteHint_free(struct LDKRouteHint this_ptr);
+/**
+ * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
+ */
+void RouteHint_free(struct LDKRouteHint this_obj);
/**
* The node_id of the non-target end of the route
*/
void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
+/**
+ * Creates a copy of the RouteHint
+ */
struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
/**
* Gets a route from us (payer) to the given target node (payee).
*
+ * If the payee provided features in their invoice, they should be provided via payee_features.
+ * Without this, MPP will only be used if the payee's features are available in the network graph.
+ *
* Extra routing hops between known nodes and the target will be used if they are included in
* last_hops.
*
* equal), however the enabled/disabled bit on such channels as well as the
* htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
*/
-struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
+struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
-void NetworkGraph_free(struct LDKNetworkGraph this_ptr);
+/**
+ * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
+ */
+void NetworkGraph_free(struct LDKNetworkGraph this_obj);
+/**
+ * Creates a copy of the NetworkGraph
+ */
struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
-void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr);
+/**
+ * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
+ */
+void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
-void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr);
+/**
+ * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
+ */
+void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
/**
* Creates a new tracker of the actual state of the network of channels and nodes,
*/
MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
+/**
+ * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
+ */
struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
+/**
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ */
struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
-void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr);
+/**
+ * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
+ */
+void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
/**
* When the last update to the channel direction was issued.
*/
void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
+/**
+ * Creates a copy of the DirectionalChannelInfo
+ */
struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
+/**
+ * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
+ */
struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
+/**
+ * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
+ */
struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
-void ChannelInfo_free(struct LDKChannelInfo this_ptr);
+/**
+ * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
+ */
+void ChannelInfo_free(struct LDKChannelInfo this_obj);
/**
* Protocol features of a channel communicated during its announcement
*/
void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
+/**
+ * Creates a copy of the ChannelInfo
+ */
struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
+/**
+ * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
+ */
struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
+/**
+ * Read a ChannelInfo from a byte array, created by ChannelInfo_write
+ */
struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
-void RoutingFees_free(struct LDKRoutingFees this_ptr);
+/**
+ * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
+ */
+void RoutingFees_free(struct LDKRoutingFees this_obj);
/**
* Flat routing fee in satoshis
*/
void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
+/**
+ * Constructs a new RoutingFees given each field
+ */
MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
+/**
+ * Creates a copy of the RoutingFees
+ */
struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
+/**
+ * Read a RoutingFees from a byte array, created by RoutingFees_write
+ */
struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
+/**
+ * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
+ */
struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
-void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr);
+/**
+ * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
+ */
+void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
/**
* Protocol features the node announced support for
*/
void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
+/**
+ * Constructs a new NodeAnnouncementInfo given each field
+ */
MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
+/**
+ * Creates a copy of the NodeAnnouncementInfo
+ */
struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
+/**
+ * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
+ */
struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
+/**
+ * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
+ */
struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
-void NodeInfo_free(struct LDKNodeInfo this_ptr);
+/**
+ * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
+ */
+void NodeInfo_free(struct LDKNodeInfo this_obj);
/**
* All valid channels a node has announced
*/
void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
+/**
+ * Constructs a new NodeInfo given each field
+ */
MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
+/**
+ * Creates a copy of the NodeInfo
+ */
struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
+/**
+ * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
+ */
struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
+/**
+ * Read a NodeInfo from a byte array, created by NodeInfo_write
+ */
struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
+/**
+ * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
+ */
struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
+/**
+ * Read a NetworkGraph from a byte array, created by NetworkGraph_write
+ */
struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
/**
const LDKChannelFeatures* operator &() const { return &self; }
const LDKChannelFeatures* operator ->() const { return &self; }
};
+class InvoiceFeatures {
+private:
+ LDKInvoiceFeatures self;
+public:
+ InvoiceFeatures(const InvoiceFeatures&) = delete;
+ InvoiceFeatures(InvoiceFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(InvoiceFeatures)); }
+ InvoiceFeatures(LDKInvoiceFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKInvoiceFeatures)); }
+ operator LDKInvoiceFeatures() && { LDKInvoiceFeatures res = self; memset(&self, 0, sizeof(LDKInvoiceFeatures)); return res; }
+ ~InvoiceFeatures() { InvoiceFeatures_free(self); }
+ InvoiceFeatures& operator=(InvoiceFeatures&& o) { InvoiceFeatures_free(self); self = o.self; memset(&o, 0, sizeof(InvoiceFeatures)); return *this; }
+ LDKInvoiceFeatures* operator &() { return &self; }
+ LDKInvoiceFeatures* operator ->() { return &self; }
+ const LDKInvoiceFeatures* operator &() const { return &self; }
+ const LDKInvoiceFeatures* operator ->() const { return &self; }
+};
class ChannelHandshakeConfig {
private:
LDKChannelHandshakeConfig self;
const LDKCResult_FundingCreatedDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_FundingCreatedDecodeErrorZ* operator ->() const { return &self; }
};
-class CResult_ChannelAnnouncementDecodeErrorZ {
+class CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
private:
- LDKCResult_ChannelAnnouncementDecodeErrorZ self;
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ self;
public:
- CResult_ChannelAnnouncementDecodeErrorZ(const CResult_ChannelAnnouncementDecodeErrorZ&) = delete;
- CResult_ChannelAnnouncementDecodeErrorZ(CResult_ChannelAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelAnnouncementDecodeErrorZ)); }
- CResult_ChannelAnnouncementDecodeErrorZ(LDKCResult_ChannelAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ)); }
- operator LDKCResult_ChannelAnnouncementDecodeErrorZ() && { LDKCResult_ChannelAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ)); return res; }
- ~CResult_ChannelAnnouncementDecodeErrorZ() { CResult_ChannelAnnouncementDecodeErrorZ_free(self); }
- CResult_ChannelAnnouncementDecodeErrorZ& operator=(CResult_ChannelAnnouncementDecodeErrorZ&& o) { CResult_ChannelAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelAnnouncementDecodeErrorZ)); return *this; }
- LDKCResult_ChannelAnnouncementDecodeErrorZ* operator &() { return &self; }
- LDKCResult_ChannelAnnouncementDecodeErrorZ* operator ->() { return &self; }
- const LDKCResult_ChannelAnnouncementDecodeErrorZ* operator &() const { return &self; }
- const LDKCResult_ChannelAnnouncementDecodeErrorZ* operator ->() const { return &self; }
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ(const CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&) = delete;
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); }
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); }
+ operator LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ() && { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); return res; }
+ ~CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ() { CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(self); }
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ& operator=(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&& o) { CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); return *this; }
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator &() { return &self; }
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator ->() { return &self; }
+ const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator &() const { return &self; }
+ const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator ->() const { return &self; }
};
class CResult_HTLCUpdateDecodeErrorZ {
private:
const LDKCResult_ChannelInfoDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_ChannelInfoDecodeErrorZ* operator ->() const { return &self; }
};
+class CResult_ChannelAnnouncementDecodeErrorZ {
+private:
+ LDKCResult_ChannelAnnouncementDecodeErrorZ self;
+public:
+ CResult_ChannelAnnouncementDecodeErrorZ(const CResult_ChannelAnnouncementDecodeErrorZ&) = delete;
+ CResult_ChannelAnnouncementDecodeErrorZ(CResult_ChannelAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelAnnouncementDecodeErrorZ)); }
+ CResult_ChannelAnnouncementDecodeErrorZ(LDKCResult_ChannelAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ)); }
+ operator LDKCResult_ChannelAnnouncementDecodeErrorZ() && { LDKCResult_ChannelAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ)); return res; }
+ ~CResult_ChannelAnnouncementDecodeErrorZ() { CResult_ChannelAnnouncementDecodeErrorZ_free(self); }
+ CResult_ChannelAnnouncementDecodeErrorZ& operator=(CResult_ChannelAnnouncementDecodeErrorZ&& o) { CResult_ChannelAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelAnnouncementDecodeErrorZ)); return *this; }
+ LDKCResult_ChannelAnnouncementDecodeErrorZ* operator &() { return &self; }
+ LDKCResult_ChannelAnnouncementDecodeErrorZ* operator ->() { return &self; }
+ const LDKCResult_ChannelAnnouncementDecodeErrorZ* operator &() const { return &self; }
+ const LDKCResult_ChannelAnnouncementDecodeErrorZ* operator ->() const { return &self; }
+};
class CResult_CVec_u8ZPeerHandleErrorZ {
private:
LDKCResult_CVec_u8ZPeerHandleErrorZ self;
const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() const { return &self; }
const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() const { return &self; }
};
+class CResult_InvoiceFeaturesDecodeErrorZ {
+private:
+ LDKCResult_InvoiceFeaturesDecodeErrorZ self;
+public:
+ CResult_InvoiceFeaturesDecodeErrorZ(const CResult_InvoiceFeaturesDecodeErrorZ&) = delete;
+ CResult_InvoiceFeaturesDecodeErrorZ(CResult_InvoiceFeaturesDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_InvoiceFeaturesDecodeErrorZ)); }
+ CResult_InvoiceFeaturesDecodeErrorZ(LDKCResult_InvoiceFeaturesDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ)); }
+ operator LDKCResult_InvoiceFeaturesDecodeErrorZ() && { LDKCResult_InvoiceFeaturesDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ)); return res; }
+ ~CResult_InvoiceFeaturesDecodeErrorZ() { CResult_InvoiceFeaturesDecodeErrorZ_free(self); }
+ CResult_InvoiceFeaturesDecodeErrorZ& operator=(CResult_InvoiceFeaturesDecodeErrorZ&& o) { CResult_InvoiceFeaturesDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_InvoiceFeaturesDecodeErrorZ)); return *this; }
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* operator &() { return &self; }
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* operator ->() { return &self; }
+ const LDKCResult_InvoiceFeaturesDecodeErrorZ* operator &() const { return &self; }
+ const LDKCResult_InvoiceFeaturesDecodeErrorZ* operator ->() const { return &self; }
+};
class CResult_ChannelMonitorUpdateDecodeErrorZ {
private:
LDKCResult_ChannelMonitorUpdateDecodeErrorZ self;
const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator ->() const { return &self; }
};
-class CResult_GossipTimestampFilterDecodeErrorZ {
-private:
- LDKCResult_GossipTimestampFilterDecodeErrorZ self;
-public:
- CResult_GossipTimestampFilterDecodeErrorZ(const CResult_GossipTimestampFilterDecodeErrorZ&) = delete;
- CResult_GossipTimestampFilterDecodeErrorZ(CResult_GossipTimestampFilterDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); }
- CResult_GossipTimestampFilterDecodeErrorZ(LDKCResult_GossipTimestampFilterDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); }
- operator LDKCResult_GossipTimestampFilterDecodeErrorZ() && { LDKCResult_GossipTimestampFilterDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); return res; }
- ~CResult_GossipTimestampFilterDecodeErrorZ() { CResult_GossipTimestampFilterDecodeErrorZ_free(self); }
- CResult_GossipTimestampFilterDecodeErrorZ& operator=(CResult_GossipTimestampFilterDecodeErrorZ&& o) { CResult_GossipTimestampFilterDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); return *this; }
- LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() { return &self; }
- LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() { return &self; }
- const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() const { return &self; }
- const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() const { return &self; }
-};
class CResult_TxOutAccessErrorZ {
private:
LDKCResult_TxOutAccessErrorZ self;
const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() const { return &self; }
};
+class CResult_GossipTimestampFilterDecodeErrorZ {
+private:
+ LDKCResult_GossipTimestampFilterDecodeErrorZ self;
+public:
+ CResult_GossipTimestampFilterDecodeErrorZ(const CResult_GossipTimestampFilterDecodeErrorZ&) = delete;
+ CResult_GossipTimestampFilterDecodeErrorZ(CResult_GossipTimestampFilterDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); }
+ CResult_GossipTimestampFilterDecodeErrorZ(LDKCResult_GossipTimestampFilterDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); }
+ operator LDKCResult_GossipTimestampFilterDecodeErrorZ() && { LDKCResult_GossipTimestampFilterDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); return res; }
+ ~CResult_GossipTimestampFilterDecodeErrorZ() { CResult_GossipTimestampFilterDecodeErrorZ_free(self); }
+ CResult_GossipTimestampFilterDecodeErrorZ& operator=(CResult_GossipTimestampFilterDecodeErrorZ&& o) { CResult_GossipTimestampFilterDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); return *this; }
+ LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() { return &self; }
+ LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() { return &self; }
+ const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() const { return &self; }
+ const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() const { return &self; }
+};
class CResult_ChannelReestablishDecodeErrorZ {
private:
LDKCResult_ChannelReestablishDecodeErrorZ self;
const LDKCVec_u64Z* operator &() const { return &self; }
const LDKCVec_u64Z* operator ->() const { return &self; }
};
+class C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
+private:
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ self;
+public:
+ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ(const C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ&) = delete;
+ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ(C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ)); }
+ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ)); }
+ operator LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ() && { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ)); return res; }
+ ~C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ() { C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(self); }
+ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ& operator=(C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ&& o) { C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(self); self = o.self; memset(&o, 0, sizeof(C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ)); return *this; }
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* operator &() { return &self; }
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* operator ->() { return &self; }
+ const LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* operator &() const { return &self; }
+ const LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* operator ->() const { return &self; }
+};
class CVec_RouteHintZ {
private:
LDKCVec_RouteHintZ self;
const LDKCVec_MonitorEventZ* operator &() const { return &self; }
const LDKCVec_MonitorEventZ* operator ->() const { return &self; }
};
+class CVec_C2Tuple_u32ScriptZZ {
+private:
+ LDKCVec_C2Tuple_u32ScriptZZ self;
+public:
+ CVec_C2Tuple_u32ScriptZZ(const CVec_C2Tuple_u32ScriptZZ&) = delete;
+ CVec_C2Tuple_u32ScriptZZ(CVec_C2Tuple_u32ScriptZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_u32ScriptZZ)); }
+ CVec_C2Tuple_u32ScriptZZ(LDKCVec_C2Tuple_u32ScriptZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_u32ScriptZZ)); }
+ operator LDKCVec_C2Tuple_u32ScriptZZ() && { LDKCVec_C2Tuple_u32ScriptZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_u32ScriptZZ)); return res; }
+ ~CVec_C2Tuple_u32ScriptZZ() { CVec_C2Tuple_u32ScriptZZ_free(self); }
+ CVec_C2Tuple_u32ScriptZZ& operator=(CVec_C2Tuple_u32ScriptZZ&& o) { CVec_C2Tuple_u32ScriptZZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_C2Tuple_u32ScriptZZ)); return *this; }
+ LDKCVec_C2Tuple_u32ScriptZZ* operator &() { return &self; }
+ LDKCVec_C2Tuple_u32ScriptZZ* operator ->() { return &self; }
+ const LDKCVec_C2Tuple_u32ScriptZZ* operator &() const { return &self; }
+ const LDKCVec_C2Tuple_u32ScriptZZ* operator ->() const { return &self; }
+};
class CResult_NoneChannelMonitorUpdateErrZ {
private:
LDKCResult_NoneChannelMonitorUpdateErrZ self;
const LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* operator ->() const { return &self; }
};
+class C2Tuple_u32ScriptZ {
+private:
+ LDKC2Tuple_u32ScriptZ self;
+public:
+ C2Tuple_u32ScriptZ(const C2Tuple_u32ScriptZ&) = delete;
+ C2Tuple_u32ScriptZ(C2Tuple_u32ScriptZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_u32ScriptZ)); }
+ C2Tuple_u32ScriptZ(LDKC2Tuple_u32ScriptZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_u32ScriptZ)); }
+ operator LDKC2Tuple_u32ScriptZ() && { LDKC2Tuple_u32ScriptZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_u32ScriptZ)); return res; }
+ ~C2Tuple_u32ScriptZ() { C2Tuple_u32ScriptZ_free(self); }
+ C2Tuple_u32ScriptZ& operator=(C2Tuple_u32ScriptZ&& o) { C2Tuple_u32ScriptZ_free(self); self = o.self; memset(&o, 0, sizeof(C2Tuple_u32ScriptZ)); return *this; }
+ LDKC2Tuple_u32ScriptZ* operator &() { return &self; }
+ LDKC2Tuple_u32ScriptZ* operator ->() { return &self; }
+ const LDKC2Tuple_u32ScriptZ* operator &() const { return &self; }
+ const LDKC2Tuple_u32ScriptZ* operator ->() const { return &self; }
+};
class CResult_CResult_NetAddressu8ZDecodeErrorZ {
private:
LDKCResult_CResult_NetAddressu8ZDecodeErrorZ self;
typedef struct nativeNodeFeaturesOpaque LDKnativeNodeFeatures;
struct nativeChannelFeaturesOpaque;
typedef struct nativeChannelFeaturesOpaque LDKnativeChannelFeatures;
+struct nativeInvoiceFeaturesOpaque;
+typedef struct nativeInvoiceFeaturesOpaque LDKnativeInvoiceFeatures;
struct nativeChannelHandshakeConfigOpaque;
typedef struct nativeChannelHandshakeConfigOpaque LDKnativeChannelHandshakeConfig;
struct nativeChannelHandshakeLimitsOpaque;
}
}
#[repr(C)]
+pub union CResult_InvoiceFeaturesDecodeErrorZPtr {
+ pub result: *mut crate::ln::features::InvoiceFeatures,
+ pub err: *mut crate::ln::msgs::DecodeError,
+}
+#[repr(C)]
+pub struct CResult_InvoiceFeaturesDecodeErrorZ {
+ pub contents: CResult_InvoiceFeaturesDecodeErrorZPtr,
+ pub result_ok: bool,
+}
+#[no_mangle]
+pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_ok(o: crate::ln::features::InvoiceFeatures) -> CResult_InvoiceFeaturesDecodeErrorZ {
+ CResult_InvoiceFeaturesDecodeErrorZ {
+ contents: CResult_InvoiceFeaturesDecodeErrorZPtr {
+ result: Box::into_raw(Box::new(o)),
+ },
+ result_ok: true,
+ }
+}
+#[no_mangle]
+pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_InvoiceFeaturesDecodeErrorZ {
+ CResult_InvoiceFeaturesDecodeErrorZ {
+ contents: CResult_InvoiceFeaturesDecodeErrorZPtr {
+ err: Box::into_raw(Box::new(e)),
+ },
+ result_ok: false,
+ }
+}
+#[no_mangle]
+pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_free(_res: CResult_InvoiceFeaturesDecodeErrorZ) { }
+impl Drop for CResult_InvoiceFeaturesDecodeErrorZ {
+ fn drop(&mut self) {
+ if self.result_ok {
+ if unsafe { !(self.contents.result as *mut ()).is_null() } {
+ let _ = unsafe { Box::from_raw(self.contents.result) };
+ }
+ } else {
+ if unsafe { !(self.contents.err as *mut ()).is_null() } {
+ let _ = unsafe { Box::from_raw(self.contents.err) };
+ }
+ }
+ }
+}
+impl From<crate::c_types::CResultTempl<crate::ln::features::InvoiceFeatures, crate::ln::msgs::DecodeError>> for CResult_InvoiceFeaturesDecodeErrorZ {
+ fn from(mut o: crate::c_types::CResultTempl<crate::ln::features::InvoiceFeatures, crate::ln::msgs::DecodeError>) -> Self {
+ let contents = if o.result_ok {
+ let result = unsafe { o.contents.result };
+ unsafe { o.contents.result = std::ptr::null_mut() };
+ CResult_InvoiceFeaturesDecodeErrorZPtr { result }
+ } else {
+ let err = unsafe { o.contents.err };
+ unsafe { o.contents.err = std::ptr::null_mut(); }
+ CResult_InvoiceFeaturesDecodeErrorZPtr { err }
+ };
+ Self {
+ contents,
+ result_ok: o.result_ok,
+ }
+ }
+}
+#[repr(C)]
pub union CResult_ChannelConfigDecodeErrorZPtr {
pub result: *mut crate::util::config::ChannelConfig,
pub err: *mut crate::ln::msgs::DecodeError,
#[no_mangle]
pub extern "C" fn C2Tuple_OutPointScriptZ_free(_res: C2Tuple_OutPointScriptZ) { }
#[repr(C)]
+pub struct C2Tuple_u32ScriptZ {
+ pub a: u32,
+ pub b: crate::c_types::derived::CVec_u8Z,
+}
+impl From<(u32, crate::c_types::derived::CVec_u8Z)> for C2Tuple_u32ScriptZ {
+ fn from (tup: (u32, crate::c_types::derived::CVec_u8Z)) -> Self {
+ Self {
+ a: tup.0,
+ b: tup.1,
+ }
+ }
+}
+impl C2Tuple_u32ScriptZ {
+ #[allow(unused)] pub(crate) fn to_rust(mut self) -> (u32, crate::c_types::derived::CVec_u8Z) {
+ (self.a, self.b)
+ }
+}
+impl Clone for C2Tuple_u32ScriptZ {
+ fn clone(&self) -> Self {
+ Self {
+ a: self.a.clone(),
+ b: self.b.clone(),
+ }
+ }
+}
+#[no_mangle]
+pub extern "C" fn C2Tuple_u32ScriptZ_clone(orig: &C2Tuple_u32ScriptZ) -> C2Tuple_u32ScriptZ { orig.clone() }
+#[no_mangle]
+pub extern "C" fn C2Tuple_u32ScriptZ_new(a: u32, b: crate::c_types::derived::CVec_u8Z) -> C2Tuple_u32ScriptZ {
+ C2Tuple_u32ScriptZ { a, b, }
+}
+
+#[no_mangle]
+pub extern "C" fn C2Tuple_u32ScriptZ_free(_res: C2Tuple_u32ScriptZ) { }
+#[repr(C)]
+pub struct CVec_C2Tuple_u32ScriptZZ {
+ pub data: *mut crate::c_types::derived::C2Tuple_u32ScriptZ,
+ pub datalen: usize
+}
+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();
+ 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) }
+ }
+}
+impl From<Vec<crate::c_types::derived::C2Tuple_u32ScriptZ>> for CVec_C2Tuple_u32ScriptZZ {
+ fn from(v: Vec<crate::c_types::derived::C2Tuple_u32ScriptZ>) -> Self {
+ let datalen = v.len();
+ let data = Box::into_raw(v.into_boxed_slice());
+ Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
+ }
+}
+#[no_mangle]
+pub extern "C" fn CVec_C2Tuple_u32ScriptZZ_free(_res: 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)) };
+ }
+}
+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) });
+ Self::from(res)
+ }
+}
+#[repr(C)]
+pub struct C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
+ pub a: crate::c_types::ThirtyTwoBytes,
+ pub b: crate::c_types::derived::CVec_C2Tuple_u32ScriptZZ,
+}
+impl From<(crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32ScriptZZ)> for C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
+ fn from (tup: (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32ScriptZZ)) -> Self {
+ Self {
+ a: tup.0,
+ b: tup.1,
+ }
+ }
+}
+impl C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
+ #[allow(unused)] pub(crate) fn to_rust(mut self) -> (crate::c_types::ThirtyTwoBytes, crate::c_types::derived::CVec_C2Tuple_u32ScriptZZ) {
+ (self.a, self.b)
+ }
+}
+#[no_mangle]
+pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_C2Tuple_u32ScriptZZ) -> C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
+ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ { a, b, }
+}
+
+#[no_mangle]
+pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) { }
+#[repr(C)]
+pub struct CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
+ pub data: *mut crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ,
+ pub datalen: usize
+}
+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();
+ 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) }
+ }
+}
+impl From<Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ>> for CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
+ fn from(v: Vec<crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ>) -> Self {
+ let datalen = v.len();
+ let data = Box::into_raw(v.into_boxed_slice());
+ Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
+ }
+}
+#[no_mangle]
+pub extern "C" fn CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res: 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)) };
+ }
+}
+#[repr(C)]
pub struct CVec_TransactionZ {
pub data: *mut crate::c_types::Transaction,
pub datalen: usize
/// An interface to send a transaction to the Bitcoin network.
#[repr(C)]
pub struct BroadcasterInterface {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Sends a transaction out to (hopefully) be mined.
pub broadcast_transaction: extern "C" fn (this_arg: *const c_void, tx: crate::c_types::Transaction),
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Sync for BroadcasterInterface {}
}
}
}
+/// Creates a copy of the ConfirmationTarget
#[no_mangle]
pub extern "C" fn ConfirmationTarget_clone(orig: &ConfirmationTarget) -> ConfirmationTarget {
orig.clone()
/// called from inside the library in response to chain events, P2P events, or timer events).
#[repr(C)]
pub struct FeeEstimator {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Gets estimated satoshis of fee required per 1000 Weight-Units.
///
/// * ceil(satoshis-per-kbyte / 4)
#[must_use]
pub get_est_sat_per_1000_weight: extern "C" fn (this_arg: *const c_void, confirmation_target: crate::chain::chaininterface::ConfirmationTarget) -> u32,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Sync for FeeEstimator {}
}
}
}
+/// Minimum relay fee as required by bitcoin network mempool policy.
#[no_mangle]
pub static MIN_RELAY_FEE_SAT_PER_1000_WEIGHT: u64 = lightning::chain::chaininterface::MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
#[must_use]
#[repr(C)]
pub struct ChainMonitor {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChainMonitor,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChainMonitor_free(this_ptr: ChainMonitor) { }
+pub extern "C" fn ChainMonitor_free(this_obj: ChainMonitor) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChainMonitor_free_void(this_ptr: *mut c_void) {
ret
}
}
+/// Constructs a new Watch which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ChainMonitor_as_Watch(this_arg: &ChainMonitor) -> crate::chain::Watch {
crate::chain::Watch {
ret
}
}
+/// Constructs a new EventsProvider which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ChainMonitor_as_EventsProvider(this_arg: &ChainMonitor) -> crate::util::events::EventsProvider {
crate::util::events::EventsProvider {
#[must_use]
#[repr(C)]
pub struct ChannelMonitorUpdate {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelMonitorUpdate,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelMonitorUpdate_free(this_ptr: ChannelMonitorUpdate) { }
+pub extern "C" fn ChannelMonitorUpdate_free(this_obj: ChannelMonitorUpdate) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelMonitorUpdate_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelMonitorUpdate)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelMonitorUpdate
pub extern "C" fn ChannelMonitorUpdate_clone(orig: &ChannelMonitorUpdate) -> ChannelMonitorUpdate {
orig.clone()
}
+/// If:
+/// (1) a channel has been force closed and
+/// (2) we receive a preimage from a forward link that allows us to spend an HTLC output on
+/// this channel's (the backward link's) broadcasted commitment transaction
+/// then we allow the `ChannelManager` to send a `ChannelMonitorUpdate` with this update ID,
+/// with the update providing said payment preimage. No other update types are allowed after
+/// force-close.
#[no_mangle]
pub static CLOSED_CHANNEL_UPDATE_ID: u64 = lightning::chain::channelmonitor::CLOSED_CHANNEL_UPDATE_ID;
#[no_mangle]
+/// Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
pub extern "C" fn ChannelMonitorUpdate_write(obj: &ChannelMonitorUpdate) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelMonitorUpdate) })
}
#[no_mangle]
+/// Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
pub extern "C" fn ChannelMonitorUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelMonitorUpdateDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::chain::channelmonitor::ChannelMonitorUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
}
}
}
+/// Creates a copy of the ChannelMonitorUpdateErr
#[no_mangle]
pub extern "C" fn ChannelMonitorUpdateErr_clone(orig: &ChannelMonitorUpdateErr) -> ChannelMonitorUpdateErr {
orig.clone()
#[must_use]
#[repr(C)]
pub struct MonitorUpdateError {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeMonitorUpdateError,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn MonitorUpdateError_free(this_ptr: MonitorUpdateError) { }
+pub extern "C" fn MonitorUpdateError_free(this_obj: MonitorUpdateError) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn MonitorUpdateError_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeMonitorUpdateError)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the MonitorUpdateError
pub extern "C" fn MonitorUpdateError_clone(orig: &MonitorUpdateError) -> MonitorUpdateError {
orig.clone()
}
}
}
}
+/// Frees any resources used by the MonitorEvent
#[no_mangle]
pub extern "C" fn MonitorEvent_free(this_ptr: MonitorEvent) { }
+/// Creates a copy of the MonitorEvent
#[no_mangle]
pub extern "C" fn MonitorEvent_clone(orig: &MonitorEvent) -> MonitorEvent {
orig.clone()
#[must_use]
#[repr(C)]
pub struct HTLCUpdate {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeHTLCUpdate,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn HTLCUpdate_free(this_ptr: HTLCUpdate) { }
+pub extern "C" fn HTLCUpdate_free(this_obj: HTLCUpdate) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn HTLCUpdate_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHTLCUpdate)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the HTLCUpdate
pub extern "C" fn HTLCUpdate_clone(orig: &HTLCUpdate) -> HTLCUpdate {
orig.clone()
}
#[no_mangle]
+/// Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
pub extern "C" fn HTLCUpdate_write(obj: &HTLCUpdate) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeHTLCUpdate) })
}
#[no_mangle]
+/// Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
pub extern "C" fn HTLCUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_HTLCUpdateDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::chain::channelmonitor::HTLCUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct ChannelMonitor {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelMonitor,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelMonitor_free(this_ptr: ChannelMonitor) { }
+pub extern "C" fn ChannelMonitor_free(this_obj: ChannelMonitor) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelMonitor_free_void(this_ptr: *mut c_void) {
}
}
#[no_mangle]
+/// Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
pub extern "C" fn ChannelMonitor_write(obj: &ChannelMonitor) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
local_ret
}
+/// Gets a list of txids, with their output scripts (in the order they appear in the
+/// transaction), which we must learn about spends of via block_connected().
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelMonitor_get_outputs_to_watch(this_arg: &ChannelMonitor) -> crate::c_types::derived::CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
+ let mut ret = unsafe { &*this_arg.inner }.get_outputs_to_watch();
+ let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { let (mut orig_ret_0_0, mut orig_ret_0_1) = item; let mut local_orig_ret_0_1 = Vec::new(); for mut item in orig_ret_0_1.drain(..) { local_orig_ret_0_1.push( { let (mut orig_orig_ret_0_1_0_0, mut orig_orig_ret_0_1_0_1) = item; let mut local_orig_ret_0_1_0 = (orig_orig_ret_0_1_0_0, orig_orig_ret_0_1_0_1.into_bytes().into()).into(); local_orig_ret_0_1_0 }); }; let mut local_ret_0 = (crate::c_types::ThirtyTwoBytes { data: orig_ret_0_0.into_inner() }, local_orig_ret_0_1.into()).into(); local_ret_0 }); };
+ local_ret.into()
+}
+
+/// Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
+/// calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
+/// have been registered.
+#[no_mangle]
+pub extern "C" fn ChannelMonitor_load_outputs_to_watch(this_arg: &ChannelMonitor, filter: &crate::chain::Filter) {
+ unsafe { &*this_arg.inner }.load_outputs_to_watch(filter)
+}
+
/// Get the list of HTLCs who's status has been updated on chain. This should be called by
/// ChannelManager via [`chain::Watch::release_pending_monitor_events`].
///
/// kept up-to-date.
#[repr(C)]
pub struct Persist {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Persist a new channel's data. The data can be stored any way you want, but
/// the identifier provided by Rust-Lightning is the channel's outpoint (and
/// [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
#[must_use]
pub update_persisted_channel: extern "C" fn (this_arg: *const c_void, id: crate::chain::transaction::OutPoint, update: &crate::chain::channelmonitor::ChannelMonitorUpdate, data: &crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for Persist {}
}
}
#[no_mangle]
+/// Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
pub extern "C" fn C2Tuple_BlockHashChannelMonitorZ_read(ser: crate::c_types::u8slice, arg: &crate::chain::keysinterface::KeysInterface) -> crate::c_types::derived::CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
let arg_conv = arg;
let res: Result<(bitcoin::hash_types::BlockHash, lightning::chain::channelmonitor::ChannelMonitor<crate::chain::keysinterface::Sign>), lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj_arg(ser, arg_conv);
#[must_use]
#[repr(C)]
pub struct DelayedPaymentOutputDescriptor {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeDelayedPaymentOutputDescriptor,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn DelayedPaymentOutputDescriptor_free(this_ptr: DelayedPaymentOutputDescriptor) { }
+pub extern "C" fn DelayedPaymentOutputDescriptor_free(this_obj: DelayedPaymentOutputDescriptor) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn DelayedPaymentOutputDescriptor_free_void(this_ptr: *mut c_void) {
pub extern "C" fn DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr: &mut DelayedPaymentOutputDescriptor, mut val: u64) {
unsafe { &mut *this_ptr.inner }.channel_value_satoshis = val;
}
+/// Constructs a new DelayedPaymentOutputDescriptor given each field
#[must_use]
#[no_mangle]
pub extern "C" fn DelayedPaymentOutputDescriptor_new(mut outpoint_arg: crate::chain::transaction::OutPoint, mut per_commitment_point_arg: crate::c_types::PublicKey, mut to_self_delay_arg: u16, mut output_arg: crate::c_types::TxOut, mut revocation_pubkey_arg: crate::c_types::PublicKey, mut channel_keys_id_arg: crate::c_types::ThirtyTwoBytes, mut channel_value_satoshis_arg: u64) -> DelayedPaymentOutputDescriptor {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDelayedPaymentOutputDescriptor)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the DelayedPaymentOutputDescriptor
pub extern "C" fn DelayedPaymentOutputDescriptor_clone(orig: &DelayedPaymentOutputDescriptor) -> DelayedPaymentOutputDescriptor {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct StaticPaymentOutputDescriptor {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeStaticPaymentOutputDescriptor,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn StaticPaymentOutputDescriptor_free(this_ptr: StaticPaymentOutputDescriptor) { }
+pub extern "C" fn StaticPaymentOutputDescriptor_free(this_obj: StaticPaymentOutputDescriptor) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn StaticPaymentOutputDescriptor_free_void(this_ptr: *mut c_void) {
pub extern "C" fn StaticPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr: &mut StaticPaymentOutputDescriptor, mut val: u64) {
unsafe { &mut *this_ptr.inner }.channel_value_satoshis = val;
}
+/// Constructs a new StaticPaymentOutputDescriptor given each field
#[must_use]
#[no_mangle]
pub extern "C" fn StaticPaymentOutputDescriptor_new(mut outpoint_arg: crate::chain::transaction::OutPoint, mut output_arg: crate::c_types::TxOut, mut channel_keys_id_arg: crate::c_types::ThirtyTwoBytes, mut channel_value_satoshis_arg: u64) -> StaticPaymentOutputDescriptor {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeStaticPaymentOutputDescriptor)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the StaticPaymentOutputDescriptor
pub extern "C" fn StaticPaymentOutputDescriptor_clone(orig: &StaticPaymentOutputDescriptor) -> StaticPaymentOutputDescriptor {
orig.clone()
}
/// These may include outputs from a transaction punishing our counterparty or claiming an HTLC
/// on-chain using the payment preimage or after it has timed out.
StaticOutput {
+ /// The outpoint which is spendable
outpoint: crate::chain::transaction::OutPoint,
+ /// The output which is referenced by the given outpoint.
output: crate::c_types::TxOut,
},
/// An output to a P2WSH script which can be spent with a single signature after a CSV delay.
}
}
}
+/// Frees any resources used by the SpendableOutputDescriptor
#[no_mangle]
pub extern "C" fn SpendableOutputDescriptor_free(this_ptr: SpendableOutputDescriptor) { }
+/// Creates a copy of the SpendableOutputDescriptor
#[no_mangle]
pub extern "C" fn SpendableOutputDescriptor_clone(orig: &SpendableOutputDescriptor) -> SpendableOutputDescriptor {
orig.clone()
}
#[no_mangle]
+/// Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
pub extern "C" fn SpendableOutputDescriptor_write(obj: &SpendableOutputDescriptor) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(&unsafe { &*obj }.to_native())
}
#[no_mangle]
+/// Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
pub extern "C" fn SpendableOutputDescriptor_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_SpendableOutputDescriptorDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::chain::keysinterface::SpendableOutputDescriptor::native_into(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
/// of LN security model, orthogonal of key management issues.
#[repr(C)]
pub struct Sign {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Gets the per-commitment point for a specific commitment number
///
///
/// Will be called before any signatures are applied.
pub ready_channel: extern "C" fn (this_arg: *mut c_void, channel_parameters: &crate::ln::chan_utils::ChannelTransactionParameters),
+ /// Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
+ /// Note that the ultimate copy of the Sign will have all function pointers the same as the original.
+ /// May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
pub clone: Option<extern "C" fn (this_arg: *const c_void) -> *mut c_void>,
+ /// Serialize the object into a byte array
pub write: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_u8Z,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for Sign {}
#[no_mangle]
+/// Creates a copy of a Sign
pub extern "C" fn Sign_clone(orig: &Sign) -> Sign {
Sign {
this_arg: if let Some(f) = orig.clone { (f)(orig.this_arg) } else { orig.this_arg },
/// A trait to describe an object which can get user secrets and key material.
#[repr(C)]
pub struct KeysInterface {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Get node secret key (aka node_id or network_key).
///
/// you've read all of the provided bytes to ensure no corruption occurred.
#[must_use]
pub read_chan_signer: extern "C" fn (this_arg: *const c_void, reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_SignDecodeErrorZ,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for KeysInterface {}
#[must_use]
#[repr(C)]
pub struct InMemorySigner {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeInMemorySigner,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn InMemorySigner_free(this_ptr: InMemorySigner) { }
+pub extern "C" fn InMemorySigner_free(this_obj: InMemorySigner) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn InMemorySigner_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInMemorySigner)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the InMemorySigner
pub extern "C" fn InMemorySigner_clone(orig: &InMemorySigner) -> InMemorySigner {
orig.clone()
}
ret
}
}
+/// Constructs a new Sign which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
#[no_mangle]
pub extern "C" fn InMemorySigner_as_Sign(this_arg: &InMemorySigner) -> crate::chain::keysinterface::Sign {
crate::chain::keysinterface::Sign {
}
#[no_mangle]
+/// Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
pub extern "C" fn InMemorySigner_write(obj: &InMemorySigner) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInMemorySigner) })
}
#[no_mangle]
+/// Read a InMemorySigner from a byte array, created by InMemorySigner_write
pub extern "C" fn InMemorySigner_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InMemorySignerDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::chain::keysinterface::InMemorySigner { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct KeysManager {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeKeysManager,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn KeysManager_free(this_ptr: KeysManager) { }
+pub extern "C" fn KeysManager_free(this_obj: KeysManager) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn KeysManager_free_void(this_ptr: *mut c_void) {
ret
}
}
+/// Constructs a new KeysInterface which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
#[no_mangle]
pub extern "C" fn KeysManager_as_KeysInterface(this_arg: &KeysManager) -> crate::chain::keysinterface::KeysInterface {
crate::chain::keysinterface::KeysInterface {
}
}
}
+/// Creates a copy of the AccessError
#[no_mangle]
pub extern "C" fn AccessError_clone(orig: &AccessError) -> AccessError {
orig.clone()
/// UTXOs.
#[repr(C)]
pub struct Access {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
/// Returns an error if `genesis_hash` is for a different chain or if such a transaction output
/// [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
#[must_use]
pub get_utxo: extern "C" fn (this_arg: *const c_void, genesis_hash: *const [u8; 32], short_channel_id: u64) -> crate::c_types::derived::CResult_TxOutAccessErrorZ,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for Access {}
/// Useful when needing to replay chain data upon startup or as new chain events occur.
#[repr(C)]
pub struct Listen {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Notifies the listener that a block was added at the given height.
pub block_connected: extern "C" fn (this_arg: *const c_void, block: crate::c_types::u8slice, height: u32),
/// Notifies the listener that a block was removed at the given height.
pub block_disconnected: extern "C" fn (this_arg: *const c_void, header: *const [u8; 80], height: u32),
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
/// [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
#[repr(C)]
pub struct Watch {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Watches a channel identified by `funding_txo` using `monitor`.
///
/// events.
#[must_use]
pub release_pending_monitor_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MonitorEventZ,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for Watch {}
/// [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
#[repr(C)]
pub struct Filter {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
/// a spending condition.
/// Registers interest in spends of a transaction output identified by `outpoint` having
/// `script_pubkey` as the spending condition.
pub register_output: extern "C" fn (this_arg: *const c_void, outpoint: &crate::chain::transaction::OutPoint, script_pubkey: crate::c_types::u8slice),
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for Filter {}
#[must_use]
#[repr(C)]
pub struct OutPoint {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeOutPoint,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn OutPoint_free(this_ptr: OutPoint) { }
+pub extern "C" fn OutPoint_free(this_obj: OutPoint) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn OutPoint_free_void(this_ptr: *mut c_void) {
pub extern "C" fn OutPoint_set_index(this_ptr: &mut OutPoint, mut val: u16) {
unsafe { &mut *this_ptr.inner }.index = val;
}
+/// Constructs a new OutPoint given each field
#[must_use]
#[no_mangle]
pub extern "C" fn OutPoint_new(mut txid_arg: crate::c_types::ThirtyTwoBytes, mut index_arg: u16) -> OutPoint {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOutPoint)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the OutPoint
pub extern "C" fn OutPoint_clone(orig: &OutPoint) -> OutPoint {
orig.clone()
}
}
#[no_mangle]
+/// Serialize the OutPoint object into a byte array which can be read by OutPoint_read
pub extern "C" fn OutPoint_write(obj: &OutPoint) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeOutPoint) })
}
#[no_mangle]
+/// Read a OutPoint from a byte array, created by OutPoint_write
pub extern "C" fn OutPoint_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OutPointDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#![allow(unused_parens)]
#![allow(unused_unsafe)]
#![allow(unused_braces)]
+#![deny(missing_docs)]
mod c_types;
mod bitcoin;
pub mod util;
#[must_use]
#[repr(C)]
pub struct TxCreationKeys {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeTxCreationKeys,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn TxCreationKeys_free(this_ptr: TxCreationKeys) { }
+pub extern "C" fn TxCreationKeys_free(this_obj: TxCreationKeys) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn TxCreationKeys_free_void(this_ptr: *mut c_void) {
pub extern "C" fn TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr: &mut TxCreationKeys, mut val: crate::c_types::PublicKey) {
unsafe { &mut *this_ptr.inner }.broadcaster_delayed_payment_key = val.into_rust();
}
+/// Constructs a new TxCreationKeys given each field
#[must_use]
#[no_mangle]
pub extern "C" fn TxCreationKeys_new(mut per_commitment_point_arg: crate::c_types::PublicKey, mut revocation_key_arg: crate::c_types::PublicKey, mut broadcaster_htlc_key_arg: crate::c_types::PublicKey, mut countersignatory_htlc_key_arg: crate::c_types::PublicKey, mut broadcaster_delayed_payment_key_arg: crate::c_types::PublicKey) -> TxCreationKeys {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeTxCreationKeys)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the TxCreationKeys
pub extern "C" fn TxCreationKeys_clone(orig: &TxCreationKeys) -> TxCreationKeys {
orig.clone()
}
#[no_mangle]
+/// Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
pub extern "C" fn TxCreationKeys_write(obj: &TxCreationKeys) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeTxCreationKeys) })
}
#[no_mangle]
+/// Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
pub extern "C" fn TxCreationKeys_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_TxCreationKeysDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::TxCreationKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct ChannelPublicKeys {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelPublicKeys,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelPublicKeys_free(this_ptr: ChannelPublicKeys) { }
+pub extern "C" fn ChannelPublicKeys_free(this_obj: ChannelPublicKeys) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelPublicKeys_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ChannelPublicKeys_set_htlc_basepoint(this_ptr: &mut ChannelPublicKeys, mut val: crate::c_types::PublicKey) {
unsafe { &mut *this_ptr.inner }.htlc_basepoint = val.into_rust();
}
+/// Constructs a new ChannelPublicKeys given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelPublicKeys_new(mut funding_pubkey_arg: crate::c_types::PublicKey, mut revocation_basepoint_arg: crate::c_types::PublicKey, mut payment_point_arg: crate::c_types::PublicKey, mut delayed_payment_basepoint_arg: crate::c_types::PublicKey, mut htlc_basepoint_arg: crate::c_types::PublicKey) -> ChannelPublicKeys {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelPublicKeys)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelPublicKeys
pub extern "C" fn ChannelPublicKeys_clone(orig: &ChannelPublicKeys) -> ChannelPublicKeys {
orig.clone()
}
#[no_mangle]
+/// Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
pub extern "C" fn ChannelPublicKeys_write(obj: &ChannelPublicKeys) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelPublicKeys) })
}
#[no_mangle]
+/// Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
pub extern "C" fn ChannelPublicKeys_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelPublicKeysDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::ChannelPublicKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_ret
}
+/// The maximum length of a script returned by get_revokeable_redeemscript.
#[no_mangle]
pub static REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH: usize = lightning::ln::chan_utils::REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
#[must_use]
#[repr(C)]
pub struct HTLCOutputInCommitment {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeHTLCOutputInCommitment,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn HTLCOutputInCommitment_free(this_ptr: HTLCOutputInCommitment) { }
+pub extern "C" fn HTLCOutputInCommitment_free(this_obj: HTLCOutputInCommitment) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn HTLCOutputInCommitment_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHTLCOutputInCommitment)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the HTLCOutputInCommitment
pub extern "C" fn HTLCOutputInCommitment_clone(orig: &HTLCOutputInCommitment) -> HTLCOutputInCommitment {
orig.clone()
}
#[no_mangle]
+/// Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
pub extern "C" fn HTLCOutputInCommitment_write(obj: &HTLCOutputInCommitment) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeHTLCOutputInCommitment) })
}
#[no_mangle]
+/// Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
pub extern "C" fn HTLCOutputInCommitment_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_HTLCOutputInCommitmentDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::HTLCOutputInCommitment { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct ChannelTransactionParameters {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelTransactionParameters,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelTransactionParameters_free(this_ptr: ChannelTransactionParameters) { }
+pub extern "C" fn ChannelTransactionParameters_free(this_obj: ChannelTransactionParameters) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelTransactionParameters_free_void(this_ptr: *mut c_void) {
let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
unsafe { &mut *this_ptr.inner }.funding_outpoint = local_val;
}
+/// Constructs a new ChannelTransactionParameters given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelTransactionParameters_new(mut holder_pubkeys_arg: crate::ln::chan_utils::ChannelPublicKeys, mut holder_selected_contest_delay_arg: u16, mut is_outbound_from_holder_arg: bool, mut counterparty_parameters_arg: crate::ln::chan_utils::CounterpartyChannelTransactionParameters, mut funding_outpoint_arg: crate::chain::transaction::OutPoint) -> ChannelTransactionParameters {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTransactionParameters)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelTransactionParameters
pub extern "C" fn ChannelTransactionParameters_clone(orig: &ChannelTransactionParameters) -> ChannelTransactionParameters {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct CounterpartyChannelTransactionParameters {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeCounterpartyChannelTransactionParameters,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn CounterpartyChannelTransactionParameters_free(this_ptr: CounterpartyChannelTransactionParameters) { }
+pub extern "C" fn CounterpartyChannelTransactionParameters_free(this_obj: CounterpartyChannelTransactionParameters) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn CounterpartyChannelTransactionParameters_free_void(this_ptr: *mut c_void) {
pub extern "C" fn CounterpartyChannelTransactionParameters_set_selected_contest_delay(this_ptr: &mut CounterpartyChannelTransactionParameters, mut val: u16) {
unsafe { &mut *this_ptr.inner }.selected_contest_delay = val;
}
+/// Constructs a new CounterpartyChannelTransactionParameters given each field
#[must_use]
#[no_mangle]
pub extern "C" fn CounterpartyChannelTransactionParameters_new(mut pubkeys_arg: crate::ln::chan_utils::ChannelPublicKeys, mut selected_contest_delay_arg: u16) -> CounterpartyChannelTransactionParameters {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCounterpartyChannelTransactionParameters)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the CounterpartyChannelTransactionParameters
pub extern "C" fn CounterpartyChannelTransactionParameters_clone(orig: &CounterpartyChannelTransactionParameters) -> CounterpartyChannelTransactionParameters {
orig.clone()
}
}
#[no_mangle]
+/// Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
pub extern "C" fn CounterpartyChannelTransactionParameters_write(obj: &CounterpartyChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeCounterpartyChannelTransactionParameters) })
}
#[no_mangle]
+/// Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
pub extern "C" fn CounterpartyChannelTransactionParameters_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::CounterpartyChannelTransactionParameters { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
pub extern "C" fn ChannelTransactionParameters_write(obj: &ChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelTransactionParameters) })
}
#[no_mangle]
+/// Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
pub extern "C" fn ChannelTransactionParameters_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelTransactionParametersDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::ChannelTransactionParameters { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct DirectedChannelTransactionParameters {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeDirectedChannelTransactionParameters,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn DirectedChannelTransactionParameters_free(this_ptr: DirectedChannelTransactionParameters) { }
+pub extern "C" fn DirectedChannelTransactionParameters_free(this_obj: DirectedChannelTransactionParameters) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn DirectedChannelTransactionParameters_free_void(this_ptr: *mut c_void) {
#[must_use]
#[repr(C)]
pub struct HolderCommitmentTransaction {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeHolderCommitmentTransaction,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn HolderCommitmentTransaction_free(this_ptr: HolderCommitmentTransaction) { }
+pub extern "C" fn HolderCommitmentTransaction_free(this_obj: HolderCommitmentTransaction) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn HolderCommitmentTransaction_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHolderCommitmentTransaction)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the HolderCommitmentTransaction
pub extern "C" fn HolderCommitmentTransaction_clone(orig: &HolderCommitmentTransaction) -> HolderCommitmentTransaction {
orig.clone()
}
#[no_mangle]
+/// Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
pub extern "C" fn HolderCommitmentTransaction_write(obj: &HolderCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeHolderCommitmentTransaction) })
}
#[no_mangle]
+/// Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
pub extern "C" fn HolderCommitmentTransaction_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_HolderCommitmentTransactionDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::HolderCommitmentTransaction { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct BuiltCommitmentTransaction {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeBuiltCommitmentTransaction,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn BuiltCommitmentTransaction_free(this_ptr: BuiltCommitmentTransaction) { }
+pub extern "C" fn BuiltCommitmentTransaction_free(this_obj: BuiltCommitmentTransaction) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn BuiltCommitmentTransaction_free_void(this_ptr: *mut c_void) {
pub extern "C" fn BuiltCommitmentTransaction_set_txid(this_ptr: &mut BuiltCommitmentTransaction, mut val: crate::c_types::ThirtyTwoBytes) {
unsafe { &mut *this_ptr.inner }.txid = ::bitcoin::hash_types::Txid::from_slice(&val.data[..]).unwrap();
}
+/// Constructs a new BuiltCommitmentTransaction given each field
#[must_use]
#[no_mangle]
pub extern "C" fn BuiltCommitmentTransaction_new(mut transaction_arg: crate::c_types::Transaction, mut txid_arg: crate::c_types::ThirtyTwoBytes) -> BuiltCommitmentTransaction {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBuiltCommitmentTransaction)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the BuiltCommitmentTransaction
pub extern "C" fn BuiltCommitmentTransaction_clone(orig: &BuiltCommitmentTransaction) -> BuiltCommitmentTransaction {
orig.clone()
}
#[no_mangle]
+/// Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
pub extern "C" fn BuiltCommitmentTransaction_write(obj: &BuiltCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeBuiltCommitmentTransaction) })
}
#[no_mangle]
+/// Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
pub extern "C" fn BuiltCommitmentTransaction_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_BuiltCommitmentTransactionDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::BuiltCommitmentTransaction { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct CommitmentTransaction {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeCommitmentTransaction,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn CommitmentTransaction_free(this_ptr: CommitmentTransaction) { }
+pub extern "C" fn CommitmentTransaction_free(this_obj: CommitmentTransaction) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn CommitmentTransaction_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentTransaction)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the CommitmentTransaction
pub extern "C" fn CommitmentTransaction_clone(orig: &CommitmentTransaction) -> CommitmentTransaction {
orig.clone()
}
#[no_mangle]
+/// Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
pub extern "C" fn CommitmentTransaction_write(obj: &CommitmentTransaction) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeCommitmentTransaction) })
}
#[no_mangle]
+/// Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
pub extern "C" fn CommitmentTransaction_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CommitmentTransactionDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::CommitmentTransaction { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct TrustedCommitmentTransaction {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeTrustedCommitmentTransaction,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn TrustedCommitmentTransaction_free(this_ptr: TrustedCommitmentTransaction) { }
+pub extern "C" fn TrustedCommitmentTransaction_free(this_obj: TrustedCommitmentTransaction) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn TrustedCommitmentTransaction_free_void(this_ptr: *mut c_void) {
#[must_use]
#[repr(C)]
pub struct ChannelManager {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelManager,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelManager_free(this_ptr: ChannelManager) { }
+pub extern "C" fn ChannelManager_free(this_obj: ChannelManager) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelManager_free_void(this_ptr: *mut c_void) {
#[must_use]
#[repr(C)]
pub struct ChainParameters {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChainParameters,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChainParameters_free(this_ptr: ChainParameters) { }
+pub extern "C" fn ChainParameters_free(this_obj: ChainParameters) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChainParameters_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ChainParameters_set_latest_height(this_ptr: &mut ChainParameters, mut val: usize) {
unsafe { &mut *this_ptr.inner }.latest_height = val;
}
+/// Constructs a new ChainParameters given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChainParameters_new(mut network_arg: crate::bitcoin::network::Network, mut latest_hash_arg: crate::c_types::ThirtyTwoBytes, mut latest_height_arg: usize) -> ChainParameters {
#[must_use]
#[repr(C)]
pub struct ChannelDetails {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelDetails,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelDetails_free(this_ptr: ChannelDetails) { }
+pub extern "C" fn ChannelDetails_free(this_obj: ChannelDetails) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelDetails_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelDetails)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelDetails
pub extern "C" fn ChannelDetails_clone(orig: &ChannelDetails) -> ChannelDetails {
orig.clone()
}
}
}
}
+/// Frees any resources used by the PaymentSendFailure
#[no_mangle]
pub extern "C" fn PaymentSendFailure_free(this_ptr: PaymentSendFailure) { }
+/// Creates a copy of the PaymentSendFailure
#[no_mangle]
pub extern "C" fn PaymentSendFailure_clone(orig: &PaymentSendFailure) -> PaymentSendFailure {
orig.clone()
ret
}
}
+/// Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ChannelManager_as_MessageSendEventsProvider(this_arg: &ChannelManager) -> crate::util::events::MessageSendEventsProvider {
crate::util::events::MessageSendEventsProvider {
ret
}
}
+/// Constructs a new EventsProvider which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ChannelManager_as_EventsProvider(this_arg: &ChannelManager) -> crate::util::events::EventsProvider {
crate::util::events::EventsProvider {
ret
}
}
+/// Constructs a new Listen which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ChannelManager_as_Listen(this_arg: &ChannelManager) -> crate::chain::Listen {
crate::chain::Listen {
ret
}
}
+/// Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ChannelManager_as_ChannelMessageHandler(this_arg: &ChannelManager) -> crate::ln::msgs::ChannelMessageHandler {
crate::ln::msgs::ChannelMessageHandler {
}
#[no_mangle]
+/// Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
pub extern "C" fn ChannelManager_write(obj: &ChannelManager) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
#[must_use]
#[repr(C)]
pub struct ChannelManagerReadArgs {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelManagerReadArgs,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelManagerReadArgs_free(this_ptr: ChannelManagerReadArgs) { }
+pub extern "C" fn ChannelManagerReadArgs_free(this_obj: ChannelManagerReadArgs) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelManagerReadArgs_free_void(this_ptr: *mut c_void) {
}
#[no_mangle]
+/// Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
pub extern "C" fn C2Tuple_BlockHashChannelManagerZ_read(ser: crate::c_types::u8slice, arg: crate::ln::channelmanager::ChannelManagerReadArgs) -> crate::c_types::derived::CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
let arg_conv = *unsafe { Box::from_raw(arg.take_inner()) };
let res: Result<(bitcoin::hash_types::BlockHash, lightning::ln::channelmanager::ChannelManager<crate::chain::keysinterface::Sign, crate::chain::Watch, crate::chain::chaininterface::BroadcasterInterface, crate::chain::keysinterface::KeysInterface, crate::chain::chaininterface::FeeEstimator, crate::util::logger::Logger>), lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj_arg(ser, arg_conv);
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the InitFeatures
pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
orig.clone()
}
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the NodeFeatures
pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
orig.clone()
}
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelFeatures
pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
orig.clone()
}
+impl Clone for InvoiceFeatures {
+ fn clone(&self) -> Self {
+ Self {
+ inner: if <*mut nativeInvoiceFeatures>::is_null(self.inner) { std::ptr::null_mut() } else {
+ Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInvoiceFeatures)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the InvoiceFeatures
+pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
+ orig.clone()
+}
use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
type nativeInitFeatures = nativeInitFeaturesImport;
#[must_use]
#[repr(C)]
pub struct InitFeatures {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeInitFeatures,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn InitFeatures_free(this_ptr: InitFeatures) { }
+pub extern "C" fn InitFeatures_free(this_obj: InitFeatures) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn InitFeatures_free_void(this_ptr: *mut c_void) {
#[must_use]
#[repr(C)]
pub struct NodeFeatures {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeNodeFeatures,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn NodeFeatures_free(this_ptr: NodeFeatures) { }
+pub extern "C" fn NodeFeatures_free(this_obj: NodeFeatures) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn NodeFeatures_free_void(this_ptr: *mut c_void) {
#[must_use]
#[repr(C)]
pub struct ChannelFeatures {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelFeatures,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelFeatures_free(this_ptr: ChannelFeatures) { }
+pub extern "C" fn ChannelFeatures_free(this_obj: ChannelFeatures) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelFeatures_free_void(this_ptr: *mut c_void) {
ret
}
}
+
+use lightning::ln::features::InvoiceFeatures as nativeInvoiceFeaturesImport;
+type nativeInvoiceFeatures = nativeInvoiceFeaturesImport;
+
+/// Features used within an invoice.
+#[must_use]
+#[repr(C)]
+pub struct InvoiceFeatures {
+ /// A pointer to the opaque Rust object.
+
+ /// Nearly everywhere, inner must be non-null, however in places where
+ /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+ pub inner: *mut nativeInvoiceFeatures,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
+ pub is_owned: bool,
+}
+
+impl Drop for InvoiceFeatures {
+ fn drop(&mut self) {
+ if self.is_owned && !<*mut nativeInvoiceFeatures>::is_null(self.inner) {
+ let _ = unsafe { Box::from_raw(self.inner) };
+ }
+ }
+}
+/// Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn InvoiceFeatures_free(this_obj: InvoiceFeatures) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+extern "C" fn InvoiceFeatures_free_void(this_ptr: *mut c_void) {
+ unsafe { let _ = Box::from_raw(this_ptr as *mut nativeInvoiceFeatures); }
+}
+#[allow(unused)]
+/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+impl InvoiceFeatures {
+ pub(crate) fn take_inner(mut self) -> *mut nativeInvoiceFeatures {
+ assert!(self.is_owned);
+ let ret = self.inner;
+ self.inner = std::ptr::null_mut();
+ ret
+ }
+}
/// Create a blank Features with no features set
#[must_use]
#[no_mangle]
ChannelFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true }
}
+/// Create a blank Features with no features set
+#[must_use]
+#[no_mangle]
+pub extern "C" fn InvoiceFeatures_empty() -> InvoiceFeatures {
+ let mut ret = lightning::ln::features::InvoiceFeatures::empty();
+ InvoiceFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true }
+}
+
+/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
+///
+/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+#[must_use]
#[no_mangle]
+pub extern "C" fn InvoiceFeatures_known() -> InvoiceFeatures {
+ let mut ret = lightning::ln::features::InvoiceFeatures::known();
+ InvoiceFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true }
+}
+
+#[no_mangle]
+/// Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
pub extern "C" fn InitFeatures_write(obj: &InitFeatures) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
}
#[no_mangle]
+/// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
pub extern "C" fn NodeFeatures_write(obj: &NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
}
#[no_mangle]
+/// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
pub extern "C" fn ChannelFeatures_write(obj: &ChannelFeatures) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
}
#[no_mangle]
+/// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
+pub extern "C" fn InvoiceFeatures_write(obj: &InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
+ crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+ crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
+}
+#[no_mangle]
+/// Read a InitFeatures from a byte array, created by InitFeatures_write
pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::features::InitFeatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Read a NodeFeatures from a byte array, created by NodeFeatures_write
pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeFeaturesDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::features::NodeFeatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::features::ChannelFeatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
+#[no_mangle]
+/// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
+pub extern "C" fn InvoiceFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InvoiceFeaturesDecodeErrorZ {
+ let res = crate::c_types::deserialize_obj(ser);
+ let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::features::InvoiceFeatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+ local_res
+}
#[must_use]
#[repr(C)]
pub struct DecodeError {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeDecodeError,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn DecodeError_free(this_ptr: DecodeError) { }
+pub extern "C" fn DecodeError_free(this_obj: DecodeError) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn DecodeError_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDecodeError)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the DecodeError
pub extern "C" fn DecodeError_clone(orig: &DecodeError) -> DecodeError {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct Init {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeInit,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn Init_free(this_ptr: Init) { }
+pub extern "C" fn Init_free(this_obj: Init) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn Init_free_void(this_ptr: *mut c_void) {
pub extern "C" fn Init_set_features(this_ptr: &mut Init, mut val: crate::ln::features::InitFeatures) {
unsafe { &mut *this_ptr.inner }.features = *unsafe { Box::from_raw(val.take_inner()) };
}
+/// Constructs a new Init given each field
#[must_use]
#[no_mangle]
pub extern "C" fn Init_new(mut features_arg: crate::ln::features::InitFeatures) -> Init {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInit)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the Init
pub extern "C" fn Init_clone(orig: &Init) -> Init {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct ErrorMessage {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeErrorMessage,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ErrorMessage_free(this_ptr: ErrorMessage) { }
+pub extern "C" fn ErrorMessage_free(this_obj: ErrorMessage) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ErrorMessage_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ErrorMessage_set_data(this_ptr: &mut ErrorMessage, mut val: crate::c_types::derived::CVec_u8Z) {
unsafe { &mut *this_ptr.inner }.data = String::from_utf8(val.into_rust()).unwrap();
}
+/// Constructs a new ErrorMessage given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ErrorMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut data_arg: crate::c_types::derived::CVec_u8Z) -> ErrorMessage {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeErrorMessage)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ErrorMessage
pub extern "C" fn ErrorMessage_clone(orig: &ErrorMessage) -> ErrorMessage {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct Ping {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativePing,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn Ping_free(this_ptr: Ping) { }
+pub extern "C" fn Ping_free(this_obj: Ping) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn Ping_free_void(this_ptr: *mut c_void) {
pub extern "C" fn Ping_set_byteslen(this_ptr: &mut Ping, mut val: u16) {
unsafe { &mut *this_ptr.inner }.byteslen = val;
}
+/// Constructs a new Ping given each field
#[must_use]
#[no_mangle]
pub extern "C" fn Ping_new(mut ponglen_arg: u16, mut byteslen_arg: u16) -> Ping {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePing)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the Ping
pub extern "C" fn Ping_clone(orig: &Ping) -> Ping {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct Pong {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativePong,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn Pong_free(this_ptr: Pong) { }
+pub extern "C" fn Pong_free(this_obj: Pong) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn Pong_free_void(this_ptr: *mut c_void) {
pub extern "C" fn Pong_set_byteslen(this_ptr: &mut Pong, mut val: u16) {
unsafe { &mut *this_ptr.inner }.byteslen = val;
}
+/// Constructs a new Pong given each field
#[must_use]
#[no_mangle]
pub extern "C" fn Pong_new(mut byteslen_arg: u16) -> Pong {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePong)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the Pong
pub extern "C" fn Pong_clone(orig: &Pong) -> Pong {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct OpenChannel {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeOpenChannel,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn OpenChannel_free(this_ptr: OpenChannel) { }
+pub extern "C" fn OpenChannel_free(this_obj: OpenChannel) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn OpenChannel_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOpenChannel)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the OpenChannel
pub extern "C" fn OpenChannel_clone(orig: &OpenChannel) -> OpenChannel {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct AcceptChannel {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeAcceptChannel,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn AcceptChannel_free(this_ptr: AcceptChannel) { }
+pub extern "C" fn AcceptChannel_free(this_obj: AcceptChannel) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn AcceptChannel_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAcceptChannel)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the AcceptChannel
pub extern "C" fn AcceptChannel_clone(orig: &AcceptChannel) -> AcceptChannel {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct FundingCreated {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeFundingCreated,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn FundingCreated_free(this_ptr: FundingCreated) { }
+pub extern "C" fn FundingCreated_free(this_obj: FundingCreated) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn FundingCreated_free_void(this_ptr: *mut c_void) {
pub extern "C" fn FundingCreated_set_signature(this_ptr: &mut FundingCreated, mut val: crate::c_types::Signature) {
unsafe { &mut *this_ptr.inner }.signature = val.into_rust();
}
+/// Constructs a new FundingCreated given each field
#[must_use]
#[no_mangle]
pub extern "C" fn FundingCreated_new(mut temporary_channel_id_arg: crate::c_types::ThirtyTwoBytes, mut funding_txid_arg: crate::c_types::ThirtyTwoBytes, mut funding_output_index_arg: u16, mut signature_arg: crate::c_types::Signature) -> FundingCreated {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingCreated)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the FundingCreated
pub extern "C" fn FundingCreated_clone(orig: &FundingCreated) -> FundingCreated {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct FundingSigned {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeFundingSigned,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn FundingSigned_free(this_ptr: FundingSigned) { }
+pub extern "C" fn FundingSigned_free(this_obj: FundingSigned) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn FundingSigned_free_void(this_ptr: *mut c_void) {
pub extern "C" fn FundingSigned_set_signature(this_ptr: &mut FundingSigned, mut val: crate::c_types::Signature) {
unsafe { &mut *this_ptr.inner }.signature = val.into_rust();
}
+/// Constructs a new FundingSigned given each field
#[must_use]
#[no_mangle]
pub extern "C" fn FundingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut signature_arg: crate::c_types::Signature) -> FundingSigned {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingSigned)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the FundingSigned
pub extern "C" fn FundingSigned_clone(orig: &FundingSigned) -> FundingSigned {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct FundingLocked {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeFundingLocked,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn FundingLocked_free(this_ptr: FundingLocked) { }
+pub extern "C" fn FundingLocked_free(this_obj: FundingLocked) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn FundingLocked_free_void(this_ptr: *mut c_void) {
pub extern "C" fn FundingLocked_set_next_per_commitment_point(this_ptr: &mut FundingLocked, mut val: crate::c_types::PublicKey) {
unsafe { &mut *this_ptr.inner }.next_per_commitment_point = val.into_rust();
}
+/// Constructs a new FundingLocked given each field
#[must_use]
#[no_mangle]
pub extern "C" fn FundingLocked_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut next_per_commitment_point_arg: crate::c_types::PublicKey) -> FundingLocked {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingLocked)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the FundingLocked
pub extern "C" fn FundingLocked_clone(orig: &FundingLocked) -> FundingLocked {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct Shutdown {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeShutdown,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn Shutdown_free(this_ptr: Shutdown) { }
+pub extern "C" fn Shutdown_free(this_obj: Shutdown) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn Shutdown_free_void(this_ptr: *mut c_void) {
pub extern "C" fn Shutdown_set_scriptpubkey(this_ptr: &mut Shutdown, mut val: crate::c_types::derived::CVec_u8Z) {
unsafe { &mut *this_ptr.inner }.scriptpubkey = ::bitcoin::blockdata::script::Script::from(val.into_rust());
}
+/// Constructs a new Shutdown given each field
#[must_use]
#[no_mangle]
pub extern "C" fn Shutdown_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut scriptpubkey_arg: crate::c_types::derived::CVec_u8Z) -> Shutdown {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeShutdown)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the Shutdown
pub extern "C" fn Shutdown_clone(orig: &Shutdown) -> Shutdown {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct ClosingSigned {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeClosingSigned,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ClosingSigned_free(this_ptr: ClosingSigned) { }
+pub extern "C" fn ClosingSigned_free(this_obj: ClosingSigned) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ClosingSigned_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ClosingSigned_set_signature(this_ptr: &mut ClosingSigned, mut val: crate::c_types::Signature) {
unsafe { &mut *this_ptr.inner }.signature = val.into_rust();
}
+/// Constructs a new ClosingSigned given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ClosingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut fee_satoshis_arg: u64, mut signature_arg: crate::c_types::Signature) -> ClosingSigned {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeClosingSigned)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ClosingSigned
pub extern "C" fn ClosingSigned_clone(orig: &ClosingSigned) -> ClosingSigned {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct UpdateAddHTLC {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUpdateAddHTLC,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UpdateAddHTLC_free(this_ptr: UpdateAddHTLC) { }
+pub extern "C" fn UpdateAddHTLC_free(this_obj: UpdateAddHTLC) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UpdateAddHTLC_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateAddHTLC)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UpdateAddHTLC
pub extern "C" fn UpdateAddHTLC_clone(orig: &UpdateAddHTLC) -> UpdateAddHTLC {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct UpdateFulfillHTLC {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUpdateFulfillHTLC,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UpdateFulfillHTLC_free(this_ptr: UpdateFulfillHTLC) { }
+pub extern "C" fn UpdateFulfillHTLC_free(this_obj: UpdateFulfillHTLC) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UpdateFulfillHTLC_free_void(this_ptr: *mut c_void) {
pub extern "C" fn UpdateFulfillHTLC_set_payment_preimage(this_ptr: &mut UpdateFulfillHTLC, mut val: crate::c_types::ThirtyTwoBytes) {
unsafe { &mut *this_ptr.inner }.payment_preimage = ::lightning::ln::channelmanager::PaymentPreimage(val.data);
}
+/// Constructs a new UpdateFulfillHTLC given each field
#[must_use]
#[no_mangle]
pub extern "C" fn UpdateFulfillHTLC_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut htlc_id_arg: u64, mut payment_preimage_arg: crate::c_types::ThirtyTwoBytes) -> UpdateFulfillHTLC {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFulfillHTLC)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UpdateFulfillHTLC
pub extern "C" fn UpdateFulfillHTLC_clone(orig: &UpdateFulfillHTLC) -> UpdateFulfillHTLC {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct UpdateFailHTLC {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUpdateFailHTLC,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UpdateFailHTLC_free(this_ptr: UpdateFailHTLC) { }
+pub extern "C" fn UpdateFailHTLC_free(this_obj: UpdateFailHTLC) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UpdateFailHTLC_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailHTLC)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UpdateFailHTLC
pub extern "C" fn UpdateFailHTLC_clone(orig: &UpdateFailHTLC) -> UpdateFailHTLC {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct UpdateFailMalformedHTLC {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUpdateFailMalformedHTLC,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UpdateFailMalformedHTLC_free(this_ptr: UpdateFailMalformedHTLC) { }
+pub extern "C" fn UpdateFailMalformedHTLC_free(this_obj: UpdateFailMalformedHTLC) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UpdateFailMalformedHTLC_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailMalformedHTLC)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UpdateFailMalformedHTLC
pub extern "C" fn UpdateFailMalformedHTLC_clone(orig: &UpdateFailMalformedHTLC) -> UpdateFailMalformedHTLC {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct CommitmentSigned {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeCommitmentSigned,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn CommitmentSigned_free(this_ptr: CommitmentSigned) { }
+pub extern "C" fn CommitmentSigned_free(this_obj: CommitmentSigned) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn CommitmentSigned_free_void(this_ptr: *mut c_void) {
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_rust() }); };
unsafe { &mut *this_ptr.inner }.htlc_signatures = local_val;
}
+/// Constructs a new CommitmentSigned given each field
#[must_use]
#[no_mangle]
pub extern "C" fn CommitmentSigned_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut signature_arg: crate::c_types::Signature, mut htlc_signatures_arg: crate::c_types::derived::CVec_SignatureZ) -> CommitmentSigned {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentSigned)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the CommitmentSigned
pub extern "C" fn CommitmentSigned_clone(orig: &CommitmentSigned) -> CommitmentSigned {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct RevokeAndACK {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeRevokeAndACK,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn RevokeAndACK_free(this_ptr: RevokeAndACK) { }
+pub extern "C" fn RevokeAndACK_free(this_obj: RevokeAndACK) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn RevokeAndACK_free_void(this_ptr: *mut c_void) {
pub extern "C" fn RevokeAndACK_set_next_per_commitment_point(this_ptr: &mut RevokeAndACK, mut val: crate::c_types::PublicKey) {
unsafe { &mut *this_ptr.inner }.next_per_commitment_point = val.into_rust();
}
+/// Constructs a new RevokeAndACK given each field
#[must_use]
#[no_mangle]
pub extern "C" fn RevokeAndACK_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut per_commitment_secret_arg: crate::c_types::ThirtyTwoBytes, mut next_per_commitment_point_arg: crate::c_types::PublicKey) -> RevokeAndACK {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRevokeAndACK)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the RevokeAndACK
pub extern "C" fn RevokeAndACK_clone(orig: &RevokeAndACK) -> RevokeAndACK {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct UpdateFee {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUpdateFee,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UpdateFee_free(this_ptr: UpdateFee) { }
+pub extern "C" fn UpdateFee_free(this_obj: UpdateFee) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UpdateFee_free_void(this_ptr: *mut c_void) {
pub extern "C" fn UpdateFee_set_feerate_per_kw(this_ptr: &mut UpdateFee, mut val: u32) {
unsafe { &mut *this_ptr.inner }.feerate_per_kw = val;
}
+/// Constructs a new UpdateFee given each field
#[must_use]
#[no_mangle]
pub extern "C" fn UpdateFee_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut feerate_per_kw_arg: u32) -> UpdateFee {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFee)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UpdateFee
pub extern "C" fn UpdateFee_clone(orig: &UpdateFee) -> UpdateFee {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct DataLossProtect {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeDataLossProtect,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn DataLossProtect_free(this_ptr: DataLossProtect) { }
+pub extern "C" fn DataLossProtect_free(this_obj: DataLossProtect) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn DataLossProtect_free_void(this_ptr: *mut c_void) {
pub extern "C" fn DataLossProtect_set_my_current_per_commitment_point(this_ptr: &mut DataLossProtect, mut val: crate::c_types::PublicKey) {
unsafe { &mut *this_ptr.inner }.my_current_per_commitment_point = val.into_rust();
}
+/// Constructs a new DataLossProtect given each field
#[must_use]
#[no_mangle]
pub extern "C" fn DataLossProtect_new(mut your_last_per_commitment_secret_arg: crate::c_types::ThirtyTwoBytes, mut my_current_per_commitment_point_arg: crate::c_types::PublicKey) -> DataLossProtect {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDataLossProtect)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the DataLossProtect
pub extern "C" fn DataLossProtect_clone(orig: &DataLossProtect) -> DataLossProtect {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct ChannelReestablish {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelReestablish,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelReestablish_free(this_ptr: ChannelReestablish) { }
+pub extern "C" fn ChannelReestablish_free(this_obj: ChannelReestablish) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelReestablish_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelReestablish)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelReestablish
pub extern "C" fn ChannelReestablish_clone(orig: &ChannelReestablish) -> ChannelReestablish {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct AnnouncementSignatures {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeAnnouncementSignatures,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn AnnouncementSignatures_free(this_ptr: AnnouncementSignatures) { }
+pub extern "C" fn AnnouncementSignatures_free(this_obj: AnnouncementSignatures) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn AnnouncementSignatures_free_void(this_ptr: *mut c_void) {
pub extern "C" fn AnnouncementSignatures_set_bitcoin_signature(this_ptr: &mut AnnouncementSignatures, mut val: crate::c_types::Signature) {
unsafe { &mut *this_ptr.inner }.bitcoin_signature = val.into_rust();
}
+/// Constructs a new AnnouncementSignatures given each field
#[must_use]
#[no_mangle]
pub extern "C" fn AnnouncementSignatures_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut short_channel_id_arg: u64, mut node_signature_arg: crate::c_types::Signature, mut bitcoin_signature_arg: crate::c_types::Signature) -> AnnouncementSignatures {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAnnouncementSignatures)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the AnnouncementSignatures
pub extern "C" fn AnnouncementSignatures_clone(orig: &AnnouncementSignatures) -> AnnouncementSignatures {
orig.clone()
}
pub enum NetAddress {
/// An IPv4 address/port on which the peer is listening.
IPv4 {
+ /// The 4-byte IPv4 address
addr: crate::c_types::FourBytes,
+ /// The port on which the node is listening
port: u16,
},
/// An IPv6 address/port on which the peer is listening.
IPv6 {
+ /// The 16-byte IPv6 address
addr: crate::c_types::SixteenBytes,
+ /// The port on which the node is listening
port: u16,
},
/// An old-style Tor onion address/port on which the peer is listening.
OnionV2 {
+ /// The bytes (usually encoded in base32 with \".onion\" appended)
addr: crate::c_types::TenBytes,
+ /// The port on which the node is listening
port: u16,
},
/// A new-style Tor onion address/port on which the peer is listening.
/// To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
/// wrap as base32 and append \".onion\".
OnionV3 {
+ /// The ed25519 long-term public key of the peer
ed25519_pubkey: crate::c_types::ThirtyTwoBytes,
+ /// The checksum of the pubkey and version, as included in the onion address
checksum: u16,
+ /// The version byte, as defined by the Tor Onion v3 spec.
version: u8,
+ /// The port on which the node is listening
port: u16,
},
}
}
}
}
+/// Frees any resources used by the NetAddress
#[no_mangle]
pub extern "C" fn NetAddress_free(this_ptr: NetAddress) { }
+/// Creates a copy of the NetAddress
#[no_mangle]
pub extern "C" fn NetAddress_clone(orig: &NetAddress) -> NetAddress {
orig.clone()
}
#[no_mangle]
+/// Serialize the NetAddress object into a byte array which can be read by NetAddress_read
pub extern "C" fn NetAddress_write(obj: &NetAddress) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(&unsafe { &*obj }.to_native())
}
#[no_mangle]
+/// Read a Result from a byte array, created by Result_write
pub extern "C" fn Result_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CResult_NetAddressu8ZDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { let mut local_res_0 = match o { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::NetAddress::native_into(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { e }).into() }; local_res_0 }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct UnsignedNodeAnnouncement {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUnsignedNodeAnnouncement,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UnsignedNodeAnnouncement_free(this_ptr: UnsignedNodeAnnouncement) { }
+pub extern "C" fn UnsignedNodeAnnouncement_free(this_obj: UnsignedNodeAnnouncement) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UnsignedNodeAnnouncement_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedNodeAnnouncement)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UnsignedNodeAnnouncement
pub extern "C" fn UnsignedNodeAnnouncement_clone(orig: &UnsignedNodeAnnouncement) -> UnsignedNodeAnnouncement {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct NodeAnnouncement {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeNodeAnnouncement,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn NodeAnnouncement_free(this_ptr: NodeAnnouncement) { }
+pub extern "C" fn NodeAnnouncement_free(this_obj: NodeAnnouncement) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn NodeAnnouncement_free_void(this_ptr: *mut c_void) {
pub extern "C" fn NodeAnnouncement_set_contents(this_ptr: &mut NodeAnnouncement, mut val: crate::ln::msgs::UnsignedNodeAnnouncement) {
unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_inner()) };
}
+/// Constructs a new NodeAnnouncement given each field
#[must_use]
#[no_mangle]
pub extern "C" fn NodeAnnouncement_new(mut signature_arg: crate::c_types::Signature, mut contents_arg: crate::ln::msgs::UnsignedNodeAnnouncement) -> NodeAnnouncement {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncement)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the NodeAnnouncement
pub extern "C" fn NodeAnnouncement_clone(orig: &NodeAnnouncement) -> NodeAnnouncement {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct UnsignedChannelAnnouncement {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUnsignedChannelAnnouncement,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UnsignedChannelAnnouncement_free(this_ptr: UnsignedChannelAnnouncement) { }
+pub extern "C" fn UnsignedChannelAnnouncement_free(this_obj: UnsignedChannelAnnouncement) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UnsignedChannelAnnouncement_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelAnnouncement)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UnsignedChannelAnnouncement
pub extern "C" fn UnsignedChannelAnnouncement_clone(orig: &UnsignedChannelAnnouncement) -> UnsignedChannelAnnouncement {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct ChannelAnnouncement {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelAnnouncement,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelAnnouncement_free(this_ptr: ChannelAnnouncement) { }
+pub extern "C" fn ChannelAnnouncement_free(this_obj: ChannelAnnouncement) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelAnnouncement_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ChannelAnnouncement_set_contents(this_ptr: &mut ChannelAnnouncement, mut val: crate::ln::msgs::UnsignedChannelAnnouncement) {
unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_inner()) };
}
+/// Constructs a new ChannelAnnouncement given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelAnnouncement_new(mut node_signature_1_arg: crate::c_types::Signature, mut node_signature_2_arg: crate::c_types::Signature, mut bitcoin_signature_1_arg: crate::c_types::Signature, mut bitcoin_signature_2_arg: crate::c_types::Signature, mut contents_arg: crate::ln::msgs::UnsignedChannelAnnouncement) -> ChannelAnnouncement {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelAnnouncement)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelAnnouncement
pub extern "C" fn ChannelAnnouncement_clone(orig: &ChannelAnnouncement) -> ChannelAnnouncement {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct UnsignedChannelUpdate {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUnsignedChannelUpdate,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_free(this_ptr: UnsignedChannelUpdate) { }
+pub extern "C" fn UnsignedChannelUpdate_free(this_obj: UnsignedChannelUpdate) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UnsignedChannelUpdate_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelUpdate)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UnsignedChannelUpdate
pub extern "C" fn UnsignedChannelUpdate_clone(orig: &UnsignedChannelUpdate) -> UnsignedChannelUpdate {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct ChannelUpdate {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelUpdate,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelUpdate_free(this_ptr: ChannelUpdate) { }
+pub extern "C" fn ChannelUpdate_free(this_obj: ChannelUpdate) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelUpdate_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ChannelUpdate_set_contents(this_ptr: &mut ChannelUpdate, mut val: crate::ln::msgs::UnsignedChannelUpdate) {
unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_inner()) };
}
+/// Constructs a new ChannelUpdate given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelUpdate_new(mut signature_arg: crate::c_types::Signature, mut contents_arg: crate::ln::msgs::UnsignedChannelUpdate) -> ChannelUpdate {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelUpdate)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelUpdate
pub extern "C" fn ChannelUpdate_clone(orig: &ChannelUpdate) -> ChannelUpdate {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct QueryChannelRange {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeQueryChannelRange,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn QueryChannelRange_free(this_ptr: QueryChannelRange) { }
+pub extern "C" fn QueryChannelRange_free(this_obj: QueryChannelRange) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn QueryChannelRange_free_void(this_ptr: *mut c_void) {
pub extern "C" fn QueryChannelRange_set_number_of_blocks(this_ptr: &mut QueryChannelRange, mut val: u32) {
unsafe { &mut *this_ptr.inner }.number_of_blocks = val;
}
+/// Constructs a new QueryChannelRange given each field
#[must_use]
#[no_mangle]
pub extern "C" fn QueryChannelRange_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_blocknum_arg: u32, mut number_of_blocks_arg: u32) -> QueryChannelRange {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryChannelRange)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the QueryChannelRange
pub extern "C" fn QueryChannelRange_clone(orig: &QueryChannelRange) -> QueryChannelRange {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct ReplyChannelRange {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeReplyChannelRange,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ReplyChannelRange_free(this_ptr: ReplyChannelRange) { }
+pub extern "C" fn ReplyChannelRange_free(this_obj: ReplyChannelRange) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ReplyChannelRange_free_void(this_ptr: *mut c_void) {
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };
unsafe { &mut *this_ptr.inner }.short_channel_ids = local_val;
}
+/// Constructs a new ReplyChannelRange given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ReplyChannelRange_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_blocknum_arg: u32, mut number_of_blocks_arg: u32, mut sync_complete_arg: bool, mut short_channel_ids_arg: crate::c_types::derived::CVec_u64Z) -> ReplyChannelRange {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyChannelRange)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ReplyChannelRange
pub extern "C" fn ReplyChannelRange_clone(orig: &ReplyChannelRange) -> ReplyChannelRange {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct QueryShortChannelIds {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeQueryShortChannelIds,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn QueryShortChannelIds_free(this_ptr: QueryShortChannelIds) { }
+pub extern "C" fn QueryShortChannelIds_free(this_obj: QueryShortChannelIds) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn QueryShortChannelIds_free_void(this_ptr: *mut c_void) {
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };
unsafe { &mut *this_ptr.inner }.short_channel_ids = local_val;
}
+/// Constructs a new QueryShortChannelIds given each field
#[must_use]
#[no_mangle]
pub extern "C" fn QueryShortChannelIds_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut short_channel_ids_arg: crate::c_types::derived::CVec_u64Z) -> QueryShortChannelIds {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryShortChannelIds)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the QueryShortChannelIds
pub extern "C" fn QueryShortChannelIds_clone(orig: &QueryShortChannelIds) -> QueryShortChannelIds {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct ReplyShortChannelIdsEnd {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeReplyShortChannelIdsEnd,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ReplyShortChannelIdsEnd_free(this_ptr: ReplyShortChannelIdsEnd) { }
+pub extern "C" fn ReplyShortChannelIdsEnd_free(this_obj: ReplyShortChannelIdsEnd) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ReplyShortChannelIdsEnd_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ReplyShortChannelIdsEnd_set_full_information(this_ptr: &mut ReplyShortChannelIdsEnd, mut val: bool) {
unsafe { &mut *this_ptr.inner }.full_information = val;
}
+/// Constructs a new ReplyShortChannelIdsEnd given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ReplyShortChannelIdsEnd_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut full_information_arg: bool) -> ReplyShortChannelIdsEnd {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyShortChannelIdsEnd)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ReplyShortChannelIdsEnd
pub extern "C" fn ReplyShortChannelIdsEnd_clone(orig: &ReplyShortChannelIdsEnd) -> ReplyShortChannelIdsEnd {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct GossipTimestampFilter {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeGossipTimestampFilter,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn GossipTimestampFilter_free(this_ptr: GossipTimestampFilter) { }
+pub extern "C" fn GossipTimestampFilter_free(this_obj: GossipTimestampFilter) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn GossipTimestampFilter_free_void(this_ptr: *mut c_void) {
pub extern "C" fn GossipTimestampFilter_set_timestamp_range(this_ptr: &mut GossipTimestampFilter, mut val: u32) {
unsafe { &mut *this_ptr.inner }.timestamp_range = val;
}
+/// Constructs a new GossipTimestampFilter given each field
#[must_use]
#[no_mangle]
pub extern "C" fn GossipTimestampFilter_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_timestamp_arg: u32, mut timestamp_range_arg: u32) -> GossipTimestampFilter {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeGossipTimestampFilter)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the GossipTimestampFilter
pub extern "C" fn GossipTimestampFilter_clone(orig: &GossipTimestampFilter) -> GossipTimestampFilter {
orig.clone()
}
pub enum ErrorAction {
/// The peer took some action which made us think they were useless. Disconnect them.
DisconnectPeer {
+ /// An error message which we should make an effort to send before we disconnect.
msg: crate::ln::msgs::ErrorMessage,
},
/// The peer did something harmless that we weren't able to process, just log and ignore
IgnoreError,
/// The peer did something incorrect. Tell them.
SendErrorMessage {
+ /// The message to send.
msg: crate::ln::msgs::ErrorMessage,
},
}
}
}
}
+/// Frees any resources used by the ErrorAction
#[no_mangle]
pub extern "C" fn ErrorAction_free(this_ptr: ErrorAction) { }
+/// Creates a copy of the ErrorAction
#[no_mangle]
pub extern "C" fn ErrorAction_clone(orig: &ErrorAction) -> ErrorAction {
orig.clone()
#[must_use]
#[repr(C)]
pub struct LightningError {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeLightningError,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn LightningError_free(this_ptr: LightningError) { }
+pub extern "C" fn LightningError_free(this_obj: LightningError) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn LightningError_free_void(this_ptr: *mut c_void) {
pub extern "C" fn LightningError_set_action(this_ptr: &mut LightningError, mut val: crate::ln::msgs::ErrorAction) {
unsafe { &mut *this_ptr.inner }.action = val.into_native();
}
+/// Constructs a new LightningError given each field
#[must_use]
#[no_mangle]
pub extern "C" fn LightningError_new(mut err_arg: crate::c_types::derived::CVec_u8Z, mut action_arg: crate::ln::msgs::ErrorAction) -> LightningError {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeLightningError)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the LightningError
pub extern "C" fn LightningError_clone(orig: &LightningError) -> LightningError {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct CommitmentUpdate {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeCommitmentUpdate,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn CommitmentUpdate_free(this_ptr: CommitmentUpdate) { }
+pub extern "C" fn CommitmentUpdate_free(this_obj: CommitmentUpdate) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn CommitmentUpdate_free_void(this_ptr: *mut c_void) {
pub extern "C" fn CommitmentUpdate_set_commitment_signed(this_ptr: &mut CommitmentUpdate, mut val: crate::ln::msgs::CommitmentSigned) {
unsafe { &mut *this_ptr.inner }.commitment_signed = *unsafe { Box::from_raw(val.take_inner()) };
}
+/// Constructs a new CommitmentUpdate given each field
#[must_use]
#[no_mangle]
pub extern "C" fn CommitmentUpdate_new(mut update_add_htlcs_arg: crate::c_types::derived::CVec_UpdateAddHTLCZ, mut update_fulfill_htlcs_arg: crate::c_types::derived::CVec_UpdateFulfillHTLCZ, mut update_fail_htlcs_arg: crate::c_types::derived::CVec_UpdateFailHTLCZ, mut update_fail_malformed_htlcs_arg: crate::c_types::derived::CVec_UpdateFailMalformedHTLCZ, mut update_fee_arg: crate::ln::msgs::UpdateFee, mut commitment_signed_arg: crate::ln::msgs::CommitmentSigned) -> CommitmentUpdate {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentUpdate)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the CommitmentUpdate
pub extern "C" fn CommitmentUpdate_clone(orig: &CommitmentUpdate) -> CommitmentUpdate {
orig.clone()
}
pub enum HTLCFailChannelUpdate {
/// We received an error which included a full ChannelUpdate message.
ChannelUpdateMessage {
+ /// The unwrapped message we received
msg: crate::ln::msgs::ChannelUpdate,
},
/// We received an error which indicated only that a channel has been closed
ChannelClosed {
+ /// The short_channel_id which has now closed.
short_channel_id: u64,
+ /// when this true, this channel should be permanently removed from the
+ /// consideration. Otherwise, this channel can be restored as new channel_update is received
is_permanent: bool,
},
/// We received an error which indicated only that a node has failed
NodeFailure {
+ /// The node_id that has failed.
node_id: crate::c_types::PublicKey,
+ /// when this true, node should be permanently removed from the
+ /// consideration. Otherwise, the channels connected to this node can be
+ /// restored as new channel_update is received
is_permanent: bool,
},
}
}
}
}
+/// Frees any resources used by the HTLCFailChannelUpdate
#[no_mangle]
pub extern "C" fn HTLCFailChannelUpdate_free(this_ptr: HTLCFailChannelUpdate) { }
+/// Creates a copy of the HTLCFailChannelUpdate
#[no_mangle]
pub extern "C" fn HTLCFailChannelUpdate_clone(orig: &HTLCFailChannelUpdate) -> HTLCFailChannelUpdate {
orig.clone()
/// they MUST NOT be called in parallel when the two calls have the same their_node_id.
#[repr(C)]
pub struct ChannelMessageHandler {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Handle an incoming open_channel message from the given peer.
pub handle_open_channel: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, their_features: crate::ln::features::InitFeatures, msg: &crate::ln::msgs::OpenChannel),
pub handle_channel_reestablish: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelReestablish),
/// Handle an incoming error message from the given peer.
pub handle_error: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ErrorMessage),
+/// Implementation of MessageSendEventsProvider for this object.
pub MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
impl lightning::util::events::MessageSendEventsProvider for ChannelMessageHandler {
/// repeated disk I/O for queries accessing different parts of the network graph.
#[repr(C)]
pub struct RoutingMessageHandler {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Handle an incoming node_announcement message, returning true if it should be forwarded on,
/// false or returning an Err otherwise.
/// list of short_channel_ids.
#[must_use]
pub handle_query_short_channel_ids: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: crate::ln::msgs::QueryShortChannelIds) -> crate::c_types::derived::CResult_NoneLightningErrorZ,
+/// Implementation of MessageSendEventsProvider for this object.
pub MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for RoutingMessageHandler {}
}
}
#[no_mangle]
+/// Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
pub extern "C" fn AcceptChannel_write(obj: &AcceptChannel) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeAcceptChannel) })
}
#[no_mangle]
+/// Read a AcceptChannel from a byte array, created by AcceptChannel_write
pub extern "C" fn AcceptChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AcceptChannelDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::AcceptChannel { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
pub extern "C" fn AnnouncementSignatures_write(obj: &AnnouncementSignatures) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeAnnouncementSignatures) })
}
#[no_mangle]
+/// Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
pub extern "C" fn AnnouncementSignatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AnnouncementSignaturesDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::AnnouncementSignatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
pub extern "C" fn ChannelReestablish_write(obj: &ChannelReestablish) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelReestablish) })
}
#[no_mangle]
+/// Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
pub extern "C" fn ChannelReestablish_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelReestablishDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelReestablish { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
pub extern "C" fn ClosingSigned_write(obj: &ClosingSigned) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeClosingSigned) })
}
#[no_mangle]
+/// Read a ClosingSigned from a byte array, created by ClosingSigned_write
pub extern "C" fn ClosingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ClosingSignedDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ClosingSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
pub extern "C" fn CommitmentSigned_write(obj: &CommitmentSigned) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeCommitmentSigned) })
}
#[no_mangle]
+/// Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
pub extern "C" fn CommitmentSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CommitmentSignedDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::CommitmentSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
pub extern "C" fn FundingCreated_write(obj: &FundingCreated) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingCreated) })
}
#[no_mangle]
+/// Read a FundingCreated from a byte array, created by FundingCreated_write
pub extern "C" fn FundingCreated_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingCreatedDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingCreated { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
pub extern "C" fn FundingSigned_write(obj: &FundingSigned) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingSigned) })
}
#[no_mangle]
+/// Read a FundingSigned from a byte array, created by FundingSigned_write
pub extern "C" fn FundingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingSignedDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
pub extern "C" fn FundingLocked_write(obj: &FundingLocked) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingLocked) })
}
#[no_mangle]
+/// Read a FundingLocked from a byte array, created by FundingLocked_write
pub extern "C" fn FundingLocked_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingLockedDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingLocked { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the Init object into a byte array which can be read by Init_read
pub extern "C" fn Init_write(obj: &Init) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInit) })
}
#[no_mangle]
+/// Read a Init from a byte array, created by Init_write
pub extern "C" fn Init_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Init { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
pub extern "C" fn OpenChannel_write(obj: &OpenChannel) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeOpenChannel) })
}
#[no_mangle]
+/// Read a OpenChannel from a byte array, created by OpenChannel_write
pub extern "C" fn OpenChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OpenChannelDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::OpenChannel { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
pub extern "C" fn RevokeAndACK_write(obj: &RevokeAndACK) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeRevokeAndACK) })
}
#[no_mangle]
+/// Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
pub extern "C" fn RevokeAndACK_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RevokeAndACKDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::RevokeAndACK { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the Shutdown object into a byte array which can be read by Shutdown_read
pub extern "C" fn Shutdown_write(obj: &Shutdown) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeShutdown) })
}
#[no_mangle]
+/// Read a Shutdown from a byte array, created by Shutdown_write
pub extern "C" fn Shutdown_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ShutdownDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Shutdown { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
pub extern "C" fn UpdateFailHTLC_write(obj: &UpdateFailHTLC) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFailHTLC) })
}
#[no_mangle]
+/// Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
pub extern "C" fn UpdateFailHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailHTLCDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFailHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
pub extern "C" fn UpdateFailMalformedHTLC_write(obj: &UpdateFailMalformedHTLC) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFailMalformedHTLC) })
}
#[no_mangle]
+/// Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
pub extern "C" fn UpdateFailMalformedHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailMalformedHTLCDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFailMalformedHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
pub extern "C" fn UpdateFee_write(obj: &UpdateFee) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFee) })
}
#[no_mangle]
+/// Read a UpdateFee from a byte array, created by UpdateFee_write
pub extern "C" fn UpdateFee_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFeeDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFee { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
pub extern "C" fn UpdateFulfillHTLC_write(obj: &UpdateFulfillHTLC) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFulfillHTLC) })
}
#[no_mangle]
+/// Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
pub extern "C" fn UpdateFulfillHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFulfillHTLCDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFulfillHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
pub extern "C" fn UpdateAddHTLC_write(obj: &UpdateAddHTLC) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateAddHTLC) })
}
#[no_mangle]
+/// Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
pub extern "C" fn UpdateAddHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateAddHTLCDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateAddHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the Ping object into a byte array which can be read by Ping_read
pub extern "C" fn Ping_write(obj: &Ping) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativePing) })
}
#[no_mangle]
+/// Read a Ping from a byte array, created by Ping_write
pub extern "C" fn Ping_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_PingDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Ping { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the Pong object into a byte array which can be read by Pong_read
pub extern "C" fn Pong_write(obj: &Pong) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativePong) })
}
#[no_mangle]
+/// Read a Pong from a byte array, created by Pong_write
pub extern "C" fn Pong_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_PongDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Pong { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
pub extern "C" fn UnsignedChannelAnnouncement_write(obj: &UnsignedChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUnsignedChannelAnnouncement) })
}
#[no_mangle]
+/// Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
pub extern "C" fn UnsignedChannelAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedChannelAnnouncementDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UnsignedChannelAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
pub extern "C" fn ChannelAnnouncement_write(obj: &ChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelAnnouncement) })
}
#[no_mangle]
+/// Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
pub extern "C" fn ChannelAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelAnnouncementDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
pub extern "C" fn UnsignedChannelUpdate_write(obj: &UnsignedChannelUpdate) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUnsignedChannelUpdate) })
}
#[no_mangle]
+/// Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
pub extern "C" fn UnsignedChannelUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedChannelUpdateDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UnsignedChannelUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
pub extern "C" fn ChannelUpdate_write(obj: &ChannelUpdate) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelUpdate) })
}
#[no_mangle]
+/// Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
pub extern "C" fn ChannelUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelUpdateDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
pub extern "C" fn ErrorMessage_write(obj: &ErrorMessage) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeErrorMessage) })
}
#[no_mangle]
+/// Read a ErrorMessage from a byte array, created by ErrorMessage_write
pub extern "C" fn ErrorMessage_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ErrorMessageDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ErrorMessage { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
pub extern "C" fn UnsignedNodeAnnouncement_write(obj: &UnsignedNodeAnnouncement) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUnsignedNodeAnnouncement) })
}
#[no_mangle]
+/// Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
pub extern "C" fn UnsignedNodeAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedNodeAnnouncementDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UnsignedNodeAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
pub extern "C" fn NodeAnnouncement_write(obj: &NodeAnnouncement) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeAnnouncement) })
}
#[no_mangle]
+/// Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
pub extern "C" fn NodeAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeAnnouncementDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::NodeAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
pub extern "C" fn QueryShortChannelIds_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryShortChannelIdsDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
pub extern "C" fn QueryShortChannelIds_write(obj: &QueryShortChannelIds) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeQueryShortChannelIds) })
}
#[no_mangle]
+/// Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
pub extern "C" fn ReplyShortChannelIdsEnd_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ReplyShortChannelIdsEndDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
pub extern "C" fn ReplyShortChannelIdsEnd_write(obj: &ReplyShortChannelIdsEnd) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeReplyShortChannelIdsEnd) })
}
#[no_mangle]
+/// Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
pub extern "C" fn QueryChannelRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryChannelRangeDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::QueryChannelRange { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
pub extern "C" fn QueryChannelRange_write(obj: &QueryChannelRange) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeQueryChannelRange) })
}
#[no_mangle]
+/// Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
pub extern "C" fn ReplyChannelRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ReplyChannelRangeDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
pub extern "C" fn ReplyChannelRange_write(obj: &ReplyChannelRange) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeReplyChannelRange) })
}
#[no_mangle]
+/// Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
pub extern "C" fn GossipTimestampFilter_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_GossipTimestampFilterDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::GossipTimestampFilter { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
pub extern "C" fn GossipTimestampFilter_write(obj: &GossipTimestampFilter) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
#[must_use]
#[repr(C)]
pub struct IgnoringMessageHandler {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeIgnoringMessageHandler,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn IgnoringMessageHandler_free(this_ptr: IgnoringMessageHandler) { }
+pub extern "C" fn IgnoringMessageHandler_free(this_obj: IgnoringMessageHandler) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn IgnoringMessageHandler_free_void(this_ptr: *mut c_void) {
ret
}
}
+/// Constructs a new IgnoringMessageHandler given each field
#[must_use]
#[no_mangle]
pub extern "C" fn IgnoringMessageHandler_new() -> IgnoringMessageHandler {
ret
}
}
+/// Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
#[no_mangle]
pub extern "C" fn IgnoringMessageHandler_as_MessageSendEventsProvider(this_arg: &IgnoringMessageHandler) -> crate::util::events::MessageSendEventsProvider {
crate::util::events::MessageSendEventsProvider {
ret
}
}
+/// Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
#[no_mangle]
pub extern "C" fn IgnoringMessageHandler_as_RoutingMessageHandler(this_arg: &IgnoringMessageHandler) -> crate::ln::msgs::RoutingMessageHandler {
crate::ln::msgs::RoutingMessageHandler {
#[must_use]
#[repr(C)]
pub struct ErroringMessageHandler {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeErroringMessageHandler,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ErroringMessageHandler_free(this_ptr: ErroringMessageHandler) { }
+pub extern "C" fn ErroringMessageHandler_free(this_obj: ErroringMessageHandler) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ErroringMessageHandler_free_void(this_ptr: *mut c_void) {
ret
}
}
+/// Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ErroringMessageHandler_as_MessageSendEventsProvider(this_arg: &ErroringMessageHandler) -> crate::util::events::MessageSendEventsProvider {
crate::util::events::MessageSendEventsProvider {
ret
}
}
+/// Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
#[no_mangle]
pub extern "C" fn ErroringMessageHandler_as_ChannelMessageHandler(this_arg: &ErroringMessageHandler) -> crate::ln::msgs::ChannelMessageHandler {
crate::ln::msgs::ChannelMessageHandler {
#[must_use]
#[repr(C)]
pub struct MessageHandler {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeMessageHandler,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn MessageHandler_free(this_ptr: MessageHandler) { }
+pub extern "C" fn MessageHandler_free(this_obj: MessageHandler) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn MessageHandler_free_void(this_ptr: *mut c_void) {
pub extern "C" fn MessageHandler_set_route_handler(this_ptr: &mut MessageHandler, mut val: crate::ln::msgs::RoutingMessageHandler) {
unsafe { &mut *this_ptr.inner }.route_handler = val;
}
+/// Constructs a new MessageHandler given each field
#[must_use]
#[no_mangle]
pub extern "C" fn MessageHandler_new(mut chan_handler_arg: crate::ln::msgs::ChannelMessageHandler, mut route_handler_arg: crate::ln::msgs::RoutingMessageHandler) -> MessageHandler {
/// PeerManager::socket_disconnected().
#[repr(C)]
pub struct SocketDescriptor {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Attempts to send some data from the given slice to the peer.
///
/// though races may occur whereby disconnect_socket is called after a call to
/// socket_disconnected but prior to socket_disconnected returning.
pub disconnect_socket: extern "C" fn (this_arg: *mut c_void),
+ /// Checks if two objects are equal given this object's this_arg pointer and another object.
pub eq: extern "C" fn (this_arg: *const c_void, other_arg: &SocketDescriptor) -> bool,
+ /// Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
+ /// This is used, for example, for inclusion of this object in a hash map.
pub hash: extern "C" fn (this_arg: *const c_void) -> u64,
+ /// Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
+ /// Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
+ /// May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
pub clone: Option<extern "C" fn (this_arg: *const c_void) -> *mut c_void>,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
impl std::cmp::Eq for SocketDescriptor {}
fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) { hasher.write_u64((self.hash)(self.this_arg)) }
}
#[no_mangle]
+/// Creates a copy of a SocketDescriptor
pub extern "C" fn SocketDescriptor_clone(orig: &SocketDescriptor) -> SocketDescriptor {
SocketDescriptor {
this_arg: if let Some(f) = orig.clone { (f)(orig.this_arg) } else { orig.this_arg },
#[must_use]
#[repr(C)]
pub struct PeerHandleError {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativePeerHandleError,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn PeerHandleError_free(this_ptr: PeerHandleError) { }
+pub extern "C" fn PeerHandleError_free(this_obj: PeerHandleError) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn PeerHandleError_free_void(this_ptr: *mut c_void) {
pub extern "C" fn PeerHandleError_set_no_connection_possible(this_ptr: &mut PeerHandleError, mut val: bool) {
unsafe { &mut *this_ptr.inner }.no_connection_possible = val;
}
+/// Constructs a new PeerHandleError given each field
#[must_use]
#[no_mangle]
pub extern "C" fn PeerHandleError_new(mut no_connection_possible_arg: bool) -> PeerHandleError {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePeerHandleError)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the PeerHandleError
pub extern "C" fn PeerHandleError_clone(orig: &PeerHandleError) -> PeerHandleError {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct PeerManager {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativePeerManager,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn PeerManager_free(this_ptr: PeerManager) { }
+pub extern "C" fn PeerManager_free(this_obj: PeerManager) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn PeerManager_free_void(this_ptr: *mut c_void) {
#[must_use]
#[repr(C)]
pub struct NetworkGraph {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeNetworkGraph,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn NetworkGraph_free(this_ptr: NetworkGraph) { }
+pub extern "C" fn NetworkGraph_free(this_obj: NetworkGraph) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn NetworkGraph_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNetworkGraph)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the NetworkGraph
pub extern "C" fn NetworkGraph_clone(orig: &NetworkGraph) -> NetworkGraph {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct LockedNetworkGraph {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeLockedNetworkGraph,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn LockedNetworkGraph_free(this_ptr: LockedNetworkGraph) { }
+pub extern "C" fn LockedNetworkGraph_free(this_obj: LockedNetworkGraph) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn LockedNetworkGraph_free_void(this_ptr: *mut c_void) {
#[must_use]
#[repr(C)]
pub struct NetGraphMsgHandler {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeNetGraphMsgHandler,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn NetGraphMsgHandler_free(this_ptr: NetGraphMsgHandler) { }
+pub extern "C" fn NetGraphMsgHandler_free(this_obj: NetGraphMsgHandler) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn NetGraphMsgHandler_free_void(this_ptr: *mut c_void) {
ret
}
}
+/// Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
#[no_mangle]
pub extern "C" fn NetGraphMsgHandler_as_RoutingMessageHandler(this_arg: &NetGraphMsgHandler) -> crate::ln::msgs::RoutingMessageHandler {
crate::ln::msgs::RoutingMessageHandler {
ret
}
}
+/// Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+/// This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
#[no_mangle]
pub extern "C" fn NetGraphMsgHandler_as_MessageSendEventsProvider(this_arg: &NetGraphMsgHandler) -> crate::util::events::MessageSendEventsProvider {
crate::util::events::MessageSendEventsProvider {
#[must_use]
#[repr(C)]
pub struct DirectionalChannelInfo {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeDirectionalChannelInfo,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn DirectionalChannelInfo_free(this_ptr: DirectionalChannelInfo) { }
+pub extern "C" fn DirectionalChannelInfo_free(this_obj: DirectionalChannelInfo) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn DirectionalChannelInfo_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDirectionalChannelInfo)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the DirectionalChannelInfo
pub extern "C" fn DirectionalChannelInfo_clone(orig: &DirectionalChannelInfo) -> DirectionalChannelInfo {
orig.clone()
}
#[no_mangle]
+/// Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
pub extern "C" fn DirectionalChannelInfo_write(obj: &DirectionalChannelInfo) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeDirectionalChannelInfo) })
}
#[no_mangle]
+/// Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
pub extern "C" fn DirectionalChannelInfo_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_DirectionalChannelInfoDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::DirectionalChannelInfo { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct ChannelInfo {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelInfo,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelInfo_free(this_ptr: ChannelInfo) { }
+pub extern "C" fn ChannelInfo_free(this_obj: ChannelInfo) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelInfo_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelInfo)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelInfo
pub extern "C" fn ChannelInfo_clone(orig: &ChannelInfo) -> ChannelInfo {
orig.clone()
}
#[no_mangle]
+/// Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
pub extern "C" fn ChannelInfo_write(obj: &ChannelInfo) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelInfo) })
}
#[no_mangle]
+/// Read a ChannelInfo from a byte array, created by ChannelInfo_write
pub extern "C" fn ChannelInfo_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelInfoDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::ChannelInfo { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct RoutingFees {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeRoutingFees,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn RoutingFees_free(this_ptr: RoutingFees) { }
+pub extern "C" fn RoutingFees_free(this_obj: RoutingFees) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn RoutingFees_free_void(this_ptr: *mut c_void) {
pub extern "C" fn RoutingFees_set_proportional_millionths(this_ptr: &mut RoutingFees, mut val: u32) {
unsafe { &mut *this_ptr.inner }.proportional_millionths = val;
}
+/// Constructs a new RoutingFees given each field
#[must_use]
#[no_mangle]
pub extern "C" fn RoutingFees_new(mut base_msat_arg: u32, mut proportional_millionths_arg: u32) -> RoutingFees {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoutingFees)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the RoutingFees
pub extern "C" fn RoutingFees_clone(orig: &RoutingFees) -> RoutingFees {
orig.clone()
}
#[no_mangle]
+/// Read a RoutingFees from a byte array, created by RoutingFees_write
pub extern "C" fn RoutingFees_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RoutingFeesDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::RoutingFees { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
pub extern "C" fn RoutingFees_write(obj: &RoutingFees) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
#[must_use]
#[repr(C)]
pub struct NodeAnnouncementInfo {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeNodeAnnouncementInfo,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn NodeAnnouncementInfo_free(this_ptr: NodeAnnouncementInfo) { }
+pub extern "C" fn NodeAnnouncementInfo_free(this_obj: NodeAnnouncementInfo) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn NodeAnnouncementInfo_free_void(this_ptr: *mut c_void) {
let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
unsafe { &mut *this_ptr.inner }.announcement_message = local_val;
}
+/// Constructs a new NodeAnnouncementInfo given each field
#[must_use]
#[no_mangle]
pub extern "C" fn NodeAnnouncementInfo_new(mut features_arg: crate::ln::features::NodeFeatures, mut last_update_arg: u32, mut rgb_arg: crate::c_types::ThreeBytes, mut alias_arg: crate::c_types::ThirtyTwoBytes, mut addresses_arg: crate::c_types::derived::CVec_NetAddressZ, mut announcement_message_arg: crate::ln::msgs::NodeAnnouncement) -> NodeAnnouncementInfo {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncementInfo)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the NodeAnnouncementInfo
pub extern "C" fn NodeAnnouncementInfo_clone(orig: &NodeAnnouncementInfo) -> NodeAnnouncementInfo {
orig.clone()
}
#[no_mangle]
+/// Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
pub extern "C" fn NodeAnnouncementInfo_write(obj: &NodeAnnouncementInfo) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeAnnouncementInfo) })
}
#[no_mangle]
+/// Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
pub extern "C" fn NodeAnnouncementInfo_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeAnnouncementInfoDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::NodeAnnouncementInfo { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct NodeInfo {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeNodeInfo,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn NodeInfo_free(this_ptr: NodeInfo) { }
+pub extern "C" fn NodeInfo_free(this_obj: NodeInfo) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn NodeInfo_free_void(this_ptr: *mut c_void) {
let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
unsafe { &mut *this_ptr.inner }.announcement_info = local_val;
}
+/// Constructs a new NodeInfo given each field
#[must_use]
#[no_mangle]
pub extern "C" fn NodeInfo_new(mut channels_arg: crate::c_types::derived::CVec_u64Z, mut lowest_inbound_channel_fees_arg: crate::routing::network_graph::RoutingFees, mut announcement_info_arg: crate::routing::network_graph::NodeAnnouncementInfo) -> NodeInfo {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeInfo)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the NodeInfo
pub extern "C" fn NodeInfo_clone(orig: &NodeInfo) -> NodeInfo {
orig.clone()
}
#[no_mangle]
+/// Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
pub extern "C" fn NodeInfo_write(obj: &NodeInfo) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeInfo) })
}
#[no_mangle]
+/// Read a NodeInfo from a byte array, created by NodeInfo_write
pub extern "C" fn NodeInfo_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeInfoDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::NodeInfo { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
#[no_mangle]
+/// Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
pub extern "C" fn NetworkGraph_write(obj: &NetworkGraph) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNetworkGraph) })
}
#[no_mangle]
+/// Read a NetworkGraph from a byte array, created by NetworkGraph_write
pub extern "C" fn NetworkGraph_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NetworkGraphDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::network_graph::NetworkGraph { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct RouteHop {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeRouteHop,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn RouteHop_free(this_ptr: RouteHop) { }
+pub extern "C" fn RouteHop_free(this_obj: RouteHop) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn RouteHop_free_void(this_ptr: *mut c_void) {
pub extern "C" fn RouteHop_set_cltv_expiry_delta(this_ptr: &mut RouteHop, mut val: u32) {
unsafe { &mut *this_ptr.inner }.cltv_expiry_delta = val;
}
+/// Constructs a new RouteHop given each field
#[must_use]
#[no_mangle]
pub extern "C" fn RouteHop_new(mut pubkey_arg: crate::c_types::PublicKey, mut node_features_arg: crate::ln::features::NodeFeatures, mut short_channel_id_arg: u64, mut channel_features_arg: crate::ln::features::ChannelFeatures, mut fee_msat_arg: u64, mut cltv_expiry_delta_arg: u32) -> RouteHop {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHop)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the RouteHop
pub extern "C" fn RouteHop_clone(orig: &RouteHop) -> RouteHop {
orig.clone()
}
#[must_use]
#[repr(C)]
pub struct Route {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeRoute,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn Route_free(this_ptr: Route) { }
+pub extern "C" fn Route_free(this_obj: Route) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn Route_free_void(this_ptr: *mut c_void) {
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { let mut local_val_0 = Vec::new(); for mut item in item.into_rust().drain(..) { local_val_0.push( { *unsafe { Box::from_raw(item.take_inner()) } }); }; local_val_0 }); };
unsafe { &mut *this_ptr.inner }.paths = local_val;
}
+/// Constructs a new Route given each field
#[must_use]
#[no_mangle]
pub extern "C" fn Route_new(mut paths_arg: crate::c_types::derived::CVec_CVec_RouteHopZZ) -> Route {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoute)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the Route
pub extern "C" fn Route_clone(orig: &Route) -> Route {
orig.clone()
}
#[no_mangle]
+/// Serialize the Route object into a byte array which can be read by Route_read
pub extern "C" fn Route_write(obj: &Route) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeRoute) })
}
#[no_mangle]
+/// Read a Route from a byte array, created by Route_write
pub extern "C" fn Route_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RouteDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::router::Route { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct RouteHint {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeRouteHint,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn RouteHint_free(this_ptr: RouteHint) { }
+pub extern "C" fn RouteHint_free(this_obj: RouteHint) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn RouteHint_free_void(this_ptr: *mut c_void) {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHint)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the RouteHint
pub extern "C" fn RouteHint_clone(orig: &RouteHint) -> RouteHint {
orig.clone()
}
/// Gets a route from us (payer) to the given target node (payee).
///
+/// If the payee provided features in their invoice, they should be provided via payee_features.
+/// Without this, MPP will only be used if the payee's features are available in the network graph.
+///
/// Extra routing hops between known nodes and the target will be used if they are included in
/// last_hops.
///
/// equal), however the enabled/disabled bit on such channels as well as the
/// htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
#[no_mangle]
-pub extern "C" fn get_route(mut our_node_id: crate::c_types::PublicKey, network: &crate::routing::network_graph::NetworkGraph, mut payee: crate::c_types::PublicKey, first_hops: *mut crate::c_types::derived::CVec_ChannelDetailsZ, mut last_hops: crate::c_types::derived::CVec_RouteHintZ, mut final_value_msat: u64, mut final_cltv: u32, mut logger: crate::util::logger::Logger) -> crate::c_types::derived::CResult_RouteLightningErrorZ {
+pub extern "C" fn get_route(mut our_node_id: crate::c_types::PublicKey, network: &crate::routing::network_graph::NetworkGraph, mut payee: crate::c_types::PublicKey, mut payee_features: crate::ln::features::InvoiceFeatures, first_hops: *mut crate::c_types::derived::CVec_ChannelDetailsZ, mut last_hops: crate::c_types::derived::CVec_RouteHintZ, mut final_value_msat: u64, mut final_cltv: u32, mut logger: crate::util::logger::Logger) -> crate::c_types::derived::CResult_RouteLightningErrorZ {
+ let mut local_payee_features = if payee_features.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(payee_features.take_inner()) } }) };
let mut local_first_hops_base = if first_hops == std::ptr::null_mut() { None } else { Some( { let mut local_first_hops_0 = Vec::new(); for mut item in unsafe { &mut *first_hops }.as_slice().iter() { local_first_hops_0.push( { unsafe { &*item.inner } }); }; local_first_hops_0 }) }; let mut local_first_hops = local_first_hops_base.as_ref().map(|a| &a[..]);
let mut local_last_hops = Vec::new(); for mut item in last_hops.as_slice().iter() { local_last_hops.push( { unsafe { &*item.inner } }); };
- let mut ret = lightning::routing::router::get_route(&our_node_id.into_rust(), unsafe { &*network.inner }, &payee.into_rust(), local_first_hops, &local_last_hops[..], final_value_msat, final_cltv, logger);
+ let mut ret = lightning::routing::router::get_route(&our_node_id.into_rust(), unsafe { &*network.inner }, &payee.into_rust(), local_payee_features, local_first_hops, &local_last_hops[..], final_value_msat, final_cltv, logger);
let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::routing::router::Route { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::LightningError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_ret
}
#[must_use]
#[repr(C)]
pub struct ChannelHandshakeConfig {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelHandshakeConfig,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelHandshakeConfig_free(this_ptr: ChannelHandshakeConfig) { }
+pub extern "C" fn ChannelHandshakeConfig_free(this_obj: ChannelHandshakeConfig) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelHandshakeConfig_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr: &mut ChannelHandshakeConfig, mut val: u64) {
unsafe { &mut *this_ptr.inner }.our_htlc_minimum_msat = val;
}
+/// Constructs a new ChannelHandshakeConfig given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelHandshakeConfig_new(mut minimum_depth_arg: u32, mut our_to_self_delay_arg: u16, mut our_htlc_minimum_msat_arg: u64) -> ChannelHandshakeConfig {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeConfig)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelHandshakeConfig
pub extern "C" fn ChannelHandshakeConfig_clone(orig: &ChannelHandshakeConfig) -> ChannelHandshakeConfig {
orig.clone()
}
+/// Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelHandshakeConfig_default() -> ChannelHandshakeConfig {
#[must_use]
#[repr(C)]
pub struct ChannelHandshakeLimits {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelHandshakeLimits,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelHandshakeLimits_free(this_ptr: ChannelHandshakeLimits) { }
+pub extern "C" fn ChannelHandshakeLimits_free(this_obj: ChannelHandshakeLimits) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelHandshakeLimits_free_void(this_ptr: *mut c_void) {
/// Not checking this value would be a security issue, as our peer would be able to set it to
/// max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
///
-/// Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
-/// so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
+/// Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+/// reduce the loss of having useless locked funds (if your peer accepts)
#[no_mangle]
pub extern "C" fn ChannelHandshakeLimits_get_their_to_self_delay(this_ptr: &ChannelHandshakeLimits) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.their_to_self_delay;
/// Not checking this value would be a security issue, as our peer would be able to set it to
/// max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
///
-/// Default value: MAX_LOCAL_BREAKDOWN_TIMEOUT (1008), which we also enforce as a maximum value
-/// so you can tweak config to reduce the loss of having useless locked funds (if your peer accepts)
+/// Default value: 2016, which we also enforce as a maximum value so you can tweak config to
+/// reduce the loss of having useless locked funds (if your peer accepts)
#[no_mangle]
pub extern "C" fn ChannelHandshakeLimits_set_their_to_self_delay(this_ptr: &mut ChannelHandshakeLimits, mut val: u16) {
unsafe { &mut *this_ptr.inner }.their_to_self_delay = val;
}
+/// Constructs a new ChannelHandshakeLimits given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelHandshakeLimits_new(mut min_funding_satoshis_arg: u64, mut max_htlc_minimum_msat_arg: u64, mut min_max_htlc_value_in_flight_msat_arg: u64, mut max_channel_reserve_satoshis_arg: u64, mut min_max_accepted_htlcs_arg: u16, mut min_dust_limit_satoshis_arg: u64, mut max_dust_limit_satoshis_arg: u64, mut max_minimum_depth_arg: u32, mut force_announced_channel_preference_arg: bool, mut their_to_self_delay_arg: u16) -> ChannelHandshakeLimits {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeLimits)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelHandshakeLimits
pub extern "C" fn ChannelHandshakeLimits_clone(orig: &ChannelHandshakeLimits) -> ChannelHandshakeLimits {
orig.clone()
}
+/// Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelHandshakeLimits_default() -> ChannelHandshakeLimits {
#[must_use]
#[repr(C)]
pub struct ChannelConfig {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeChannelConfig,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn ChannelConfig_free(this_ptr: ChannelConfig) { }
+pub extern "C" fn ChannelConfig_free(this_obj: ChannelConfig) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn ChannelConfig_free_void(this_ptr: *mut c_void) {
pub extern "C" fn ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr: &mut ChannelConfig, mut val: bool) {
unsafe { &mut *this_ptr.inner }.commit_upfront_shutdown_pubkey = val;
}
+/// Constructs a new ChannelConfig given each field
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelConfig_new(mut fee_proportional_millionths_arg: u32, mut announced_channel_arg: bool, mut commit_upfront_shutdown_pubkey_arg: bool) -> ChannelConfig {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelConfig)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the ChannelConfig
pub extern "C" fn ChannelConfig_clone(orig: &ChannelConfig) -> ChannelConfig {
orig.clone()
}
+/// Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
#[must_use]
#[no_mangle]
pub extern "C" fn ChannelConfig_default() -> ChannelConfig {
ChannelConfig { inner: Box::into_raw(Box::new(Default::default())), is_owned: true }
}
#[no_mangle]
+/// Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
pub extern "C" fn ChannelConfig_write(obj: &ChannelConfig) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
}
crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelConfig) })
}
#[no_mangle]
+/// Read a ChannelConfig from a byte array, created by ChannelConfig_write
pub extern "C" fn ChannelConfig_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelConfigDecodeErrorZ {
let res = crate::c_types::deserialize_obj(ser);
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::util::config::ChannelConfig { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
#[must_use]
#[repr(C)]
pub struct UserConfig {
+ /// A pointer to the opaque Rust object.
+
/// Nearly everywhere, inner must be non-null, however in places where
/// the Rust equivalent takes an Option, it may be set to null to indicate None.
pub inner: *mut nativeUserConfig,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
pub is_owned: bool,
}
}
}
}
+/// Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
#[no_mangle]
-pub extern "C" fn UserConfig_free(this_ptr: UserConfig) { }
+pub extern "C" fn UserConfig_free(this_obj: UserConfig) { }
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
extern "C" fn UserConfig_free_void(this_ptr: *mut c_void) {
pub extern "C" fn UserConfig_set_channel_options(this_ptr: &mut UserConfig, mut val: crate::util::config::ChannelConfig) {
unsafe { &mut *this_ptr.inner }.channel_options = *unsafe { Box::from_raw(val.take_inner()) };
}
+/// Constructs a new UserConfig given each field
#[must_use]
#[no_mangle]
pub extern "C" fn UserConfig_new(mut own_channel_config_arg: crate::util::config::ChannelHandshakeConfig, mut peer_channel_config_limits_arg: crate::util::config::ChannelHandshakeLimits, mut channel_options_arg: crate::util::config::ChannelConfig) -> UserConfig {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUserConfig)).clone() })) as *mut c_void
}
#[no_mangle]
+/// Creates a copy of the UserConfig
pub extern "C" fn UserConfig_clone(orig: &UserConfig) -> UserConfig {
orig.clone()
}
+/// Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
#[must_use]
#[no_mangle]
pub extern "C" fn UserConfig_default() -> UserConfig {
/// Indicates the API was wholly misused (see err for more). Cases where these can be returned
/// are documented, but generally indicates some precondition of a function was violated.
APIMisuseError {
+ /// A human-readable error message
err: crate::c_types::derived::CVec_u8Z,
},
/// Due to a high feerate, we were unable to complete the request.
/// For example, this may be returned if the feerate implies we cannot open a channel at the
/// requested value, but opening a larger channel would succeed.
FeeRateTooHigh {
+ /// A human-readable error message
err: crate::c_types::derived::CVec_u8Z,
+ /// The feerate which was too high.
feerate: u32,
},
/// A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
/// too-many-hops, etc).
RouteError {
+ /// A human-readable error message
err: crate::c_types::Str,
},
/// We were unable to complete the request as the Channel required to do so is unable to
/// complete the request (or was not found). This can take many forms, including disconnected
/// peer, channel at capacity, channel shutting down, etc.
ChannelUnavailable {
+ /// A human-readable error message
err: crate::c_types::derived::CVec_u8Z,
},
/// An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
}
}
}
+/// Frees any resources used by the APIError
#[no_mangle]
pub extern "C" fn APIError_free(this_ptr: APIError) { }
+/// Creates a copy of the APIError
#[no_mangle]
pub extern "C" fn APIError_clone(orig: &APIError) -> APIError {
orig.clone()
/// Note that *all inputs* in the funding transaction must spend SegWit outputs or your
/// counterparty can steal your funds!
FundingGenerationReady {
+ /// The random channel_id we picked which you'll need to pass into
+ /// ChannelManager::funding_transaction_generated.
temporary_channel_id: crate::c_types::ThirtyTwoBytes,
+ /// The value, in satoshis, that the output should have.
channel_value_satoshis: u64,
+ /// The script which should be used in the transaction output.
output_script: crate::c_types::derived::CVec_u8Z,
+ /// The value passed in to ChannelManager::create_channel
user_channel_id: u64,
},
/// Used to indicate that the client may now broadcast the funding transaction it created for a
/// channel. Broadcasting such a transaction prior to this event may lead to our counterparty
/// trivially stealing all funds in the funding transaction!
FundingBroadcastSafe {
+ /// The output, which was passed to ChannelManager::funding_transaction_generated, which is
+ /// now safe to broadcast.
funding_txo: crate::chain::transaction::OutPoint,
+ /// The value passed in to ChannelManager::create_channel
user_channel_id: u64,
},
/// Indicates we've received money! Just gotta dig out that payment preimage and feed it to
/// ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
/// automatically failed.
PaymentReceived {
+ /// The hash for which the preimage should be handed to the ChannelManager.
payment_hash: crate::c_types::ThirtyTwoBytes,
+ /// The \"payment secret\". This authenticates the sender to the recipient, preventing a
+ /// number of deanonymization attacks during the routing process.
+ /// As nodes upgrade, the invoices you provide should likely migrate to setting the
+ /// payment_secret feature to required, at which point you should fail_backwards any HTLCs
+ /// which have a None here.
+ /// Until then, however, values of None should be ignored, and only incorrect Some values
+ /// should result in an HTLC fail_backwards.
+ /// Note that, in any case, this value must be passed as-is to any fail or claim calls as
+ /// the HTLC index includes this value.
payment_secret: crate::c_types::ThirtyTwoBytes,
+ /// The value, in thousandths of a satoshi, that this payment is for. Note that you must
+ /// compare this to the expected value before accepting the payment (as otherwise you are
+ /// providing proof-of-payment for less than the value you expected!).
amt: u64,
},
/// Indicates an outbound payment we made succeeded (ie it made it all the way to its target
/// Note that duplicative PaymentSent Events may be generated - it is your responsibility to
/// deduplicate them by payment_preimage (which MUST be unique)!
PaymentSent {
+ /// The preimage to the hash given to ChannelManager::send_payment.
+ /// Note that this serves as a payment receipt, if you wish to have such a thing, you must
+ /// store it somehow!
payment_preimage: crate::c_types::ThirtyTwoBytes,
},
/// Indicates an outbound payment we made failed. Probably some intermediary node dropped
/// Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
/// deduplicate them by payment_hash (which MUST be unique)!
PaymentFailed {
+ /// The hash which was given to ChannelManager::send_payment.
payment_hash: crate::c_types::ThirtyTwoBytes,
+ /// Indicates the payment was rejected for some reason by the recipient. This implies that
+ /// the payment has failed, not just the route in question. If this is not set, you may
+ /// retry the payment via a different route.
rejected_by_dest: bool,
},
/// Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
/// time in the future.
PendingHTLCsForwardable {
+ /// The minimum amount of time that should be waited prior to calling
+ /// process_pending_htlc_forwards. To increase the effort required to correlate payments,
+ /// you should wait a random amount of time in roughly the range (now + time_forwardable,
+ /// now + 5*time_forwardable).
time_forwardable: u64,
},
/// Used to indicate that an output was generated on-chain which you should know how to spend.
/// counterparty spending them due to some kind of timeout. Thus, you need to store them
/// somewhere and spend them when you create on-chain transactions.
SpendableOutputs {
+ /// The outputs which you should store as spendable by you.
outputs: crate::c_types::derived::CVec_SpendableOutputDescriptorZ,
},
}
}
}
}
+/// Frees any resources used by the Event
#[no_mangle]
pub extern "C" fn Event_free(this_ptr: Event) { }
+/// Creates a copy of the Event
#[no_mangle]
pub extern "C" fn Event_clone(orig: &Event) -> Event {
orig.clone()
}
#[no_mangle]
+/// Serialize the Event object into a byte array which can be read by Event_read
pub extern "C" fn Event_write(obj: &Event) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(&unsafe { &*obj }.to_native())
}
/// Used to indicate that we've accepted a channel open and should send the accept_channel
/// message provided to the given peer.
SendAcceptChannel {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::AcceptChannel,
},
/// Used to indicate that we've initiated a channel open and should send the open_channel
/// message provided to the given peer.
SendOpenChannel {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::OpenChannel,
},
/// Used to indicate that a funding_created message should be sent to the peer with the given node_id.
SendFundingCreated {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::FundingCreated,
},
/// Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
SendFundingSigned {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::FundingSigned,
},
/// Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
SendFundingLocked {
+ /// The node_id of the node which should receive these message(s)
node_id: crate::c_types::PublicKey,
+ /// The funding_locked message which should be sent.
msg: crate::ln::msgs::FundingLocked,
},
/// Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
SendAnnouncementSignatures {
+ /// The node_id of the node which should receive these message(s)
node_id: crate::c_types::PublicKey,
+ /// The announcement_signatures message which should be sent.
msg: crate::ln::msgs::AnnouncementSignatures,
},
/// Used to indicate that a series of HTLC update messages, as well as a commitment_signed
/// message should be sent to the peer with the given node_id.
UpdateHTLCs {
+ /// The node_id of the node which should receive these message(s)
node_id: crate::c_types::PublicKey,
+ /// The update messages which should be sent. ALL messages in the struct should be sent!
updates: crate::ln::msgs::CommitmentUpdate,
},
/// Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
SendRevokeAndACK {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::RevokeAndACK,
},
/// Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
SendClosingSigned {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::ClosingSigned,
},
/// Used to indicate that a shutdown message should be sent to the peer with the given node_id.
SendShutdown {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::Shutdown,
},
/// Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
SendChannelReestablish {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The message which should be sent.
msg: crate::ln::msgs::ChannelReestablish,
},
/// Used to indicate that a channel_announcement and channel_update should be broadcast to all
/// node_announcement, including relevant feature flags which may be important for routing
/// through or to us.
BroadcastChannelAnnouncement {
+ /// The channel_announcement which should be sent.
msg: crate::ln::msgs::ChannelAnnouncement,
+ /// The followup channel_update which should be sent.
update_msg: crate::ln::msgs::ChannelUpdate,
},
/// Used to indicate that a node_announcement should be broadcast to all peers.
BroadcastNodeAnnouncement {
+ /// The node_announcement which should be sent.
msg: crate::ln::msgs::NodeAnnouncement,
},
/// Used to indicate that a channel_update should be broadcast to all peers.
BroadcastChannelUpdate {
+ /// The channel_update which should be sent.
msg: crate::ln::msgs::ChannelUpdate,
},
/// Broadcast an error downstream to be handled
HandleError {
+ /// The node_id of the node which should receive this message
node_id: crate::c_types::PublicKey,
+ /// The action which should be taken.
action: crate::ln::msgs::ErrorAction,
},
/// When a payment fails we may receive updates back from the hop where it failed. In such
/// cases this event is generated so that we can inform the network graph of this information.
PaymentFailureNetworkUpdate {
+ /// The channel/node update which should be sent to NetGraphMsgHandler
update: crate::ln::msgs::HTLCFailChannelUpdate,
},
/// Query a peer for channels with funding transaction UTXOs in a block range.
SendChannelRangeQuery {
+ /// The node_id of this message recipient
node_id: crate::c_types::PublicKey,
+ /// The query_channel_range which should be sent.
msg: crate::ln::msgs::QueryChannelRange,
},
/// Request routing gossip messages from a peer for a list of channels identified by
/// their short_channel_ids.
SendShortIdsQuery {
+ /// The node_id of this message recipient
node_id: crate::c_types::PublicKey,
+ /// The query_short_channel_ids which should be sent.
msg: crate::ln::msgs::QueryShortChannelIds,
},
}
}
}
}
+/// Frees any resources used by the MessageSendEvent
#[no_mangle]
pub extern "C" fn MessageSendEvent_free(this_ptr: MessageSendEvent) { }
+/// Creates a copy of the MessageSendEvent
#[no_mangle]
pub extern "C" fn MessageSendEvent_clone(orig: &MessageSendEvent) -> MessageSendEvent {
orig.clone()
/// A trait indicating an object may generate message send events
#[repr(C)]
pub struct MessageSendEventsProvider {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Gets the list of pending events which were generated by previous actions, clearing the list
/// in the process.
#[must_use]
pub get_and_clear_pending_msg_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MessageSendEventZ,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
/// A trait indicating an object may generate events
#[repr(C)]
pub struct EventsProvider {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Gets the list of pending events which were generated by previous actions, clearing the list
/// in the process.
#[must_use]
pub get_and_clear_pending_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_EventZ,
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
}
}
}
+/// Creates a copy of the Level
#[no_mangle]
pub extern "C" fn Level_clone(orig: &Level) -> Level {
orig.clone()
/// A trait encapsulating the operations required of a logger
#[repr(C)]
pub struct Logger {
+ /// An opaque pointer which is passed to your function implementations as an argument.
+ /// This has no meaning in the LDK, and can be NULL or any other value.
pub this_arg: *mut c_void,
/// Logs the `Record`
pub log: extern "C" fn (this_arg: *const c_void, record: *const std::os::raw::c_char),
+/// Frees any resources associated with this object given its this_arg pointer.
+/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Sync for Logger {}
+++ /dev/null
-/// Logging macro utilities.
-
-use std::ffi::c_void;
-use bitcoin::hashes::Hash;
-use crate::c_types::*;
-
pub mod events;
pub mod errors;
pub mod ser;
-pub mod macro_logger;
pub mod logger;
pub mod config;
use bitcoin::hashes::Hash;
use crate::c_types::*;
+/// serialization buffer size
#[no_mangle]
pub static MAX_BUF_SIZE: usize = lightning::util::ser::MAX_BUF_SIZE;