Struct lightning_signer::channel::ChannelBalance
source · pub struct ChannelBalance {
pub claimable: u64,
pub received_htlc: u64,
pub offered_htlc: u64,
pub sweeping: u64,
pub channel_count: u32,
pub received_htlc_count: u32,
pub offered_htlc_count: u32,
}
Expand description
Balances associated with a channel See: https://gitlab.com/lightning-signer/docs/-/wikis/Proposed-L1-and-Channel-Balance-Reconciliation
Fields§
§claimable: u64
Claimable balance on open channel
received_htlc: u64
Sum of htlcs offered to us
offered_htlc: u64
Sum of htlcs we offered
sweeping: u64
Sweeping to wallet
channel_count: u32
Current number of channels
received_htlc_count: u32
Current number of received htlcs
offered_htlc_count: u32
Current number of offered htlcs
Implementations§
source§impl ChannelBalance
impl ChannelBalance
sourcepub fn new(
claimable: u64,
received_htlc: u64,
offered_htlc: u64,
sweeping: u64,
channel_count: u32,
received_htlc_count: u32,
offered_htlc_count: u32
) -> ChannelBalance
pub fn new( claimable: u64, received_htlc: u64, offered_htlc: u64, sweeping: u64, channel_count: u32, received_htlc_count: u32, offered_htlc_count: u32 ) -> ChannelBalance
Create a ChannelBalance with specific values
sourcepub fn zero() -> ChannelBalance
pub fn zero() -> ChannelBalance
Create a ChannelBalance with zero values
sourcepub fn accumulate(&mut self, other: &ChannelBalance)
pub fn accumulate(&mut self, other: &ChannelBalance)
Sum channel balances
Trait Implementations§
source§impl Debug for ChannelBalance
impl Debug for ChannelBalance
source§impl PartialEq for ChannelBalance
impl PartialEq for ChannelBalance
source§fn eq(&self, other: &ChannelBalance) -> bool
fn eq(&self, other: &ChannelBalance) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ChannelBalance
Auto Trait Implementations§
impl Freeze for ChannelBalance
impl RefUnwindSafe for ChannelBalance
impl Send for ChannelBalance
impl Sync for ChannelBalance
impl Unpin for ChannelBalance
impl UnwindSafe for ChannelBalance
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more