pub struct BackendEndpoint {
pub id: String,
pub address: String,
pub weight: u32,
pub healthy: bool,
/* private fields */
}Expand description
Backend endpoint information
Fields§
§id: StringEndpoint ID
address: StringEndpoint address
weight: u32Endpoint weight (for weighted strategy, default: 1)
healthy: boolWhether endpoint is healthy
Implementations§
Source§impl BackendEndpoint
impl BackendEndpoint
Sourcepub fn with_weight(self, weight: u32) -> Self
pub fn with_weight(self, weight: u32) -> Self
Create with weight
Sourcepub fn active_connections(&self) -> usize
pub fn active_connections(&self) -> usize
Get active connections count
Sourcepub fn total_requests(&self) -> u64
pub fn total_requests(&self) -> u64
Get total requests served
Trait Implementations§
Source§impl Clone for BackendEndpoint
impl Clone for BackendEndpoint
Source§fn clone(&self) -> BackendEndpoint
fn clone(&self) -> BackendEndpoint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackendEndpoint
impl Debug for BackendEndpoint
Source§impl From<ServiceInfo> for BackendEndpoint
impl From<ServiceInfo> for BackendEndpoint
Source§fn from(service: ServiceInfo) -> Self
fn from(service: ServiceInfo) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for BackendEndpoint
impl RefUnwindSafe for BackendEndpoint
impl Send for BackendEndpoint
impl Sync for BackendEndpoint
impl Unpin for BackendEndpoint
impl UnwindSafe for BackendEndpoint
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