Struct tower_balance::pool::Pool [−][src]
A dynamically sized, load-balanced pool of Service
instances.
Implementations
impl<MS, Target, Request> Pool<MS, Target, Request> where
MS: MakeService<Target, Request>,
MS::Service: Load,
<MS::Service as Load>::Metric: Debug,
MS::MakeError: Into<Box<dyn Error + Send + Sync>>,
MS::Error: Into<Box<dyn Error + Send + Sync>>,
Target: Clone,
[src]
MS: MakeService<Target, Request>,
MS::Service: Load,
<MS::Service as Load>::Metric: Debug,
MS::MakeError: Into<Box<dyn Error + Send + Sync>>,
MS::Error: Into<Box<dyn Error + Send + Sync>>,
Target: Clone,
pub fn new(make_service: MS, target: Target) -> Self
[src]
Construct a new dynamically sized Pool
.
If many calls to poll_ready
return Pending
, new_service
is used to
construct another Service
that is then added to the load-balanced pool.
If many calls to poll_ready
succeed, the most recently added Service
is dropped from the pool.
Trait Implementations
impl<MS, Target, Request> Debug for Pool<MS, Target, Request> where
MS: MakeService<Target, Request> + Debug,
MS::MakeError: Into<Box<dyn Error + Send + Sync>>,
MS::Error: Into<Box<dyn Error + Send + Sync>>,
Target: Clone + Debug,
MS::Service: Debug,
Request: Debug,
[src]
MS: MakeService<Target, Request> + Debug,
MS::MakeError: Into<Box<dyn Error + Send + Sync>>,
MS::Error: Into<Box<dyn Error + Send + Sync>>,
Target: Clone + Debug,
MS::Service: Debug,
Request: Debug,
impl<MS, Target, Req> Service<Req> for Pool<MS, Target, Req> where
MS: MakeService<Target, Req>,
MS::Service: Load,
<MS::Service as Load>::Metric: Debug,
MS::MakeError: Into<Box<dyn Error + Send + Sync>>,
MS::Error: Into<Box<dyn Error + Send + Sync>>,
Target: Clone,
[src]
MS: MakeService<Target, Req>,
MS::Service: Load,
<MS::Service as Load>::Metric: Debug,
MS::MakeError: Into<Box<dyn Error + Send + Sync>>,
MS::Error: Into<Box<dyn Error + Send + Sync>>,
Target: Clone,
type Response = <Balance<Pin<Box<PoolDiscoverer<MS, Target, Req>>>, Req> as Service<Req>>::Response
Responses given by the service.
type Error = <Balance<Pin<Box<PoolDiscoverer<MS, Target, Req>>>, Req> as Service<Req>>::Error
Errors produced by the service.
type Future = <Balance<Pin<Box<PoolDiscoverer<MS, Target, Req>>>, Req> as Service<Req>>::Future
The future response value.
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
[src]
fn call(&mut self, req: Req) -> Self::Future
[src]
Auto Trait Implementations
impl<MS, Target, Request> !RefUnwindSafe for Pool<MS, Target, Request>
impl<MS, Target, Request> Send for Pool<MS, Target, Request> where
MS: Send,
Request: Send,
Target: Send,
<MS as MakeService<Target, Request>>::Future: Send,
<MS as MakeService<Target, Request>>::Service: Send,
MS: Send,
Request: Send,
Target: Send,
<MS as MakeService<Target, Request>>::Future: Send,
<MS as MakeService<Target, Request>>::Service: Send,
impl<MS, Target, Request> Sync for Pool<MS, Target, Request> where
MS: Sync,
Request: Sync,
Target: Sync,
<MS as MakeService<Target, Request>>::Future: Sync,
<MS as MakeService<Target, Request>>::Service: Sync,
MS: Sync,
Request: Sync,
Target: Sync,
<MS as MakeService<Target, Request>>::Future: Sync,
<MS as MakeService<Target, Request>>::Service: Sync,
impl<MS, Target, Request> Unpin for Pool<MS, Target, Request> where
Request: Unpin,
Request: Unpin,
impl<MS, Target, Request> !UnwindSafe for Pool<MS, Target, Request>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<M, S, Target, Request> MakeService<Target, Request> for M where
S: Service<Request>,
M: Service<Target, Response = S>,
[src]
S: Service<Request>,
M: Service<Target, Response = S>,
type Response = <S as Service<Request>>::Response
Responses given by the service
type Error = <S as Service<Request>>::Error
Errors produced by the service
type Service = S
The Service
value created by this factory
type MakeError = <M as Service<Target>>::Error
Errors produced while building a service.
type Future = <M as Service<Target>>::Future
The future of the Service
instance.
pub fn poll_ready(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>
pub fn make_service(
&mut self,
target: Target
) -> <M as MakeService<Target, Request>>::Future
[src]
&mut self,
target: Target
) -> <M as MakeService<Target, Request>>::Future
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,