diff --git a/quinn/src/builders.rs b/quinn/src/builders.rs index 6f090acf2..f8334df81 100644 --- a/quinn/src/builders.rs +++ b/quinn/src/builders.rs @@ -40,13 +40,17 @@ where /// Build an endpoint bound to `addr` /// - /// Must be called from within a tokio runtime context. + /// Must be called from within a tokio runtime context. To avoid consuming the + /// `EndpointBuilder`, call `clone()` first. pub fn bind(self, addr: &SocketAddr) -> Result<(Endpoint, Incoming), EndpointError> { let socket = std::net::UdpSocket::bind(addr).map_err(EndpointError::Socket)?; self.with_socket(socket) } - /// Build an endpoint around a pre-configured socket. + /// Build an endpoint around a pre-configured socket + /// + /// Must be called from within a tokio runtime context. To avoid consuming the + /// `EndpointBuilder`, call `clone()` first. pub fn with_socket( self, socket: std::net::UdpSocket,