pub struct AdvertisedSender { /* private fields */ }Expand description
An owned description of one advertised sender, independent of later listener calls.
Every string is whatever the sender advertised. Text that is not valid
UTF-8 is decoded with U+FFFD in place of the offending bytes; only the
identifier keeps its exact bytes. Self::to_source requires
the original name and any advertised address to be valid UTF-8.
Implementations§
Source§impl AdvertisedSender
impl AdvertisedSender
Sourcepub fn port(&self) -> Option<NonZeroU16>
pub fn port(&self) -> Option<NonZeroU16>
The sender’s non-zero network port, or None when the advertised value
is outside the range 1–65535.
Sourcepub fn to_source(&self) -> Option<Source>
pub fn to_source(&self) -> Option<Source>
Convert this advertised sender into a connection target.
Returns None when the server supplied no source name or when the
original name or address contains invalid UTF-8. An address is included
when the advertised host is an IP address or host name and the port is
non-zero. IPv6 literals are enclosed in brackets. Otherwise the receiver
can look up the source by name.
Sourcepub fn events_subscribed(&self) -> bool
pub fn events_subscribed(&self) -> bool
Whether this listener is subscribed to the sender’s events.