#[repr(C, align(128))]pub struct ChannelInfo {
pub features: ChannelFeatures,
pub node_one: NodeId,
pub node_two: NodeId,
pub capacity_sats: Option<u64>,
pub one_to_two: Option<ChannelUpdateInfo>,
pub two_to_one: Option<ChannelUpdateInfo>,
pub announcement_message: Option<ChannelAnnouncement>,
/* private fields */
}Expand description
Details about a channel (both directions). Received within a channel announcement.
Fields§
§features: ChannelFeaturesProtocol features of a channel communicated during its announcement
node_one: NodeIdSource node of the first direction of a channel
node_two: NodeIdSource node of the second direction of a channel
capacity_sats: Option<u64>The channel capacity as seen on-chain, if chain lookup is available.
one_to_two: Option<ChannelUpdateInfo>Details about the first direction of a channel
two_to_one: Option<ChannelUpdateInfo>Details about the second direction of a channel
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§
Source§impl ChannelInfo
impl ChannelInfo
Sourcepub 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.
Sourcepub 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.
Sourcepub 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§
Source§impl Clone for ChannelInfo
impl Clone for ChannelInfo
Source§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 moreSource§impl Debug for ChannelInfo
impl Debug for ChannelInfo
Source§impl Display for ChannelInfo
impl Display for ChannelInfo
Source§impl PartialEq for ChannelInfo
impl PartialEq for ChannelInfo
Source§impl Readable for ChannelInfo
impl Readable for ChannelInfo
Source§impl Writeable for ChannelInfo
impl Writeable for ChannelInfo
impl Eq 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§
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Self in from the given LengthLimitedRead.