Struct pingora_load_balancing::Backend
source · pub struct Backend {
pub addr: SocketAddr,
pub weight: usize,
}Expand description
Backend represents a server to proxy or connect to.
Fields§
§addr: SocketAddrThe address to the backend server.
weight: usizeThe relative weight of the server. Load balancing algorithms will proportionally distributed traffic according to this value.
Implementations§
Methods from Deref<Target = SocketAddr>§
sourcepub fn as_inet(&self) -> Option<&SocketAddr>
pub fn as_inet(&self) -> Option<&SocketAddr>
Get a reference to the IP socket if it is one
sourcepub fn as_unix(&self) -> Option<&SocketAddr>
pub fn as_unix(&self) -> Option<&SocketAddr>
Get a reference to the Unix domain socket if it is one
Trait Implementations§
source§impl Ord for Backend
impl Ord for Backend
source§impl PartialEq for Backend
impl PartialEq for Backend
source§impl PartialOrd for Backend
impl PartialOrd for Backend
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl ToSocketAddrs for Backend
impl ToSocketAddrs for Backend
§type Iter = Once<SocketAddr>
type Iter = Once<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
SocketAddrs. Read moreimpl Eq for Backend
impl StructuralPartialEq for Backend
Auto Trait Implementations§
impl RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnwindSafe for Backend
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.