pub struct RRStrategy { /* private fields */ }Expand description
轮询策略
Implementations§
Source§impl RRStrategy
impl RRStrategy
Trait Implementations§
Source§impl Default for RRStrategy
impl Default for RRStrategy
Source§impl LbStrategy for RRStrategy
impl LbStrategy for RRStrategy
Source§fn add_backend(&self, addr: Address)
fn add_backend(&self, addr: Address)
添加一个后端地址
Source§fn remove_backend(&self, addr: &Address) -> bool
fn remove_backend(&self, addr: &Address) -> bool
移除一个后端地址
Source§fn get_backend(&self, _: &str) -> Option<BackendState>
fn get_backend(&self, _: &str) -> Option<BackendState>
获取一个后端地址
Source§fn get_backends(&self) -> Vec<BackendState>
fn get_backends(&self) -> Vec<BackendState>
获取所有后端地址
Source§fn get_origin_backends(&self) -> Vec<BackendState>
fn get_origin_backends(&self) -> Vec<BackendState>
获取原始的所有后端地址
Source§fn disable_backend(&self, addr: &Address) -> bool
fn disable_backend(&self, addr: &Address) -> bool
使一个后端地址无效
Source§fn enable_backend(&self, addr: &Address)
fn enable_backend(&self, addr: &Address)
使一个后端地址有效
Source§fn backend<KEY: AsRef<str>>(
this: Box<dyn LbStrategy>,
key: KEY,
) -> Option<BackendState>where
Self: Sized,
fn backend<KEY: AsRef<str>>(
this: Box<dyn LbStrategy>,
key: KEY,
) -> Option<BackendState>where
Self: Sized,
获取一个后端地址, 通过通用key
Auto Trait Implementations§
impl !Freeze for RRStrategy
impl RefUnwindSafe for RRStrategy
impl Send for RRStrategy
impl Sync for RRStrategy
impl Unpin for RRStrategy
impl UnwindSafe for RRStrategy
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