Struct MakeBalance

struct MakeBalance<S, Req> { ... }

Constructs load balancers over dynamic service sets produced by a wrapped "inner" service.

This is effectively an implementation of MakeService except that it forwards the service descriptors (Target) to an inner service (S), and expects that service to produce a service set in the form of a Discover. It then wraps the service set in a Balance before returning it as the "made" service.

See the module-level documentation for details on load balancing.

Implementations

impl<S, Req> MakeBalance<S, Req>

const fn new(make_discover: S) -> Self

Build balancers using operating system entropy.

impl<M, S, Target, Request> MakeService for MakeBalance<S, Req>

fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>
fn make_service(self: &mut Self, target: Target) -> <M as MakeService<Target, Request>>::Future

impl<S, Req> Clone for MakeBalance<S, Req>

fn clone(self: &Self) -> Self

impl<S, Req> Debug for MakeBalance<S, Req>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<S, Req> Freeze for MakeBalance<S, Req>

impl<S, Req> RefUnwindSafe for MakeBalance<S, Req>

impl<S, Req> Send for MakeBalance<S, Req>

impl<S, Req> Sync for MakeBalance<S, Req>

impl<S, Req> Unpin for MakeBalance<S, Req>

impl<S, Req> UnsafeUnpin for MakeBalance<S, Req>

impl<S, Req> UnwindSafe for MakeBalance<S, Req>

impl<S, Target, Req> Service for MakeBalance<S, Req>

fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn call(self: &mut Self, target: Target) -> <Self as >::Future

impl<T> Any for MakeBalance<S, Req>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for MakeBalance<S, Req>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for MakeBalance<S, Req>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for MakeBalance<S, Req>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for MakeBalance<S, Req>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for MakeBalance<S, Req>

impl<T> ToOwned for MakeBalance<S, Req>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> WithSubscriber for MakeBalance<S, Req>

impl<T, Request> ServiceExt for MakeBalance<S, Req>

impl<T, U> Into for MakeBalance<S, Req>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for MakeBalance<S, Req>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for MakeBalance<S, Req>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>