pub struct DiscoveredPeer {
pub transport_id: TransportId,
pub addr: TransportAddr,
pub pubkey_hint: Option<XOnlyPublicKey>,
}Expand description
A peer discovered via transport-layer discovery.
Fields§
§transport_id: TransportIdTransport that discovered this peer.
addr: TransportAddrTransport address where the peer was found.
pubkey_hint: Option<XOnlyPublicKey>Optional hint about the peer’s identity (if known from discovery).
Implementations§
Source§impl DiscoveredPeer
impl DiscoveredPeer
Sourcepub fn new(transport_id: TransportId, addr: TransportAddr) -> Self
pub fn new(transport_id: TransportId, addr: TransportAddr) -> Self
Create a discovered peer without identity hint.
Sourcepub fn with_hint(
transport_id: TransportId,
addr: TransportAddr,
pubkey: XOnlyPublicKey,
) -> Self
pub fn with_hint( transport_id: TransportId, addr: TransportAddr, pubkey: XOnlyPublicKey, ) -> Self
Create a discovered peer with identity hint.
Trait Implementations§
Source§impl Clone for DiscoveredPeer
impl Clone for DiscoveredPeer
Source§fn clone(&self) -> DiscoveredPeer
fn clone(&self) -> DiscoveredPeer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DiscoveredPeer
impl RefUnwindSafe for DiscoveredPeer
impl Send for DiscoveredPeer
impl Sync for DiscoveredPeer
impl Unpin for DiscoveredPeer
impl UnsafeUnpin for DiscoveredPeer
impl UnwindSafe for DiscoveredPeer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more