pub struct AddressLookupServices { /* private fields */ }Expand description
Registry for address lookup services for an Endpoint.
The endpoint will use this registry both for publishing its own EndpointInfo
and for resolving addresses of remote endpoints.
See AddressLookup and Self::resolve for details.
Implementations§
Source§impl AddressLookupServices
impl AddressLookupServices
Sourcepub fn set_addr_filter(&self, filter: AddrFilter)
pub fn set_addr_filter(&self, filter: AddrFilter)
Sets the address filter applied before publishing to any service.
When set, all address data is filtered once before being distributed to the individual address lookup services. This ensures consistent filtering regardless of how many services are configured.
Sourcepub fn add(&self, service: impl AddressLookup + 'static)
pub fn add(&self, service: impl AddressLookup + 'static)
Adds an AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
Sourcepub fn add_boxed(&self, service: Box<dyn AddressLookup>)
pub fn add_boxed(&self, service: Box<dyn AddressLookup>)
Adds an already Boxed AddressLookup service.
If there is historical Address Lookup data, it will be published immediately on this service.
Sourcepub fn resolve(
&self,
endpoint_id: EndpointId,
) -> impl Stream<Item = Result<Result<Item, Error>, AddressLookupFailed>> + use<>
pub fn resolve( &self, endpoint_id: EndpointId, ) -> impl Stream<Item = Result<Result<Item, Error>, AddressLookupFailed>> + use<>
Resolves the addressing information for an EndpointId across all configured services.
All services are queried concurrently and their results are merged into a
single stream. Each Item is yielded as Ok(Ok(item)) as soon as it
is produced, allowing the caller to act on the first usable address
while slower services are still working.
Errors from individual services are yielded inline as Ok(Err(error))
and do not terminate the stream: a single failing service must not hide
results from others still in flight. Inline errors are also buffered;
if all services finish without yielding any Item, the stream ends
with a single AddressLookupFailed::NoResults carrying the buffered
errors. If at least one Item was yielded, buffered errors are
discarded and the stream ends with None.
If no services are configured, the stream yields a single
AddressLookupFailed::NoServiceConfigured error and then ends.
Dropping the returned stream signals all underlying services to stop any
pending work, as documented on AddressLookup::resolve.
Trait Implementations§
Source§impl Clone for AddressLookupServices
impl Clone for AddressLookupServices
Source§fn clone(&self) -> AddressLookupServices
fn clone(&self) -> AddressLookupServices
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AddressLookupServices
impl Debug for AddressLookupServices
Source§impl Default for AddressLookupServices
impl Default for AddressLookupServices
Source§fn default() -> AddressLookupServices
fn default() -> AddressLookupServices
Auto Trait Implementations§
impl Freeze for AddressLookupServices
impl RefUnwindSafe for AddressLookupServices
impl Send for AddressLookupServices
impl Sync for AddressLookupServices
impl Unpin for AddressLookupServices
impl UnwindSafe for AddressLookupServices
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<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