enum ListenItem {
Port(u16),
Auto,
AutoPort(IpAddr),
General(SocketAddr),
}Expand description
One item in the CustomizableListen.
This type defines a common format for parsing. We don’t assign any particular meaning to the variants. For example a standalone port doesn’t imply anything about what IP address should be used. Similarly, a port of 0 doesn’t have any inherent meaning. For example a port of 0 might mean “don’t listen” (when network addresses are optional) or might mean “raise an error” (when network addresses are required). It’s up to the user of this type to assign meaning to the values given.
We distinguish a standalone port,
rather than just storing two net:SocketAddr,
so that we can handle localhost (which means two address families) specially
in order to implement localhost_port_legacy().
Variants§
Port(u16)
One port, both IPv6 and IPv4
Auto
IPv6 and/or IPv4, arbitrarily chosen ports.
AutoPort(IpAddr)
Specific address, arbitrarily chosen port.
General(SocketAddr)
Any other single socket address
Implementations§
Source§impl ListenItem
impl ListenItem
Sourcefn iter<'a>(
&'a self,
ips_for_port: impl IntoIterator<Item = IpAddr> + 'a,
) -> impl Iterator<Item = SocketAddr> + 'a
fn iter<'a>( &'a self, ips_for_port: impl IntoIterator<Item = IpAddr> + 'a, ) -> impl Iterator<Item = SocketAddr> + 'a
Return the SocketAddrs implied by this item
If the item is a standalone port, then the returned iterator will return a socket address
using that port for each IP address in ips_for_port.
Sourcefn is_port_zero(&self) -> bool
fn is_port_zero(&self) -> bool
Return true if this ListenItem is using an explicit (deprecated) port value of 0.
Trait Implementations§
Source§impl Clone for ListenItem
impl Clone for ListenItem
Source§fn clone(&self) -> ListenItem
fn clone(&self) -> ListenItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ListenItem
impl Debug for ListenItem
Source§impl Display for ListenItem
impl Display for ListenItem
Source§impl From<ListenItem> for ListenItemSerde
impl From<ListenItem> for ListenItemSerde
Source§fn from(i: ListenItem) -> Self
fn from(i: ListenItem) -> Self
Source§impl Hash for ListenItem
impl Hash for ListenItem
Source§impl Ord for ListenItem
impl Ord for ListenItem
Source§fn cmp(&self, other: &ListenItem) -> Ordering
fn cmp(&self, other: &ListenItem) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ListenItem
impl PartialEq for ListenItem
Source§fn eq(&self, other: &ListenItem) -> bool
fn eq(&self, other: &ListenItem) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ListenItem
impl PartialOrd for ListenItem
Source§impl TryFrom<ListenItemSerde> for ListenItem
impl TryFrom<ListenItemSerde> for ListenItem
Source§type Error = InvalidCustomizableListen
type Error = InvalidCustomizableListen
Source§fn try_from(i: ListenItemSerde) -> Result<ListenItem, Self::Error>
fn try_from(i: ListenItemSerde) -> Result<ListenItem, Self::Error>
impl Eq for ListenItem
impl StructuralPartialEq for ListenItem
Auto Trait Implementations§
impl Freeze for ListenItem
impl RefUnwindSafe for ListenItem
impl Send for ListenItem
impl Sync for ListenItem
impl Unpin for ListenItem
impl UnsafeUnpin for ListenItem
impl UnwindSafe for ListenItem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.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>
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>
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