pub async fn serve<U>(self, addr: U)
    where
        U: Into<SocketAddr>,
        A: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Never>
            + NamedService
            + Clone
            + Send
            + Sync
            + 'static,
        A::Future: Send + 'static,
        B: Service<(String, Request<BoxBody>), Response = Response<BoxBody>, Error = Never>
            + Clone
            + Send
            + Sync
            + 'static,
        B::Future: Send + 'static,
    {
        let server_clone = warp::any().map(move || self.clone());

        warp::serve(warp::path::end().and(warp::ws()).and(server_clone).map(
            |ws: warp::ws::Ws, server_clone| {
                ws.on_upgrade(|socket| handle_connection2(socket, server_clone))
            },
        ))
        .run(addr)
        .await;
    }
/// Start serving the endpoint on the provided addres (see [example](Server)).
///
/// # Arguments
/// - `addr`: The address on which to serve the endpoint.
///
/// # Returns
/// - It doens't.
Start serving the endpoint on the provided addres ).
Start serving the endpoint on the provided addres ) .
pub async fn serve<U>(self, addr: U)
    where
        U: Into<SocketAddr>,
        A: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Never>
            + NamedService
            + Clone
            + Send
            + Sync
            + 'static,
        A::Future: Send + 'static,
        B: Service<(String, Request<BoxBody>), Response = Response<BoxBody>, Error = Never>
            + Clone
            + Send
            + Sync
            + 'static,
        B::Future: Send + 'static,
    {
        let server_clone = warp::any().map(move || self.clone());
        warp::serve(warp::path::end().and(warp::ws()).and(server_clone).map(
            |ws: warp::ws::Ws, server_clone| {
                ws.on_upgrade(|socket| handle_connection2(socket, server_clone))
            },
        ))
        .run(addr)
        .await;
    }
pub async fn serve < U > ( self , addr : U ) where U : Into < SocketAddr > , A : Service < Request < BoxBody > , Response = Response < BoxBody > , Error = Never > + NamedService + Clone + Send + Sync + ' static , A :: Future : Send + ' static , B : Service < ( String , Request < BoxBody > ) , Response = Response < BoxBody > , Error = Never > + Clone + Send + Sync + ' static , B :: Future : Send + ' static , { let server_clone = warp :: any ( ) . map ( move | | self . clone ( ) ) ; warp :: serve ( warp :: path :: end ( ) . and ( warp :: ws ( ) ) . and ( server_clone ) . map ( | ws : warp :: ws :: Ws , server_clone | { ws . on_upgrade ( | socket | handle_connection2 ( socket , server_clone ) ) } , ) ) . run ( addr ) . await ; }
Start serving the endpoint on the provided addres (see [example](Server)).
Start serving the endpoint on the provided addres ( see [ example ] ( Server )) .
None
self
addr
U
The address on which to serve the endpoint.
The address on which to serve the endpoint .