pub struct NodeAddr {
pub node_id: PublicKey,
pub info: AddrInfo,
}Expand description
A peer and it’s addressing information.
Fields§
§node_id: PublicKeyThe node’s public key.
info: AddrInfoAddressing information to connect to Self::node_id.
Implementations§
source§impl NodeAddr
impl NodeAddr
sourcepub fn with_relay_url(self, relay_url: RelayUrl) -> Self
pub fn with_relay_url(self, relay_url: RelayUrl) -> Self
Add a relay url to the peer’s AddrInfo.
sourcepub fn with_direct_addresses(
self,
addresses: impl IntoIterator<Item = SocketAddr>
) -> Self
pub fn with_direct_addresses( self, addresses: impl IntoIterator<Item = SocketAddr> ) -> Self
Add the given direct addresses to the peer’s AddrInfo.
sourcepub fn apply_options(&mut self, opts: AddrInfoOptions)
pub fn apply_options(&mut self, opts: AddrInfoOptions)
Apply the options to self.
sourcepub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>
pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>
Get the direct addresses of this peer.
Trait Implementations§
source§impl<'de> Deserialize<'de> for NodeAddr
impl<'de> Deserialize<'de> for NodeAddr
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for NodeAddr
impl PartialEq for NodeAddr
impl Eq for NodeAddr
impl StructuralPartialEq for NodeAddr
Auto Trait Implementations§
impl Freeze for NodeAddr
impl RefUnwindSafe for NodeAddr
impl Send for NodeAddr
impl Sync for NodeAddr
impl Unpin for NodeAddr
impl UnwindSafe for NodeAddr
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