pub struct LoadBalancer { /* private fields */ }Expand description
负载均衡器
Implementations§
Source§impl LoadBalancer
impl LoadBalancer
Sourcepub fn new(strategy: LoadBalanceStrategy) -> Self
pub fn new(strategy: LoadBalanceStrategy) -> Self
创建负载均衡器
Sourcepub fn select(&self, instances: &[ServiceInstance]) -> Option<ServiceInstance>
pub fn select(&self, instances: &[ServiceInstance]) -> Option<ServiceInstance>
选择服务实例
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LoadBalancer
impl RefUnwindSafe for LoadBalancer
impl Send for LoadBalancer
impl Sync for LoadBalancer
impl Unpin for LoadBalancer
impl UnsafeUnpin for LoadBalancer
impl UnwindSafe for LoadBalancer
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