Trait tower::discover::Discover[][src]

pub trait Discover: Sealed<Change<(), ()>> {
    type Key: Eq;
    type Service;
    type Error;
    fn poll_discover(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Option<Result<Change<Self::Key, Self::Service>, Self::Error>>>; }
This is supported on crate feature discover only.
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.

Associated Types

type Key: Eq[src]

A unique identifier for each active service.

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

type Service[src]

The type of Service yielded by this Discover.

type Error[src]

Error produced during discovery

Required methods

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

Yields the next discovery change set.

Implementors

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

type Key = K

type Service = S

type Error = E

fn poll_discover(
    self: Pin<&mut Self>,
    cx: &mut Context<'_>
) -> Poll<Option<Result<D::Ok, D::Error>>>
[src]