pub struct AdaptiveDiscovery<D> { /* private fields */ }Expand description
Maps a Tower discovery stream into freshly initialized adaptive endpoints.
The wrapper intentionally creates new controller state for every insert. This is the safe behavior when discovery removes and later reuses an endpoint key; state retention can be added without changing the discovery contract once churn behavior is better understood.
Implementations§
Source§impl<D> AdaptiveDiscovery<D>
impl<D> AdaptiveDiscovery<D>
Sourcepub fn new(inner: D, config: EndpointConfig) -> Self
pub fn new(inner: D, config: EndpointConfig) -> Self
Wraps a discovery stream and clones config into every inserted service.
Sourcepub fn into_inner(self) -> D
pub fn into_inner(self) -> D
Consumes the wrapper and returns the original discovery stream.
Trait Implementations§
Source§impl<D, K, S> Stream for AdaptiveDiscovery<D>
impl<D, K, S> Stream for AdaptiveDiscovery<D>
Source§type Item = Result<Change<K, AdaptiveEndpoint<S>>, <D as TryStream>::Error>
type Item = Result<Change<K, AdaptiveEndpoint<S>>, <D as TryStream>::Error>
Values yielded by the stream.
impl<'__pin, D> Unpin for AdaptiveDiscovery<D>where
PinnedFieldsOf<__Origin<'__pin, D>>: Unpin,
Auto Trait Implementations§
impl<D> Freeze for AdaptiveDiscovery<D>where
D: Freeze,
impl<D> RefUnwindSafe for AdaptiveDiscovery<D>where
D: RefUnwindSafe,
impl<D> Send for AdaptiveDiscovery<D>where
D: Send,
impl<D> Sync for AdaptiveDiscovery<D>where
D: Sync,
impl<D> UnsafeUnpin for AdaptiveDiscovery<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for AdaptiveDiscovery<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more