pub enum FourTuple {
Ip {
remote: SocketAddr,
local: Option<IpAddr>,
},
Relay {
url: RelayUrl,
endpoint_id: EndpointId,
},
Custom {
remote: CustomAddr,
local: Option<CustomAddr>,
},
}unstable-custom-transports only.Expand description
Identifies a network path by the combination of remote and local addresses.
The meaning of the local address is a bit particular:
- For IP transports it is the interface IP, if known.
- For custom transports it is a custom transport address, if the transport implementation reports one.
- For relay transports there is no separate local address.
Variants§
Ip
A path over an IP transport.
Fields
remote: SocketAddrThe remote socket address.
Relay
A path over a relay transport.
Fields
endpoint_id: EndpointIdThe remote endpoint reached through the relay.
Custom
A path over a custom transport.
Fields
remote: CustomAddrThe remote custom transport address.
local: Option<CustomAddr>The local custom transport address, if the transport reports one.
Implementations§
Source§impl FourTuple
impl FourTuple
Sourcepub fn from_remote(remote: Addr) -> Self
pub fn from_remote(remote: Addr) -> Self
Creates a four-tuple from a remote address, with no known local address.
Sourcepub fn new(remote: Addr, local: LocalTransportAddr) -> Self
pub fn new(remote: Addr, local: LocalTransportAddr) -> Self
Creates a four-tuple from a remote and a local transport address.
The variant is determined by remote. The local address is retained only when
it matches that variant. A mismatched local is dropped, which cannot happen for
values derived together from the same network path.
Sourcepub fn local(&self) -> LocalTransportAddr
pub fn local(&self) -> LocalTransportAddr
Returns the local transport address.
Trait Implementations§
impl Eq for FourTuple
impl StructuralPartialEq for FourTuple
Auto Trait Implementations§
impl Freeze for FourTuple
impl RefUnwindSafe for FourTuple
impl Send for FourTuple
impl Sync for FourTuple
impl Unpin for FourTuple
impl UnwindSafe for FourTuple
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
§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
key and return true if they are equal.§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
§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>
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