Trait tower::discover::Discover

source ·
pub trait Discover: Sealed<Change<(), ()>> {
    type Key: Eq;
    type Service;
    type Error;

    // Required method
    fn poll_discover(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Option<Result<Change<Self::Key, Self::Service>, Self::Error>>>;
}
Expand description

A dynamically changing set of related services.

As new services arrive and old services are retired, Changes are returned which provide unique identifiers for the services.

See the module documentation for more details.

Required Associated Types§

source

type Key: Eq

A unique identifier for each active service.

An identifier can be re-used once a Change::Remove has been yielded for its service.

source

type Service

The type of Service yielded by this Discover.

source

type Error

Error produced during discovery

Required Methods§

source

fn poll_discover( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Change<Self::Key, Self::Service>, Self::Error>>>

Yields the next discovery change set.

Implementors§

source§

impl<K, S, E, D> Discover for D
where D: TryStream<Ok = Change<K, S>, Error = E> + ?Sized, K: Eq,

§

type Key = K

§

type Service = S

§

type Error = E