pub struct Relay<F, S, P = Pool>{ /* private fields */ }Expand description
udp 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>)
设置空闲连接保留时长
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