pub struct CHStrategy { /* private fields */ }Expand description
一致性hash负载策略
Implementations§
Trait Implementations§
Source§impl Default for CHStrategy
impl Default for CHStrategy
Source§impl LbStrategy for CHStrategy
impl LbStrategy for CHStrategy
Source§fn remove_backend(&self, addr: &Address) -> bool
fn remove_backend(&self, addr: &Address) -> bool
移除一个后端地址
Source§fn get_backend(&self, key: &str) -> Option<BackendState>
fn get_backend(&self, key: &str) -> Option<BackendState>
获取一个后端地址
Source§fn get_backends(&self) -> Vec<BackendState>
fn get_backends(&self) -> Vec<BackendState>
获取所有后端地址
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 CHStrategy
impl RefUnwindSafe for CHStrategy
impl Send for CHStrategy
impl Sync for CHStrategy
impl Unpin for CHStrategy
impl UnwindSafe for CHStrategy
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