pub enum ChannelChange {
Status {
left: ChannelStatus,
right: ChannelStatus,
},
Balance {
left: HoprBalance,
right: HoprBalance,
},
Epoch {
left: u32,
right: u32,
},
TicketIndex {
left: u64,
right: u64,
},
}Expand description
Lists possible changes on a channel entry update
Variants§
Status
Channel status has changed
Balance
Channel balance has changed
Epoch
Channel epoch has changed
TicketIndex
Ticket index has changed
Implementations§
Source§impl ChannelChange
impl ChannelChange
Sourcepub fn diff_channels(left: &ChannelEntry, right: &ChannelEntry) -> Vec<Self>
pub fn diff_channels(left: &ChannelEntry, right: &ChannelEntry) -> Vec<Self>
Compares the two given channels and returns a vector of ChannelChanges.
Both channels must have the same ID (source, destination and direction) to be comparable using this function.
The function panics if left and right do not have equal ids.
If an empty vector is returned, it implies that both channels are equal.
Trait Implementations§
Source§impl Clone for ChannelChange
impl Clone for ChannelChange
Source§fn clone(&self) -> ChannelChange
fn clone(&self) -> ChannelChange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChannelChange
impl Debug for ChannelChange
Source§impl Display for ChannelChange
impl Display for ChannelChange
impl Copy for ChannelChange
Auto Trait Implementations§
impl Freeze for ChannelChange
impl RefUnwindSafe for ChannelChange
impl Send for ChannelChange
impl Sync for ChannelChange
impl Unpin for ChannelChange
impl UnwindSafe for ChannelChange
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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