pub struct Backend {
pub sticky_id: Option<String>,
pub backend_id: String,
pub address: SocketAddr,
pub status: BackendStatus,
pub retry_policy: RetryPolicyWrapper,
pub active_connections: usize,
pub active_requests: usize,
pub failures: usize,
pub load_balancing_parameters: Option<LoadBalancingParams>,
pub backup: bool,
pub connection_time: PeakEWMA,
}
Fields§
§sticky_id: Option<String>
§backend_id: String
§address: SocketAddr
§status: BackendStatus
§retry_policy: RetryPolicyWrapper
§active_connections: usize
§active_requests: usize
§failures: usize
§load_balancing_parameters: Option<LoadBalancingParams>
§backup: bool
§connection_time: PeakEWMA
Implementations§
Source§impl Backend
impl Backend
pub fn new( backend_id: &str, address: SocketAddr, sticky_id: Option<String>, load_balancing_parameters: Option<LoadBalancingParams>, backup: Option<bool>, ) -> Backend
pub fn set_closing(&mut self)
pub fn retry_policy(&mut self) -> &mut RetryPolicyWrapper
pub fn can_open(&self) -> bool
pub fn inc_connections(&mut self) -> Option<usize>
Sourcepub fn dec_connections(&mut self) -> Option<usize>
pub fn dec_connections(&mut self) -> Option<usize>
TODO: normalize with saturating_sub()
pub fn set_connection_time(&mut self, dur: Duration)
pub fn peak_ewma_connection(&mut self) -> f64
pub fn try_connect(&mut self) -> Result<TcpStream, BackendError>
Trait Implementations§
impl StructuralPartialEq for Backend
Auto Trait Implementations§
impl Freeze for Backend
impl RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnwindSafe for Backend
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