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

pub trait Discover {
    type Key: Eq + Hash;
    type Service;
    type Error;
    fn poll_discover(
        self: Pin<&mut Self>,
        cx: &mut Context
    ) -> Poll<Result<Change<Self::Key, Self::Service>, Self::Error>>; }

Provide a uniform set of services able to satisfy a request.

This set of services may be updated over time. On each change to the set, a new NewServiceSet is yielded by Discover.

See crate documentation for more details.

Associated Types

type Key: Eq + Hash

NewService key

type Service

The type of Service yielded by this Discover.

type Error

Error produced during discovery

Loading content...

Required methods

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

Yields the next discovery change set.

Loading content...

Implementations on Foreign Types

impl<P> Discover for Pin<P> where
    P: Unpin + DerefMut,
    <P as Deref>::Target: Discover
[src]

type Key = <<P as Deref>::Target as Discover>::Key

type Service = <<P as Deref>::Target as Discover>::Service

type Error = <<P as Deref>::Target as Discover>::Error

impl<'_, D> Discover for &'_ mut D where
    D: Discover + Unpin + ?Sized
[src]

type Key = <D as Discover>::Key

type Service = <D as Discover>::Service

type Error = <D as Discover>::Error

impl<D> Discover for Box<D> where
    D: Discover + Unpin + ?Sized
[src]

type Key = <D as Discover>::Key

type Service = <D as Discover>::Service

type Error = <D as Discover>::Error

Loading content...

Implementors

impl<S, K, Svc> Discover for ServiceStream<S> where
    K: Hash + Eq,
    S: TryStream<Ok = Change<K, Svc>>, 
[src]

type Key = K

type Service = Svc

type Error = <S as TryStream>::Error

impl<T, U> Discover for ServiceList<T> where
    T: IntoIterator<Item = U>, 
[src]

type Key = usize

type Service = U

type Error = Never

Loading content...