Enum tor_config::misc::ListenItem
source · enum ListenItem {
Localhost(NonZeroU16),
General(SocketAddr),
}
Expand description
One item in the Listen
We distinguish Localhost
,
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§
Localhost(NonZeroU16)
One port, both IPv6 and IPv4
General(SocketAddr)
Any other single socket address
Implementations§
source§impl ListenItem
impl ListenItem
sourcefn iter(&self) -> impl Iterator<Item = SocketAddr> + '_
fn iter(&self) -> impl Iterator<Item = SocketAddr> + '_
Return the SocketAddr
s implied by this item
Trait Implementations§
source§impl Clone for ListenItem
impl Clone for ListenItem
source§fn clone(&self) -> ListenItem
fn clone(&self) -> ListenItem
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ListenItem
impl Debug for ListenItem
source§impl<'de> Deserialize<'de> for ListenItem
impl<'de> Deserialize<'de> for ListenItem
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 Display for ListenItem
impl Display for ListenItem
source§impl From<ListenItem> for ListenItemSerde
impl From<ListenItem> for ListenItemSerde
source§fn from(i: ListenItem) -> ListenItemSerde
fn from(i: ListenItem) -> ListenItemSerde
Converts to this type from the input type.
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 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ListenItem
impl PartialEq for ListenItem
source§fn eq(&self, other: &ListenItem) -> bool
fn eq(&self, other: &ListenItem) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ListenItem
impl PartialOrd for ListenItem
source§fn partial_cmp(&self, other: &ListenItem) -> Option<Ordering>
fn partial_cmp(&self, other: &ListenItem) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ListenItem
impl Serialize for ListenItem
source§impl TryFrom<ListenItemSerde> for ListenItem
impl TryFrom<ListenItemSerde> for ListenItem
§type Error = InvalidListen
type Error = InvalidListen
The type returned in the event of a conversion error.
source§fn try_from(i: ListenItemSerde) -> Result<ListenItem, Self::Error>
fn try_from(i: ListenItemSerde) -> Result<ListenItem, Self::Error>
Performs the conversion.
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 UnwindSafe for ListenItem
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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