Struct ChannelInfo
pub struct ChannelInfo {
pub features: Features<ChannelContext>,
pub node_one: NodeId,
pub one_to_two: Option<ChannelUpdateInfo>,
pub node_two: NodeId,
pub two_to_one: Option<ChannelUpdateInfo>,
pub capacity_sats: Option<u64>,
pub announcement_message: Option<ChannelAnnouncement>,
/* private fields */
}
Expand description
Details about a channel (both directions). Received within a channel announcement.
Fields§
§features: Features<ChannelContext>
Protocol features of a channel communicated during its announcement
node_one: NodeId
Source node of the first direction of a channel
one_to_two: Option<ChannelUpdateInfo>
Details about the first direction of a channel
node_two: NodeId
Source node of the second direction of a channel
two_to_one: Option<ChannelUpdateInfo>
Details about the second direction of a channel
capacity_sats: Option<u64>
The channel capacity as seen on-chain, if chain lookup is available.
announcement_message: Option<ChannelAnnouncement>
An initial announcement of the channel Mostly redundant with the data we store in fields explicitly. Everything else is useful only for sending out for initial routing sync. Not stored if contains excess data to prevent DoS.
Implementations§
§impl ChannelInfo
impl ChannelInfo
pub fn as_directed_to(
&self,
target: &NodeId,
) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
pub fn as_directed_to( &self, target: &NodeId, ) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
Returns a DirectedChannelInfo
for the channel directed to the given target
from a
returned source
, or None
if target
is not one of the channel’s counterparties.
pub fn as_directed_from(
&self,
source: &NodeId,
) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
pub fn as_directed_from( &self, source: &NodeId, ) -> Option<(DirectedChannelInfo<'_>, &NodeId)>
Returns a DirectedChannelInfo
for the channel directed from the given source
to a
returned target
, or None
if source
is not one of the channel’s counterparties.
pub fn get_directional_info(
&self,
channel_flags: u8,
) -> Option<&ChannelUpdateInfo>
pub fn get_directional_info( &self, channel_flags: u8, ) -> Option<&ChannelUpdateInfo>
Returns a ChannelUpdateInfo
based on the direction implied by the channel_flag.
Trait Implementations§
§impl Clone for ChannelInfo
impl Clone for ChannelInfo
§fn clone(&self) -> ChannelInfo
fn clone(&self) -> ChannelInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ChannelInfo
impl Debug for ChannelInfo
§impl Display for ChannelInfo
impl Display for ChannelInfo
§impl PartialEq for ChannelInfo
impl PartialEq for ChannelInfo
§impl Readable for ChannelInfo
impl Readable for ChannelInfo
§fn read<R>(reader: &mut R) -> Result<ChannelInfo, DecodeError>where
R: Read,
fn read<R>(reader: &mut R) -> Result<ChannelInfo, DecodeError>where
R: Read,
Self
in from the given Read
.§impl Writeable for ChannelInfo
impl Writeable for ChannelInfo
impl Eq for ChannelInfo
impl StructuralPartialEq for ChannelInfo
Auto Trait Implementations§
impl Freeze for ChannelInfo
impl RefUnwindSafe for ChannelInfo
impl Send for ChannelInfo
impl Sync for ChannelInfo
impl Unpin for ChannelInfo
impl UnwindSafe for ChannelInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request