pub struct ConnectionServer(/* private fields */);Expand description
Serves caller-accepted connections against one runtime. Obtained from
RuntimeHandle::connection_server; cheap to clone into the task that
owns each connection.
Implementations§
Source§impl ConnectionServer
impl ConnectionServer
Sourcepub async fn serve(
&self,
stream: TcpStream,
remote_addr: SocketAddr,
) -> Result<()>
pub async fn serve( &self, stream: TcpStream, remote_addr: SocketAddr, ) -> Result<()>
Serve one accepted connection until the peer disconnects or the
runtime shuts down. See RuntimeHandle::serve_connection.
Sourcepub fn client_count(&self) -> usize
pub fn client_count(&self) -> usize
Number of WebSocket clients currently connected to the runtime.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionServer
impl !UnwindSafe for ConnectionServer
impl Freeze for ConnectionServer
impl Send for ConnectionServer
impl Sync for ConnectionServer
impl Unpin for ConnectionServer
impl UnsafeUnpin for ConnectionServer
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