Skip to main content

Module resolver

Module resolver 

Source
Expand description

Service endpoint resolution abstraction.

Defines the Resolver trait for converting service names to transport endpoints. The trait is async to support federation (network-based resolution) in addition to local registry lookups.

§Architecture

hyprstream-rpc:     trait Resolver + SocketKind + pluggable global
hyprstream-discovery: EndpointRegistry implements Resolver (local)
future:              DiscoveryClient implements Resolver (remote/federated)

§Usage

ⓘ
use hyprstream_rpc::{Resolver, SocketKind};

async fn connect(resolver: &dyn Resolver) -> Result<()> {
    let endpoint = resolver.resolve("inference", SocketKind::Rep).await?;
    // Use endpoint...
    Ok(())
}

Structs§

NetworkDiscoveryResolver
Network profile wrapper for a DiscoveryService/PDS-backed resolver.
ServiceQuery
Canonical service-resolution request.

Enums§

ResolverProfile
Resolver profile names used at service startup.

Traits§

Resolver
Async endpoint resolver.

Functions§

globalDeprecated
Get the global resolver.
set_global
Set the global resolver.
try_global
Get the global resolver (non-panicking).