pub struct MakeBalanceLayer<D, Req> { /* private fields */ }
Expand description
Construct load balancers (Balance
) over dynamic service sets (Discover
) produced by the
“inner” service in response to requests coming from the “outer” service.
This construction may seem a little odd at first glance. This is not a layer that takes
requests and produces responses in the traditional sense. Instead, it is more like
MakeService
in that it takes service descriptors (see Target
on MakeService
)
and produces services. Since Balance
spreads requests across a set of services,
the inner service should produce a Discover
, not just a single
Service
, given a service descriptor.
See the module-level documentation for details on load balancing.
Implementations§
Source§impl<D, Req> MakeBalanceLayer<D, Req>
impl<D, Req> MakeBalanceLayer<D, Req>
Sourcepub const fn new() -> MakeBalanceLayer<D, Req>
pub const fn new() -> MakeBalanceLayer<D, Req>
Build balancers using operating system entropy.
Trait Implementations§
Source§impl<D, Req> Clone for MakeBalanceLayer<D, Req>
impl<D, Req> Clone for MakeBalanceLayer<D, Req>
Source§fn clone(&self) -> MakeBalanceLayer<D, Req>
fn clone(&self) -> MakeBalanceLayer<D, Req>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<D, Req> Debug for MakeBalanceLayer<D, Req>
impl<D, Req> Debug for MakeBalanceLayer<D, Req>
Source§impl<D, Req> Default for MakeBalanceLayer<D, Req>
impl<D, Req> Default for MakeBalanceLayer<D, Req>
Source§fn default() -> MakeBalanceLayer<D, Req>
fn default() -> MakeBalanceLayer<D, Req>
Returns the “default value” for a type. Read more
Source§impl<S, Req> Layer<S> for MakeBalanceLayer<S, Req>
impl<S, Req> Layer<S> for MakeBalanceLayer<S, Req>
Source§type Service = MakeBalance<S, Req>
type Service = MakeBalance<S, Req>
The wrapped service
Auto Trait Implementations§
impl<D, Req> Freeze for MakeBalanceLayer<D, Req>
impl<D, Req> RefUnwindSafe for MakeBalanceLayer<D, Req>
impl<D, Req> Send for MakeBalanceLayer<D, Req>
impl<D, Req> Sync for MakeBalanceLayer<D, Req>
impl<D, Req> Unpin for MakeBalanceLayer<D, Req>
impl<D, Req> UnwindSafe for MakeBalanceLayer<D, Req>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more