|
|
|
@ -1,26 +0,0 @@ |
|
|
|
use std::net::SocketAddr;
|
|
|
|
|
|
|
|
use anyhow::Context;
|
|
|
|
use tokio::net::TcpListener;
|
|
|
|
use tokio::sync::oneshot;
|
|
|
|
|
|
|
|
struct ServerHandle {
|
|
|
|
address: SocketAddr,
|
|
|
|
shutdown_tx: oneshot::Sender<()>,
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Server {
|
|
|
|
listener: TcpListener,
|
|
|
|
shutdown_rx: oneshot::Receiver<()>,
|
|
|
|
}
|
|
|
|
|
|
|
|
struct ServerBuilder {
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ServerBuilder {
|
|
|
|
pub async fn bind(self) -> anyhow::Result<(Server, ServerHandle)> {
|
|
|
|
let listener = TcpListener::bind("localhost:0").await.context("binding")?;
|
|
|
|
unimplemented!();
|
|
|
|
}
|
|
|
|
}
|