pub enum ChannelChange {
Status {
left: ChannelStatus,
right: ChannelStatus,
},
CurrentBalance {
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
CurrentBalance
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 ChannelChange
s
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.
Note that only some fields are tracked for changes, and therefore an empty vector returned
does not imply the two ChannelEntry
instances 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.