use futures::Future;
use std::io;
pub enum ServerReady<G, S> {
Server(S),
Graceful(G),
}
impl<S: Future<Output = io::Result<()>>, G: Future<Output = io::Result<()>>> ServerReady<S, G> {
pub async fn launch(self) -> io::Result<()> {
info!(service.status = "Starting");
match self {
ServerReady::Server(s) => s.await?,
ServerReady::Graceful(g) => g.await?,
};
Ok(())
}
}