Skip to main content

DiscoveryProvider

Trait DiscoveryProvider 

Source
pub trait DiscoveryProvider: Send + Sync {
    // Required methods
    fn discover<'a>(
        &'a self,
        identity: &'a CoreIdentity,
    ) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>;
    fn discover_traced<'a>(
        &'a self,
        identity: &'a CoreIdentity,
        trace: Option<&'a TraceContext>,
    ) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>;
}
Expand description

Provider contract limited to compatible peer discovery.

Required Methods§

Source

fn discover<'a>( &'a self, identity: &'a CoreIdentity, ) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>

Discovers peers compatible with the supplied runtime identity.

Source

fn discover_traced<'a>( &'a self, identity: &'a CoreIdentity, trace: Option<&'a TraceContext>, ) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>

Discovers peers while propagating trace context when supported.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§