pub struct Bound { /* private fields */ }Expand description
A bound socket and the route table that will answer on it.
One type rather than a (TcpListener, Router) tuple, because the two are
only ever used together and a tuple is two things a caller can swap the
halves of — the same argument
OpenedUpstream makes about
a leg and a peer.
Implementations§
Source§impl Bound
impl Bound
Sourcepub const fn addr(&self) -> SocketAddr
pub const fn addr(&self) -> SocketAddr
The address this actually took, which is not the one asked for when the
caller passed port 0.
Sourcepub async fn serve(self) -> Result<(), BridgeServeError>
pub async fn serve(self) -> Result<(), BridgeServeError>
Serves until the accept loop fails.
§Errors
BridgeServeError::Bind if the socket fails while serving.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Bound
impl !RefUnwindSafe for Bound
impl !UnwindSafe for Bound
impl Send for Bound
impl Sync for Bound
impl Unpin for Bound
impl UnsafeUnpin for Bound
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