pub struct Relay<F, S, P = Pool>{ /* private fields */ }Expand description
tcp relay
Implementations§
Source§impl<F, S, P> Relay<F, S, P>
impl<F, S, P> Relay<F, S, P>
pub fn build<B: FnOnce(Builder<P, F>) -> Builder<P, F>>( b: B, ) -> Result<Self, Error>
pub fn bind_addrs(&self) -> &Vec<SocketAddr>
pub fn relay_fn(&self) -> Arc<F>
pub fn pool(&self) -> Arc<P>
Sourcepub fn set_max_conn(&self, max: Option<usize>)
pub fn set_max_conn(&self, max: Option<usize>)
设置最大连接数
Sourcepub fn set_keepalive(&self, duration: Option<Duration>)
pub fn set_keepalive(&self, duration: Option<Duration>)
设置空闲连接保留时长
Sourcepub fn add_backend(&self, addr: Address)
pub fn add_backend(&self, addr: Address)
添加一个后端地址
Sourcepub fn remove_backend(&self, addr: &Address) -> bool
pub fn remove_backend(&self, addr: &Address) -> bool
移除一个后端地址
Trait Implementations§
Auto Trait Implementations§
impl<F, S, P> Freeze for Relay<F, S, P>
impl<F, S, P = Pool> !RefUnwindSafe for Relay<F, S, P>
impl<F, S, P> Send for Relay<F, S, P>
impl<F, S, P = Pool> !Sync for Relay<F, S, P>
impl<F, S, P> Unpin for Relay<F, S, P>
impl<F, S, P = Pool> !UnwindSafe for Relay<F, S, P>
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