pub enum Location {
Addr(ChannelAddr),
Via(Uid, Box<Location>),
}Expand description
A network location.
Two variants: a terminal ChannelAddr, or a “via” hop carrying
the Uid of a gateway through which the inner location is
reachable. The via form is a source route — a message addressed to
Via(uid, inner) is forwarded by the gateway holding that uid and
then routed by the inner location.
Display syntax:
location := via* zmq-url
via := uid "."
uid := label | "<" base58 ">" | label "<" base58 ">"The parser sniffs the ZMQ URL scheme (<scheme>://) to split the
via list from the URL — so any uid form accepted by Uid
(singleton label, unlabeled instance, or labeled instance) is
admitted in via position.
Examples:
<2MuAHeDjLCEd>.tcp://[::1]:2345— one unlabeled instance via.host<7PDmJtQJB5S>.tcp://[::1]:2345— labeled instance via.client.host<7PDmJtQJB5S>.tcp://[::1]:2345— a singleton via stacked on a labeled instance via.
Variants§
Addr(ChannelAddr)
A terminal channel address. Routed directly.
Via(Uid, Box<Location>)
A via hop: messages for this location are forwarded by the
gateway holding Uid, which peels this prefix off the
destination before routing the inner location.
Implementations§
Source§impl Location
impl Location
Sourcepub fn as_addr_mut(&mut self) -> Option<&mut ChannelAddr>
pub fn as_addr_mut(&mut self) -> Option<&mut ChannelAddr>
Optionally returns mutable references to the inner fields if this is a Location::Addr, otherwise None
Sourcepub fn as_addr(&self) -> Option<&ChannelAddr>
pub fn as_addr(&self) -> Option<&ChannelAddr>
Optionally returns references to the inner fields if this is a Location::Addr, otherwise None
Sourcepub fn into_addr(self) -> Result<ChannelAddr, Self>
pub fn into_addr(self) -> Result<ChannelAddr, Self>
Returns the inner fields if this is a Location::Addr, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_via_mut(&mut self) -> Option<(&mut Uid, &mut Box<Location>)>
pub fn as_via_mut(&mut self) -> Option<(&mut Uid, &mut Box<Location>)>
Optionally returns mutable references to the inner fields if this is a Location::Via, otherwise None
Source§impl Location
impl Location
Sourcepub fn addr(&self) -> &ChannelAddr
pub fn addr(&self) -> &ChannelAddr
Returns the innermost channel address, peeling all via hops.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
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>,
Source§impl From<ChannelAddr> for Location
impl From<ChannelAddr> for Location
Source§fn from(addr: ChannelAddr) -> Self
fn from(addr: ChannelAddr) -> Self
Source§impl Ord for Location
impl Ord for Location
Source§impl PartialOrd for Location
impl PartialOrd for Location
impl Eq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnsafeUnpin for Location
impl UnwindSafe for Location
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
§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> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].