Struct ReadOnlyNetworkGraph

Source
pub struct ReadOnlyNetworkGraph<'a> { /* private fields */ }
Expand description

A read-only view of NetworkGraph.

Implementations§

Source§

impl ReadOnlyNetworkGraph<'_>

Source

pub fn channels(&self) -> &IndexedMap<u64, ChannelInfo>

Returns all known valid channels’ short ids along with announced channel info.

This is not exported to bindings users because we don’t want to return lifetime’d references

Source

pub fn channel(&self, short_channel_id: u64) -> Option<&ChannelInfo>

Returns information on a channel with the given id.

Source

pub fn nodes(&self) -> &IndexedMap<NodeId, NodeInfo>

Returns all known nodes’ public keys along with announced node info.

This is not exported to bindings users because we don’t want to return lifetime’d references

Source

pub fn node(&self, node_id: &NodeId) -> Option<&NodeInfo>

Returns information on a node with the given id.

Source

pub fn get_addresses(&self, pubkey: &PublicKey) -> Option<Vec<SocketAddress>>

Get network addresses by node id. Returns None if the requested node is completely unknown, or if node announcement for the node was never received.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.