6 namespace org { namespace ldk { namespace structs {
10 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
12 public class ChannelUsage : CommonBase {
13 internal ChannelUsage(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.ChannelUsage_free(ptr); }
19 * The amount to send through the channel, denominated in millisatoshis.
21 public long get_amount_msat() {
22 long ret = bindings.ChannelUsage_get_amount_msat(this.ptr);
28 * The amount to send through the channel, denominated in millisatoshis.
30 public void set_amount_msat(long val) {
31 bindings.ChannelUsage_set_amount_msat(this.ptr, val);
37 * Total amount, denominated in millisatoshis, already allocated to send through the channel
38 * as part of a multi-path payment.
40 public long get_inflight_htlc_msat() {
41 long ret = bindings.ChannelUsage_get_inflight_htlc_msat(this.ptr);
47 * Total amount, denominated in millisatoshis, already allocated to send through the channel
48 * as part of a multi-path payment.
50 public void set_inflight_htlc_msat(long val) {
51 bindings.ChannelUsage_set_inflight_htlc_msat(this.ptr, val);
57 * The effective capacity of the channel.
59 public EffectiveCapacity get_effective_capacity() {
60 long ret = bindings.ChannelUsage_get_effective_capacity(this.ptr);
62 if (ret >= 0 && ret <= 4096) { return null; }
63 org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
64 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
69 * The effective capacity of the channel.
71 public void set_effective_capacity(org.ldk.structs.EffectiveCapacity val) {
72 bindings.ChannelUsage_set_effective_capacity(this.ptr, val.ptr);
78 * Constructs a new ChannelUsage given each field
80 public static ChannelUsage of(long amount_msat_arg, long inflight_htlc_msat_arg, org.ldk.structs.EffectiveCapacity effective_capacity_arg) {
81 long ret = bindings.ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg.ptr);
82 GC.KeepAlive(amount_msat_arg);
83 GC.KeepAlive(inflight_htlc_msat_arg);
84 GC.KeepAlive(effective_capacity_arg);
85 if (ret >= 0 && ret <= 4096) { return null; }
86 org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); }
87 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
91 internal long clone_ptr() {
92 long ret = bindings.ChannelUsage_clone_ptr(this.ptr);
98 * Creates a copy of the ChannelUsage
100 public ChannelUsage clone() {
101 long ret = bindings.ChannelUsage_clone(this.ptr);
103 if (ret >= 0 && ret <= 4096) { return null; }
104 org.ldk.structs.ChannelUsage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUsage(null, ret); }
105 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };