pub struct NodeInfo {
pub node_id: NodeId,
pub relay_url: Option<Url>,
pub direct_addresses: BTreeSet<SocketAddr>,
}
Expand description
Information about the iroh node contained in an IROH_TXT_NAME
TXT resource record.
Fields§
§node_id: NodeId
The NodeId
.
relay_url: Option<Url>
The advertised home relay server.
direct_addresses: BTreeSet<SocketAddr>
Any direct addresses.
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(
node_id: NodeId,
relay_url: Option<Url>,
direct_addresses: BTreeSet<SocketAddr>,
) -> Self
pub fn new( node_id: NodeId, relay_url: Option<Url>, direct_addresses: BTreeSet<SocketAddr>, ) -> Self
Creates a new NodeInfo
from its parts.
Sourcepub fn from_hickory_records(records: &[Record]) -> Result<Self>
pub fn from_hickory_records(records: &[Record]) -> Result<Self>
Parses a NodeInfo
from a set of DNS records.
Sourcepub fn from_pkarr_signed_packet(packet: &SignedPacket) -> Result<Self>
pub fn from_pkarr_signed_packet(packet: &SignedPacket) -> Result<Self>
Parses a NodeInfo
from a pkarr::SignedPacket
.
Sourcepub fn to_pkarr_signed_packet(
&self,
secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket>
pub fn to_pkarr_signed_packet( &self, secret_key: &SecretKey, ttl: u32, ) -> Result<SignedPacket>
Creates a pkarr::SignedPacket
.
This constructs a DNS packet and signs it with a SecretKey
.
Sourcepub fn to_hickory_records(
&self,
origin: &str,
ttl: u32,
) -> Result<impl Iterator<Item = Record> + 'static>
pub fn to_hickory_records( &self, origin: &str, ttl: u32, ) -> Result<impl Iterator<Item = Record> + 'static>
Converts into a hickory_proto::rr::Record
DNS record.
Trait Implementations§
impl Eq for NodeInfo
impl StructuralPartialEq for NodeInfo
Auto Trait Implementations§
impl Freeze for NodeInfo
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnwindSafe for NodeInfo
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key
and return true
if they are equal.