#[non_exhaustive]pub struct TargetPort {
pub ipv6: bool,
pub port: u16,
}
Expand description
A port that we want to connect to as a client.
Ordinarily, this is a TCP port, plus a flag to indicate whether we must support IPv4 or IPv6.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.ipv6: bool
True if this is a request to connect to an IPv6 address
port: u16
The port that the client wants to connect to
Implementations§
source§impl TargetPort
impl TargetPort
sourcepub fn ipv4(port: u16) -> TargetPort
pub fn ipv4(port: u16) -> TargetPort
Create a request to make sure that a circuit supports a given ipv4 exit port.
sourcepub fn ipv6(port: u16) -> TargetPort
pub fn ipv6(port: u16) -> TargetPort
Create a request to make sure that a circuit supports a given ipv6 exit port.
sourcepub fn is_supported_by(&self, r: &RelayDetails<'_>) -> bool
pub fn is_supported_by(&self, r: &RelayDetails<'_>) -> bool
Return true if this port is supported by the provided Relay.
Trait Implementations§
source§impl Clone for TargetPort
impl Clone for TargetPort
source§fn clone(&self) -> TargetPort
fn clone(&self) -> TargetPort
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 TargetPort
impl Debug for TargetPort
source§impl Default for TargetPort
impl Default for TargetPort
source§fn default() -> TargetPort
fn default() -> TargetPort
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TargetPort
impl<'de> Deserialize<'de> for TargetPort
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 TargetPort
impl Display for TargetPort
source§impl Hash for TargetPort
impl Hash for TargetPort
source§impl Ord for TargetPort
impl Ord for TargetPort
source§fn cmp(&self, other: &TargetPort) -> Ordering
fn cmp(&self, other: &TargetPort) -> 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 TargetPort
impl PartialEq for TargetPort
source§impl PartialOrd for TargetPort
impl PartialOrd for TargetPort
source§impl Serialize for TargetPort
impl Serialize for TargetPort
impl Copy for TargetPort
impl Eq for TargetPort
impl StructuralPartialEq for TargetPort
Auto Trait Implementations§
impl Freeze for TargetPort
impl RefUnwindSafe for TargetPort
impl Send for TargetPort
impl Sync for TargetPort
impl Unpin for TargetPort
impl UnwindSafe for TargetPort
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
)§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