pub struct FixedUpstreamTcpRelay { /* private fields */ }Expand description
A bound TCP listener that relays each connection to one explicit upstream.
Implementations§
Source§impl FixedUpstreamTcpRelay
impl FixedUpstreamTcpRelay
Sourcepub async fn bind(
listen_addr: SocketAddr,
upstream_addr: SocketAddr,
) -> Result<Self>
pub async fn bind( listen_addr: SocketAddr, upstream_addr: SocketAddr, ) -> Result<Self>
Binds listen_addr and records the explicit fixed upstream.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the bound listener address.
Sourcepub fn upstream_addr(&self) -> SocketAddr
pub fn upstream_addr(&self) -> SocketAddr
Returns the configured fixed upstream.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FixedUpstreamTcpRelay
impl RefUnwindSafe for FixedUpstreamTcpRelay
impl Send for FixedUpstreamTcpRelay
impl Sync for FixedUpstreamTcpRelay
impl Unpin for FixedUpstreamTcpRelay
impl UnsafeUnpin for FixedUpstreamTcpRelay
impl UnwindSafe for FixedUpstreamTcpRelay
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