pub struct BackendList {
pub backends: Vec<Rc<RefCell<Backend>>>,
pub next_id: u32,
pub load_balancing: Box<dyn LoadBalancingAlgorithm>,
/* private fields */
}Fields§
§backends: Vec<Rc<RefCell<Backend>>>§next_id: u32§load_balancing: Box<dyn LoadBalancingAlgorithm>Implementations§
Source§impl BackendList
impl BackendList
pub fn new() -> BackendList
pub fn import_configuration_state(backend_vec: &[Backend]) -> BackendList
pub fn add_backend(&mut self, backend: Backend)
Sourcepub fn remove_backend(&mut self, backend_address: &SocketAddr) -> Vec<String>
pub fn remove_backend(&mut self, backend_address: &SocketAddr) -> Vec<String>
Remove every backend at backend_address and return the list of
backend_ids that were dropped. Two backends with the same address
but distinct ids (A/B test, weighted variant, dedup race) are both
removed here; the caller relies on the returned ids to tear down
matching per-backend state (metrics, health-check). Returning the
ids closes the identity drift between runtime-removal-by-address
and metrics-removal-by-id.
pub fn has_backend(&self, backend_address: &SocketAddr) -> bool
pub fn find_backend( &mut self, backend_address: &SocketAddr, ) -> Option<&mut Rc<RefCell<Backend>>>
pub fn find_sticky( &mut self, sticky_session: &str, ) -> Option<&mut Rc<RefCell<Backend>>>
pub fn available_backends(&mut self, backup: bool) -> Vec<Rc<RefCell<Backend>>>
pub fn next_available_backend(&mut self) -> Option<Rc<RefCell<Backend>>>
pub fn set_load_balancing_policy( &mut self, load_balancing_policy: LoadBalancingAlgorithms, metric: Option<LoadMetric>, )
Trait Implementations§
Source§impl Debug for BackendList
impl Debug for BackendList
Auto Trait Implementations§
impl !Freeze for BackendList
impl !RefUnwindSafe for BackendList
impl !Send for BackendList
impl !Sync for BackendList
impl Unpin for BackendList
impl UnsafeUnpin for BackendList
impl !UnwindSafe for BackendList
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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